Thanks for this, @mgongee. Will get it fixed up in the next plugin version.
Update:
I’ve tested this issue in WP 5.2.2 with default theme and no plugins, and HTML was escaped and displayed properly. But in WP 5.4.2 (with default theme and no plugins) HTML is not escaped.
Hey @mgongee, I tried replicating this issue but could not repeat your results. I am running latest WordPress, tried adding your code snippet via the Prismatic/Highlight.js block. I recorded the test here (zipped MP4 video):
https://perishablepress.com/share/prismatic-code-escaping.zip
You can see that I paste the code, save changes, refresh the page, and view the post on the front-end. Thru all of that the code is escaped properly. This is using the setting “Code Escaping” set to “Frontend & Admin Area”.
So there must be something else conflicting, or maybe I am missing something. Please let me know if I can provide any further infos. Thank you.
Hi, I want to clarify that we are using post editor in classic mode (via “Classic editor” plugin) on WP 5.4.2
Here are screenshots of the edit process:
http://staging11.baeldung.com/Selection_037.png
http://staging11.baeldung.com/Selection_038.png
http://staging11.baeldung.com/Selection_039.png
Thanks for the feedback, @mgongee. Will take another look at this for the next update. Much appreciated.
Hey Jeff,
Just wanted to see if happen to have had a chance to look into this weird issue with the tags?
Thanks,
Eugen.
No, I’ve completed plugin updates for WP 5.5. Next updates are due in December, or whenever WP 5.6 rolls out. Thanks for your patience.
Just to follow up. This issue is resolved in the next version of the plugin. Should be released later today or tomorrow. Thanks again for your help, @mgongee.
Hi Jeff,
we tested new plugin version (2.6) and the issue is still there. How to reproduce it:
0. Select “Highlight.js” as the library to use
1. Create a new post with Gutenberg Editor on WordPress 5.5
2. Insert new Prismatic block into it
3. Put the following code into Prismatic block:
<dependencies>
<dependency>
<groupId>com.baeldung</groupId>
<artifactId>optional-project</artifactId>
<version>1.0</version>
<optional>true</optional>
</dependency>
</dependencies>
4. Publish the post and check the result on front end. XML tags would be stripped.
Screenshots: https://imgur.com/a/jpe1AFS
I’ve checked and there is corresponding line in the “buttons-highlight.js” ( #105 ):
ed.insertContent(‘
<code class="language-'+ code.language +'">'+ code.snippet + '
‘);
we solved this issue on our site by replacing this line with fixed version:
ed.insertContent(‘
<code class="language-'+ code.language +'">'+ tinymce.DOM.encode(code.snippet) + '
‘);
-
This reply was modified 4 years ago by mgongee.
-
This reply was modified 4 years ago by mgongee.
Yeah this was done last update for the prism button. Will add to the highlight button as well. Thank you for the feedback, @mgongee.