# @text Component Mutations

**URL:** <https://forums.realmacsoftware.com/t/text-component-mutations/45275>\
**Category:** RapidWeaver Elements\
**Created:** [November 14, 2024, 8:28pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275 "2024-11-14T20:28:02Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [November 14, 2024, 8:28pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/1 "2024-11-14T20:28:02Z")

</div>

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 😉

---

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [November 20, 2024, 5:20pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/2 "2024-11-20T17:20:37Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [November 20, 2024, 6:32pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/3 "2024-11-20T18:32:00Z")

</div>

@Bill

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

when I view the source in safari I see this

 ![CleanShot 2024-11-20 at 18.34.49@2x](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/b/0/b09c693b9db1c4d89bc8310fbeba6e978c08beda.png)

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [November 20, 2024, 6:44pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/4 "2024-11-20T18:44:34Z")

</div>

modified still does not work dropped in tailwind play no issues

---

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [November 20, 2024, 8:01pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/5 "2024-11-20T20:01:24Z")

</div>

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.

 ![edit_incorrect_linebreak](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/2/8/28ee73a7f866dab6fd53326dbec429261acd7bfc.png)

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

 ![preview_incorrect_space](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/1/1/11e454412150cac917a123e05ea75ec97772087e.png)

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

 ![edit_incorrect_withedit](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/5/a/5aa5856e5771978e60cecf2765d27a88d5fdb6f8.png)

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [November 21, 2024, 8:13am UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/6 "2024-11-21T08:13:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [November 21, 2024, 12:05pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/7 "2024-11-21T12:05:10Z")

</div>

@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

```auto

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

```

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

---

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [November 21, 2024, 5:16pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/8 "2024-11-21T17:16:26Z")

</div>

Here’s a very simple code mutation example for @text:  
[File Link](https://dl.elementsapp.cloud/g/McRcWUjPkLSB)

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [November 21, 2024, 5:21pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/9 "2024-11-21T17:21:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bill/32/107_2.png) [@Bill](https://forums.realmacsoftware.com/u/Bill)\
**Post date:** [November 21, 2024, 5:24pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/10 "2024-11-21T17:24:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [November 21, 2024, 5:25pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/11 "2024-11-21T17:25:43Z")

</div>

yes but watch this

will leave it now as you just said

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [November 21, 2024, 9:59pm UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/12 "2024-11-21T21:59:06Z")

</div>

> [@Bill](#):
>
> Here’s a very simple code mutation example for @text:  
> [File Link](https://dl.elementsapp.cloud/g/McRcWUjPkLSB)

Thanks @Bill - will take a look tomorrow!

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

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [November 22, 2024, 11:10am UTC](https://forums.realmacsoftware.com/t/text-component-mutations/45275/13 "2024-11-22T11:10:22Z")

</div>

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 🤞
