GWicke has submitted this change and it was merged.
Change subject: Serialize image-spans without hacking the span tag.
......................................................................
Serialize image-spans without hacking the span tag.
* The serializer code had a long-standing hack where the span node
was modified by setting rel and href attributes on it so as to
reuse the link-handler set on the a-tag.
* This hack then introduced artificial semantic errors in roundtrip
tests on the href='' attribute set on the span (modification of DOM
input to the serializer). Try the following roundtrip test.
node roundtrip-test.js --prefix pl Mistrzostwa_Słowacji_w_Lekkoatletyce_2011
* This patch eliminates the hack since it is no longer necessary
and the span tag handler can handle mw:Image spans correctly.
* No change in parser test results, but eliminates false semantic
error reports on the above page (and possibly other pages as well).
Change-Id: Icb94f8298328685c0f006a975308da47df2a0ebd
---
M js/lib/mediawiki.WikitextSerializer.js
1 file changed, 0 insertions(+), 11 deletions(-)
Approvals:
GWicke: Verified; Looks good to me, approved
diff --git a/js/lib/mediawiki.WikitextSerializer.js
b/js/lib/mediawiki.WikitextSerializer.js
index 8298168..1d22321 100644
--- a/js/lib/mediawiki.WikitextSerializer.js
+++ b/js/lib/mediawiki.WikitextSerializer.js
@@ -2688,17 +2688,6 @@
};
}
}
- if (nodeName === 'span' && nodeTypeOf === 'mw:Image') {
- // Hack: forward this span to DOM-based link handler until the
span
- // handler is fully DOM-based.
-
- // Fake regular link attributes
- // Set rel in addition to typeof
- node.setAttribute('rel', 'mw:Image');
- // And set an empty href, so that
- node.setAttribute('href', '');
- return self.tagHandlers.a || null;
- }
if (dp.stx === 'html' ||
( node.getAttribute('data-parsoid') === null &&
--
To view, visit https://gerrit.wikimedia.org/r/65858
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icb94f8298328685c0f006a975308da47df2a0ebd
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits