Page MenuHomePhabricator

HTML entities inside tag attributes fail round-tripping
Closed, ResolvedPublic

Description

Maybe related to bug 41217.

Try to round-trip <span title="&#x36;">a</span>


Version: unspecified
Severity: normal

Details

Reference
bz41226

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:03 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz41226.

Verified, still the case.

This is a bit lower priority for us as it 'only' produces a syntactic diff- the content does not really change. We'll see how far we get with selective serialization, and might add extra support for this if that is not sufficient.

Do you see any situations where this could be an issue beyond producing a dirty diff?

(In reply to comment #1)

Do you see any situations where this could be an issue beyond producing a dirty
diff?

Yes. <span title="&amp;amp;">a</span> round trips to <span title="&amp;">a</span> which is a different attribute.

Patch pushed for review in https://gerrit.wikimedia.org/r/#/c/43859/. In attributes, this patch does not preserve unnecessary entities like a bare '&' escaped to &amp;. It can thus still cause syntactic diffs, but will avoid semantic diffs.

The patch also adds escaping for newly created entity-like text content.