You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't get the same output... The outer span tag renders correctly with the appropriate data attributes, and the image tag also renders and shows the user's avatar.
The issue then is what happens after that image tag - as I simply cannot get the user's name to render.
If I have it as per the code above, then what happens is it outputs an additional html tag after the img tag, with that tag being the user's first name. For example, if the user is named "Dave", then it will render a <dave></dave> tag pair.
It may perhaps simply be a syntax thing that I'm missing, but I've tried a number of other combinations:
Changing the last part to strval(" " . $user->first_name) to try and return a string with a space in front of it - however this causes and error
I've tried adding another span tag after the image tag like so:
which actually does render the extra span tag, including adding the mention__name class to that span... but then throws an error that it's expecting the last part to be an array, not a string.
I've also tried then putting both the image tag and the name string inside of an array to make this combined content array be the third part of the returned array, but this also causes other errors.
I also tried other combinations of elements such as making the parent a div, or wrapping the name in a p tag thinking it may be a semantics thing, but still got the same sort of errors
So my thinking is that either:
I'm missing some simple syntax issue in order to render something like <span class="mention"><img src="url" class="mention__avatar"> Name</span>
OR, the renderHTML function for the PHP version of Tiptap wasn't written to accomodate this kind of nesting of content
Any help or tips would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Hi there,
Here's my situation:
Here is my working Javascript version of the renderHTML function:
When I try and do something similar in the PHP version:
I don't get the same output... The outer span tag renders correctly with the appropriate data attributes, and the image tag also renders and shows the user's avatar.
The issue then is what happens after that image tag - as I simply cannot get the user's name to render.
If I have it as per the code above, then what happens is it outputs an additional html tag after the img tag, with that tag being the user's first name. For example, if the user is named "Dave", then it will render a
<dave></dave>
tag pair.It may perhaps simply be a syntax thing that I'm missing, but I've tried a number of other combinations:
strval(" " . $user->first_name)
to try and return a string with a space in front of it - however this causes and errorwhich actually does render the extra span tag, including adding the
mention__name
class to that span... but then throws an error that it's expecting the last part to be an array, not a string.p
tag thinking it may be a semantics thing, but still got the same sort of errorsSo my thinking is that either:
<span class="mention"><img src="url" class="mention__avatar"> Name</span>
Any help or tips would be greatly appreciated.
The text was updated successfully, but these errors were encountered: