Update Parsoid to generate modern HTML5 IDs w/ legacy fallback

The citation portion contains fixes for []-encoding in attributes,
based on Iec3439f76ecc2a3543b30b35f8735c92b0cfb711.

Fix some other no- or double-encoding issues with HTML entities in the
process, based on I88e8e2077e6f5eec2b232391f7818370894a62dc
(T103714/T104196).

Unrelated parsertest fix which needed an id fix -- incorrect id
added by the section-tag patches exposed here.

Bug: T152540
Bug: T103714
Change-Id: I12b2a148f7170d20bd9aacd3b5b8ee1965859592
This commit is contained in:
C. Scott Ananian 2017-09-12 18:19:06 -04:00 committed by Subramanya Sastry
parent d188af60d0
commit 228325cb09

View file

@ -181,8 +181,11 @@ function makeValidIdAttr(val) {
// Looks like Cite.php doesn't try to fix ids that already have
// a "_" in them. Ex: name="a b" and name="a_b" are considered
// identical. Not sure if this is a feature or a bug.
// It also considers entities equal to their encoding (i.e. '&' === '&').
return Sanitizer.escapeId(val, { noninitial: true });
// It also considers entities equal to their encoding
// (i.e. '&' === '&'), which is done:
// in PHP: Sanitizer#decodeTagAttributes and
// in Parsoid: ExtensionHandler#normalizeExtOptions
return Sanitizer.escapeIdForAttribute(val);
}
RefGroup.prototype.renderLine = function(env, refsList, ref) {