Currently if you use the HTML option in the news tool TinyMCE does automatic code cleanup and this can be problematic. If I enter into the HTML field: <i class="fa fa-facebook-official" aria-hidden="true"></i> The editor thinks this is nothing and won't update code at all. IF I enter: <i class="fa fa-facebook-official" aria-hidden="true">TEST</i> the editor changes it to: <p><em class="fa fa-facebook-official">TEST</em></p> It would be better if the feature didn't auto cleanup HTML.
+1
In my opinion we should replace TinyMCE with CodeMirror here.
(In reply to Lucas Gass from comment #3) > In my opinion we should replace TinyMCE with CodeMirror here. Making it an option like the WYSIQY editor for prefs is might be nice. So you can switch if you want to do more elaborate things and keep the editor for people not fond of code?
Created attachment 101917 [details] [review] Bug 24764: TinyMCE shouldnt do automatic code cleanup when editing HTML in News Feature TEST PLAN: 1. Make a new news item and use the TinyMCE editor, click on the <> icon to go to the Source code editor 2. Add some HTML like <i class="fa fa-facebook-official" aria-hidden="true">TEST</i> and save it. 3. Go back in and notice that TinyMCE has changed it to: <p><em class="fa fa-facebook-official">TEST</em></p> 4. It should not auto clean up and also it should not autowrap with <p> tag. 5. Apply patch patch, and repeat step 2. Save again. 6. It should not have automatiicly changed any HTML or added any <p> wrapper.
This patch fixes the automatic code clean up problem with tinyMCE. A discussion of wether CodeMirror might be a better option (or ability to use either) is for a different bug, I think.
(In reply to Lucas Gass from comment #6) > This patch fixes the automatic code clean up problem with tinyMCE. A > discussion of wether CodeMirror might be a better option (or ability to use > either) is for a different bug, I think. Agreed, I filed bug 22660 :)
Awesome! I'm going to put this on my todo list. In the middle of something else at the moment, but hoping to sign this off today. Been bitten by this issue more often than I'd like.
Created attachment 101929 [details] [review] Bug 24764: TinyMCE shouldnt do automatic code cleanup when editing HTML in News Feature TEST PLAN: 1. Make a new news item and use the TinyMCE editor, click on the <> icon to go to the Source code editor 2. Add some HTML like <i class="fa fa-facebook-official" aria-hidden="true">TEST</i> and save it. 3. Go back in and notice that TinyMCE has changed it to: <p><em class="fa fa-facebook-official">TEST</em></p> 4. It should not auto clean up and also it should not autowrap with <p> tag. 5. Apply patch patch, and repeat step 2. Save again. 6. It should not have automatiicly changed any HTML or added any <p> wrapper. Signed-off-by: David Cook <dcook@prosentient.com.au>
Created attachment 102778 [details] [review] Bug 24764: TinyMCE shouldnt do automatic code cleanup when editing HTML in News Feature TEST PLAN: 1. Make a new news item and use the TinyMCE editor, click on the <> icon to go to the Source code editor 2. Add some HTML like <i class="fa fa-facebook-official" aria-hidden="true">TEST</i> and save it. 3. Go back in and notice that TinyMCE has changed it to: <p><em class="fa fa-facebook-official">TEST</em></p> 4. It should not auto clean up and also it should not autowrap with <p> tag. 5. Apply patch patch, and repeat step 2. Save again. 6. It should not have automatiicly changed any HTML or added any <p> wrapper. Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> https://bugs.koha-community.org/show_bug.cgi?id=24709 https://bugs.koha-community.org/show_bug.cgi?id=24706
Nice work everyone! Pushed to master for 20.05
backported to 19.11.x for 19.11.06
backported to 19.05.x for 19.05.11