Assigning to textContent escapes HTML entities

RESOLVED INVALID

Status

P1
normal
RESOLVED INVALID
6 years ago
6 years ago

People

(Reporter: stas, Assigned: gandalf)

Tracking

unspecified
1.0 beta
x86_64
Linux

Details

(Reporter)

Description

6 years ago
" " becomes " " and in effect, the user sees " "
(Reporter)

Comment 1

6 years ago
This is critical.
Priority: -- → P1
Target Milestone: --- → 1.0 beta
(Assignee)

Updated

6 years ago
Assignee: nobody → gandalf
(Assignee)

Comment 2

6 years ago
I can't reproduce or I don't understand.

<entity "Text &gt; Text">

shows up as "Text &gt; Text" in HTML

<entity "Text > Text" shows up as "Text > Text".
(Reporter)

Comment 3

6 years ago
(In reply to Zbigniew Braniecki [:gandalf] from comment #2)

> <entity "Text &gt; Text">

Shouldn't this show up as "Text > Text"?
(Assignee)

Comment 4

6 years ago
why? We're not parsing HTML here, it's not an HTML overlay. It's text, and we inject it and display properly... "Foo <a> Foo" will also be displayed this way.
(Reporter)

Comment 5

6 years ago
I agree with this, but I wonder whether this is the least surprising behavior that we can offer.

Essentially, we break &nbsp;, &zwj;, &zwnj; and the like in non-overlay nodes.

I'm happy telling devs and localizers to just use Unicode, so → instead of &rarr; and same for &nbsp;, &zwj;, &zwnj;. I just want this a conscious decision.

Let's close this as invalid if you agree.
(Assignee)

Comment 6

6 years ago
yes. Unicode. innerHTML for overlays only.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.