Issue #3069Opened October 9, 2020by orosl0 reactions

BUG: Style gone on link or nested text elements after exiting edit

Question

Hello,

I am editing legacy HTML with version 0.16.3 + newsleter-plugin. The style is stored inline (since the tool is used for authoring emails) and I use the feature componentFirst: true .

I am facing a problem when trying to edit Component Text that has other text elements inside.

<div  style="font-size: 20px;" class="my-class" > 
            A text component  
           <span style="font-size: 35px;">---and a text inside---</span>
</div>

Once I edit the text from the parent div, the styling of the nested element disappears at blur. The inline style is stored on the id and the id of the subnode is completely removed.
How can I stop this from happening?

The behavior is presented in this JSFiddle: https://jsfiddle.net/jsh8yv4p/

I have read about including the text inside the parent div in a span or another text element, but since the HTML that is loaded in the editor is legacy I do not want to alter its structure in this manner.

Is there any way I can edit text(that might have subnodes) and not alter the subnodes?

Thank you in advance, Lavinia

Answers (3)

artfOctober 13, 20200 reactions

Hi @orosl, thanks for the report. I was able to find and fix the bug so, it'll be available in the next release.

oroslOctober 29, 20200 reactions

Hi @artf, thank you very much for your prompt response and release. I upgraded with the latest version 0.16.27. However I still encounter the problem, but with a slightly different behavior.

I am not sure if I should open a new issue since it is partially solved but nonetheless, I will explain the behavior here.

Given a similar configuration as above and presented in this demo: https://jsfiddle.net/x5srzpvk/5

If I change the styling of the link(or any other such element) in the nested span element, after an edit, the styling is lost since the id is altered (styling is kept on the id).

So, id: jp365 transforms into jp365-2 and continues to be added -2-2 after each edit. I encountered this behavior in multiple similar situations. Also, the HTML gets difficult to read after many edits, as the ids increase in size.

Is there any way I can stop the process of altering ids of subnodes if text is edited?

Thank you and much appreciation, Lavinia

artfNovember 15, 20200 reactions

Thanks @orosl actually the fix was working with inner components but not with nested ones. I'll fix it in the next release

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.