Subramanya Sastry has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/327564 )
Change subject: Linter: Fix obsolete tags linting + ignore BIG
......................................................................
Linter: Fix obsolete tags linting + ignore BIG
* Use the list of obsolete tags from the constants list
and build a regexp from that.
* Ignore BIG since it seems all editors provide buttons to
add them to wikitext.
Change-Id: I05e55753e307f4536ccb276e36db86d60d532e3f
---
M lib/wt2html/pp/handlers/linter.js
1 file changed, 9 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/64/327564/1
diff --git a/lib/wt2html/pp/handlers/linter.js
b/lib/wt2html/pp/handlers/linter.js
index 05973c3..6719baa 100644
--- a/lib/wt2html/pp/handlers/linter.js
+++ b/lib/wt2html/pp/handlers/linter.js
@@ -14,6 +14,7 @@
var DU = require('../../../utils/DOMUtils.js').DOMUtils;
var Util = require('../../../utils/Util.js').Util;
+var Consts = require('../../../config/WikitextConstants.js').WikitextConstants;
/*
* Log Transclusion with more than one parts
@@ -212,14 +213,15 @@
return nextSibling;
}
-/*
- * Log obsolete HTML tags like BIG, CENTER, FONT, STRIKE, and TT
- * See - http://www.w3.org/TR/html5/obsolete.html#non-conforming-features
- */
-function logObsoleteHTMLTags(env, c, dp, tplInfo) {
- var re = /^(BIG|CENTER|FONT|STRIKE|TT)$/;
+var obsoleteTagsRE = new RegExp('(' +
+ // Looks all existing editors let editors add the <big> tag.
+ // VE has a button to add <big>, it seems so does the WikiEditor
+ // and JS wikitext editor. So, don't flag BIG as an obsolete tag.
+ Consts.HTML.OlderHTMLTags.join('|').replace(/\|BIG/, '')
+ + ')');
- if (!(dp.autoInsertedStart && dp.autoInsertedEnd) &&
re.test(c.nodeName)) {
+function logObsoleteHTMLTags(env, c, dp, tplInfo) {
+ if (!(dp.autoInsertedStart && dp.autoInsertedEnd) &&
obsoleteTagsRE.test(c.nodeName)) {
var templateInfo;
if (tplInfo) {
templateInfo = { name:
DU.findEnclosingTemplateName(tplInfo) };
--
To view, visit https://gerrit.wikimedia.org/r/327564
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I05e55753e307f4536ccb276e36db86d60d532e3f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits