Does <br> correspond to LINE SEPARATOR (U+2028)?

149 views Asked by At

Let say I have the following text (in typing order from left to right) where the line break is U+2028 and capital letter represent arabic letter and everything else represent itself.

foo FOO
!BAR@

I put them in html like this,

<p dir="auto">foo FOO<br>!BAR@</p>

chromium and firefox both display them as,

foo OOF
!RAB@

Based on my understanding of Unicode Bidirectional Algorithm (and by also viewing the plain text in text editor) the '!' and '@' should be displayed next to each other. Like this,

foo OOF
RAB!@

Is this a bug in the browser or <br> does not actually correspond to U+2028? And how to insert (or have the semantic of) U+2028?

Browsers only display blank horizontal space for &#x2028; (I put the spaces for quoting).

1

There are 1 answers

1
saurabh On

The visually rendered output of this HTML...

<p dir="auto"> foo FOO <br> !BAR@ </p>

will be

foo FOO
!BAR@

because <br> tag is used for line breaker