Home > Back-end >  use direction="rtl" in pre with html tags
use direction="rtl" in pre with html tags

Time:11-01

I try to figure out why in Pre tag with direction="dir" attributes with quotes in html tags looks wrong and how it can be fixed.

Print inside pre element html tags with attributes and quotes:

<html meta="test">

looks like this:

<"html meta="test>

css attribute unicode-bidi: bidi-override; not fits for me, i need to safe html tags structure.

live example: https://codepen.io/justillusion/pen/GRGoRNv

best regards.

CodePudding user response:

Using the &lrm to your punctuations seems to have fixed the problem.

Your snippet would look something like this;

   <pre>
        &lt;html meta= test"&lrm;&gt;
        Hello, World!
        &lt;/html&gt;
    </pre>

For more explanation see: https://stackoverflow.com/a/42551367/11226302

There may be other solutions/workarounds as well, but this is what I found to be most practical and useful in cases such as yours!

  •  Tags:  
  • html
  • Related