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
TinyMCE field keeps modifying HTML markup which is pasted via code editor (code plugin) after saving the page a second time. I already "aggressively" changed field and module settings to allow each and every content.
Expected behavior
TinyMCE should accept field/module settings and not modifying HTML markup.
Actual behavior
When pasting HTML via TinyMCE code editor and saving the page twice the HTMl markup is modified and some style properties are removed.
Steps to reproduce the issue
create a field an set input to TinyMCE
set the Pastefilter whitelist in TinyMCE module config to: *[*]
enable the code plugin in field settings
disable HTML purifier in field settings
disable field setting Markup toggles / Convert div tags to p tags on save
set Custom settings JSON / JSON text to: { "valid_elements": "*[*]" }
create/open a page which contains the TinyMCE field
open the code editor and paste the following content:
<h3class="about-title">Loren ipsum</h3><divclass="about-item"><h4>Server Administration</h4><p><em>Lorem ipsum dolor sit amet</em></p><ul><li>Managed up to 5 projects or tasks at a given time while under pressure</li><li>Recommended and consulted with clients on the most appropriate graphic design</li><li>Created 4+ design presentations and proposals a month for clients and account managers</li></ul></div><divclass="about-item"><h4>Email Systems</h4><p><em>Lorem ipsum dolor sit amet</em></p><p>Qui deserunt veniam. Et sed aliquam labore tempore sed quisquam iusto autem sit. Ea vero voluptatum qui ut dignissimos deleniti nerada porti sand markend</p></div><divclass="about-item"><h4>Technical Support & Security</h4><p><em>Lorem ipsum dolor sit amet</em></p><p>Quia nobis sequi est occaecati aut. Repudiandae et iusto quae reiciendis et quis Eius vel ratione eius unde vitae rerum voluptates asperiores voluptatem Earum molestiae consequatur neque etlon sader mart dila</p></div>
now save the page - the HTML markup seems to be fine at this stage
save the page a second time - the HTML markup looks something like this now:
<h3class="about-title">Loren ipsum</h3><p></p><h4>Server Administration</h4><p><em>Lorem ipsum dolor sit amet</em></p><ul><li>Managed up to 5 projects or tasks at a given time while under pressure</li><li>Recommended and consulted with clients on the most appropriate graphic design</li><li>Created 4+ design presentations and proposals a month for clients and account managers</li></ul><p></p><p></p><h4>Email Systems</h4><p><em>Lorem ipsum dolor sit amet</em></p><p>Qui deserunt veniam. Et sed aliquam labore tempore sed quisquam iusto autem sit. Ea vero voluptatum qui ut dignissimos deleniti nerada porti sand markend</p><p></p><p></p><h4>Technical Support & Security</h4><p><em>Lorem ipsum dolor sit amet</em></p><p>Quia nobis sequi est occaecati aut. Repudiandae et iusto quae reiciendis et quis Eius vel ratione eius unde vitae rerum voluptates asperiores voluptatem Earum molestiae consequatur neque etlon sader mart dila</p><p></p>
@gadgetto please edit /wire/modules/Inputfield/InputfieldTinyMCE/InputfieldTinyMCETools.php, line 156 and remove === false so it reads if(in_array(InputfieldTinyMCE::toggleCleanDiv, $toggles) && strpos($value, '<div') !== false) {
@ryancramerdesign I can't disable all options in Markup toggles. If I uncheck all checkboxes, like this:
all checkboxes are checked again after saving the field. I would fix that by setting the default toggles to an empty array, making the checkboxes unchecked by default, as this is the case with the CKE editor.
@gadgetto@matjazpotocnik Thanks, I've pushed a fix for this. I used Matjaz's suggestion and that also seemed to fix the issue Gadgetto mentioned, as I can't duplicate it here any more (the markup divs and classes remain after multiple saves). Though please let me know if you are still observing any issues.
Short description of the issue
TinyMCE field keeps modifying HTML markup which is pasted via code editor (code plugin) after saving the page a second time. I already "aggressively" changed field and module settings to allow each and every content.
Expected behavior
TinyMCE should accept field/module settings and not modifying HTML markup.
Actual behavior
When pasting HTML via TinyMCE code editor and saving the page twice the HTMl markup is modified and some style properties are removed.
Steps to reproduce the issue
*[*]
{ "valid_elements": "*[*]" }
Setup/Environment
Server Details
Server Settings
GD Settings
iMagick Settings
Module Details
The text was updated successfully, but these errors were encountered: