No Code Attached Yet
avatar Scrabble96
Scrabble96
15 Feb 2022

Steps to reproduce the issue

Create an article or custom module with some text containing two spans, one without a class and another with, e.g:

<div>This is some text. <span>This part has a span tag</span> and this doesn't.</div>
<div>This is some additional text. <span class="span">This part also has a span tag</span> and this doesn't.</div>

Save
Tinymce will revert back to the main editor
Toggle back to the code view

Expected result

<div>This is some text. <span>This part has a span tag</span> and this doesn't.</div>
<div>This is some additional text. <span class="span">This part also has a span tag</span> and this doesn't.</div>

Actual result

<div>This is some text. This part has a span tag and this doesn't.</div>
<div>This is some additional text. <span class="span">This part also has a span tag</span> and this doesn't.</div>

System information (as much as possible)

J4.1.0 but I first noticed it yesterday with J.4.0.6

Additional comments

This does not happen with JCE Editor

avatar Scrabble96 Scrabble96 - open - 15 Feb 2022
avatar joomla-cms-bot joomla-cms-bot - change - 15 Feb 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Feb 2022
avatar brianteeman
brianteeman - comment - 15 Feb 2022

Tinymce is stripping the empty span as it does not consider them to be valid markup.

You have two options

  1. In the tinymce plugin change the "use joomla text filter" to on
    image

  2. in the tinymce plugin add span to the list of extended valid elements
    image

avatar Scrabble96
Scrabble96 - comment - 16 Feb 2022

Tinymce is stripping the empty span as it does not consider them to be valid markup.

You have two options

Thank you. You're right, of course. Although I can't see why 'span' isn't allowed by default.

avatar brianteeman
brianteeman - comment - 16 Feb 2022

Thats something to take up with tinyMCE ;)

If this is now resolved please close the issue.

avatar Fedik Fedik - change - 19 Feb 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-02-19 09:39:42
Closed_By Fedik
avatar Fedik Fedik - close - 19 Feb 2022
avatar Fedik
Fedik - comment - 19 Feb 2022

Closing because it is TinyMCE behavior.

Add a Comment

Login with GitHub to post a comment