<xmp> was deprecated in HTML 3.2 and is now obsolete.
Thread Starter
ogi22
(@ogi22)
Oh thanx.
Is there another way to view long HTML code as text?
Without having to replace the character after the character?
Joy
(@joyously)
Didn’t you use it in your question?
<code>HTML code or PHP code or JS code...</code>
Thread Starter
ogi22
(@ogi22)
<code> </code> does not stop rendering HTML code in web browser.
I tried.
https://codepen.io/Ogi22/pen/XxGBvz
-
This reply was modified 7 years, 7 months ago by
ogi22.
-
This reply was modified 7 years, 7 months ago by
ogi22.
Joy
(@joyously)
I see. I was thinking that the < and > characters got converted, but they do not.
Well, the editor keeps it when I use <xmp>, so it might be that your user does not have unfiltered_html capability, or that the filters have changed since version WP 4.7.11 (which is what my test site is running).
Edit: But you really should not use deprecated HTML tags. There does not seem to be an equivalent, because <pre> and <code> still interpret the HTML, so you have to change all the characters yourself. It might be better for you to use a syntax highlighter plugin.