@text Component Mutations

I noticed when using @text callout in a span a couple of things are happening:
<span>@text("textbefore", default: "Before")</span><span>Other Text</span>

So all the text should be inline by default. When I Preview, w/o touching anything it looks correct, ie. ‘BeforeOther Text’

When I edit the ‘Before’ to ‘B’, then there’s a space added after the edited text and an added break
ie. ‘B<space>
<br>’ which looks like this:
'B
Other Text’
Could you guys please look into this as we can’t have mutated code :wink:

@dan I haven’t seen a comment or thumbs up on this and this is going to be a BIG problem. This kind of code mutation was allowed to slip through and remain in Blocs and it has caused HUGE problems for developers. Please - we all need and expect very clean code and text when it’s injected into the dom.

@Bill

I copied your code I get this, is this what you mean

when I view the source in safari I see this

modified still does not work dropped in tailwind play no issues

Looking at beta v21 Now gives different layout from the very beginning, but still wrong.

Here’s with No Changes, Note: the Before is underneath the ‘HTML’ tag - they should be inline, ie. side by side.

And in preview can see a space is added to end of text:

When you make a change to the text in the edit window (not in the control) you get a line break:

Can you share this project via Elements Cloud so we can take a look?

@dan if you copy this into a custom component you will see a space is inserted into the output in safari

If you delete letters in the before text you will see the space still

If you copy into tailwind play you will see no space

Try either of these


span>test</span><span>Other Text</span>

span>@text(“textbefore”, default: “Before”)Other Text

Here’s a very simple code mutation example for @text:
File Link

had to put in a return but just use span with text this issue appears

Yes @upssjw I already pointed all this stuff out. Let’s just give RMS some time to work on fixes.

yes but watch this

will leave it now as you just said

Thanks @Bill - will take a look tomorrow!

Also, any reason you’re not using Elements Cloud to share the file? :face_with_raised_eyebrow: Would be much easier…

Hey @Bill @upssjw, We’ve taken a look at this today and the reason it appears differently in the editor vs Preview is because the Elements Text Editor is in its own div element. We’re going to see if we can fix this today for the next beta… fingers crossed :crossed_fingers: