How to present plain text in a HTML document when pre tag isn't enough?

That’s both happying and saddening on the same time :slight_smile: :frowning:

I’ts happying because the folllowing code was rendered good enough.

<pre dir="ltr">
&lt;figure&gt;
    &lt;img src="img.jpg" alt="Some alternative text"&gt;
    &lt;figcaption&gt;
        Some text under the image
    &lt;/figcaption&gt;
&lt;/figure&gt;
</pre>

I say “good enough” because Drupal re-sorted it like this:

<pre dir="ltr">&lt;figure&gt;
    &lt;img src="img.jpg" alt="Some alternative text"&gt;
    &lt;figcaption&gt;
        Some text under the image
    &lt;/figcaption&gt;
&lt;/figure&gt;
</pre>

For me, these sourcecodes are frustrating, but it still appears nice in page output.

Now then, it’s saddening because the original, much clearer code, does not require vast search and replace operations such as:

  • FROM < TO &lt;
    and
  • FROM > TO &gt;
<pre>
    <figure>
        <img src="img.jpg" alt="Some alternative text"></img>
        <figcaption>Some text under the image</figcaption>
    </figure>
</pre>

It saddens me even more to know that this code won’t be usable until W3C updates <pre> tags to show <figure> tags as plain text as well, and one can only “go figure” if and when it will ever happen.