<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0mm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#44546A;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#993366;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#003300;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='color:#003300'>Loads of people have complained about this.<o:p></o:p></span></p><p class=MsoNormal><a href="https://drupal.stackexchange.com/questions/49131/how-can-i-get-my-wysiwyg-editor-to-stop-ing-up-my-html">https://drupal.stackexchange.com/questions/49131/how-can-i-get-my-wysiwyg-editor-to-stop-ing-up-my-html</a><o:p></o:p></p><p class=MsoNormal><span style='color:#003300'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#003300'>Drupal has some kludges for this sort of thing: </span><a href="https://www.drupal.org/project/wysiwyg_linebreaks">https://www.drupal.org/project/wysiwyg_linebreaks</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Not sure we want to go in that direction.<span style='color:#003300'><o:p></o:p></span></p><p class=MsoNormal><span style='color:#003300'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0mm 0mm 0mm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:EN-GB'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:EN-GB'> Philip Sargent (Gmail) [mailto:philip.sargent@gmail.com] <br><b>Sent:</b> 28 April 2020 20:47<br><b>To:</b> expo-tech@lists.wookware.org<br><b>Subject:</b> Edit This Page - TinyMCE reformats everything<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#993366'>re a conversation I was having with Wookey about using “Edit this page” as a mainstream way of editing the website.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='color:#993366'>recap</span></b><span style='color:#993366'>: <o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'>The Problem is that the TinyMCE plugin insists on entirely reformatting the HTML,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'>so the “differences detector” in git is unable to clearly show that, e.g., a comma has been deleted because<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'>as far as git is concerned, <i>every single line</i> has been changed.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='color:#993366'>Investigation:<o:p></o:p></span></b></p><p class=MsoNormal><span style='color:#993366'>It appears that TinyMCE creates a valid DOM internally, edits that, and outputs it. <o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'>So it will always produce pedantically valid HTML and will always screw up the input layout.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'>The authors are quite unapologetic about this:<o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><a href="http://archive.tinymce.com/forum/viewtopic.php?id=26030">http://archive.tinymce.com/forum/viewtopic.php?id=26030</a><o:p></o:p></p><p class=MsoNormal><span style='color:#993366'>so this will never be changed and is not avoidable.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='color:#993366'>Long-term fix:<o:p></o:p></span></b></p><p class=MsoNormal><span style='color:#993366'>When we edit HTML pages and then push them, we change the git import procedure to reformat the page to be pedantically clean HTML in the format that TinyMCE likes. Then any edits will appear as small edits not as everything changing.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#993366'>Philip<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'><o:p> </o:p></span></p></div></body></html>