mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-11 16:59:40 +00:00
Add 4 new high priority linter categories
* multiple-unclosed-formatting-tags: this is a subset of the unclosed formatting tag lint, but is higher priority because unclosed tags like <small> and <big> compound their effects * unclosed-quotes-in-heading: unclosed wikitext i/b tag with a heading ancestor (this causes breakage which leaks out of the table of content to affect the rest of the page) * multiline-html-table-in-list: html table with newline breaks nested in a list * misc-tidy-replacement-issues: this is a catchall category for infrequent long-tail issues, used to enable speedy deployment of new linter categories during tidy replacement as wikis get RemexHtml enabled. These will have a subtype property to identify the specific issue. Change-Id: Ic2c965132f7a09679574489865bdc81df9e43845
This commit is contained in:
parent
6c89bef061
commit
c0ad96898d
|
@ -121,6 +121,26 @@
|
|||
"enabled": true,
|
||||
"priority": "high",
|
||||
"parser-migration": true
|
||||
},
|
||||
"multiple-unclosed-formatting-tags": {
|
||||
"enabled": true,
|
||||
"priority": "high",
|
||||
"parser-migration": true
|
||||
},
|
||||
"unclosed-quotes-in-heading": {
|
||||
"enabled": true,
|
||||
"priority": "high",
|
||||
"parser-migration": true
|
||||
},
|
||||
"multiline-html-table-in-list": {
|
||||
"enabled": true,
|
||||
"priority": "high",
|
||||
"parser-migration": true
|
||||
},
|
||||
"misc-tidy-replacement-issues": {
|
||||
"enabled": true,
|
||||
"priority": "high",
|
||||
"parser-migration": true
|
||||
}
|
||||
},
|
||||
"LinterSubmitterWhitelist": {
|
||||
|
|
12
i18n/en.json
12
i18n/en.json
|
@ -22,6 +22,10 @@
|
|||
"linter-pager-tidy-whitespace-bug-details": "Tidy whitespace bug",
|
||||
"linter-pager-html5-misnesting-details": "Misnesting in HTML5 (but not in Tidy)",
|
||||
"linter-pager-tidy-font-bug-details": "Font tag changes link color in Tidy but won't in HTML5",
|
||||
"linter-pager-multiple-unclosed-formatting-tags-details": "Multiple unclosed small or big tags on the page",
|
||||
"linter-pager-unclosed-quotes-in-heading-details": "Unclosed quote which leaks out of the table of contents",
|
||||
"linter-pager-multiline-html-table-in-list-details": "Multiline HTML5 table inside a list, rendered differently in HTML5 and Tidy",
|
||||
"linter-pager-misc-tidy-replacement-issues-details": "Miscellaneous markup errors affecting Tidy replacement",
|
||||
"linter-category-fostered": "Fostered content",
|
||||
"linter-category-fostered-desc": "These pages have fostered content.",
|
||||
"linter-category-obsolete-tag": "Obsolete HTML tags",
|
||||
|
@ -48,6 +52,14 @@
|
|||
"linter-category-html5-misnesting-desc": "These misnested tags will behave differently in HTML5 compared to HTML4.",
|
||||
"linter-category-tidy-font-bug": "Tidy bug affecting font tags wrapping links",
|
||||
"linter-category-tidy-font-bug-desc": "Tidy moves these font tags inside links to change link colour",
|
||||
"linter-category-multiple-unclosed-formatting-tags": "Multiple unclosed small or big tags",
|
||||
"linter-category-multiple-unclosed-formatting-tags-desc": "These pages have multiple unclosed small or big tags",
|
||||
"linter-category-unclosed-quotes-in-heading": "Unclosed quote in heading",
|
||||
"linter-category-unclosed-quotes-in-heading-desc": "These pages have an unclosed quote in a heading, which then leaks out of the table of contents.",
|
||||
"linter-category-multiline-html-table-in-list": "Multiline table in list",
|
||||
"linter-category-multiline-html-table-in-list-desc": "Tidy moves table inside or outside the list, while HTML5 extends the list to the rest of the page.",
|
||||
"linter-category-misc-tidy-replacement-issues": "Miscellaneous Tidy replacement issues",
|
||||
"linter-category-misc-tidy-replacement-issues-desc": "These pages have other issues that affect rendering when Tidy is replaced",
|
||||
"linter-numerrors": "($1 {{PLURAL:$1|error|errors}})",
|
||||
"linter-page-title-edit": "$1 ($2)",
|
||||
"linter-page-edit": "edit",
|
||||
|
|
|
@ -26,10 +26,14 @@
|
|||
"linter-pager-tidy-whitespace-bug-details": "Table column heading. \"Tidy\" is a name of a software package that transforms HTML files, so it doesn't have to be translated. For information about the bug, see the commit message https://gerrit.wikimedia.org/r/#/c/371068 .",
|
||||
"linter-pager-html5-misnesting-details": "Table column heading.",
|
||||
"linter-pager-tidy-font-bug-details": "Table column heading. Don't translate \"font\".",
|
||||
"linter-pager-multiple-unclosed-formatting-tags-details": "Table column heading.",
|
||||
"linter-pager-unclosed-quotes-in-heading-details": "Table column heading",
|
||||
"linter-pager-multiline-html-table-in-list-details": "Table column heading",
|
||||
"linter-pager-misc-tidy-replacement-issues-details": "Table column heading",
|
||||
"linter-category-fostered": "Name of lint error category. See [[:mw:Help:Extension:Linter/fostered]]",
|
||||
"linter-category-fostered-desc": "Description of category.",
|
||||
"linter-category-fostered-desc": "Description of category",
|
||||
"linter-category-obsolete-tag": "Name of lint error category. See [[:mw:Help:Extension:Linter/obsolete-tag]]",
|
||||
"linter-category-obsolete-tag-desc": "Description of category.",
|
||||
"linter-category-obsolete-tag-desc": "Description of category",
|
||||
"linter-category-bogus-image-options": "Name of lint error category. See [[:mw:Help:Extension:Linter/bogus-image-options]]",
|
||||
"linter-category-bogus-image-options-desc": "Description of category",
|
||||
"linter-category-missing-end-tag": "Name of lint error category. See [[:mw:Help:Extension:Linter/missing-end-tag]]",
|
||||
|
@ -41,17 +45,25 @@
|
|||
"linter-category-self-closed-tag": "Name of lint error category. See [[:mw:Help:Extension:Linter/self-closed-tag]]",
|
||||
"linter-category-self-closed-tag-desc": "Description of category",
|
||||
"linter-category-deletable-table-tag": "Name of lint error category. See [[:mw:Help:Extension:Linter/deletable-table-tag]]",
|
||||
"linter-category-deletable-table-tag-desc": "Description of category.",
|
||||
"linter-category-deletable-table-tag-desc": "Description of category",
|
||||
"linter-category-misnested-tag": "Name of lint error category. See [[:mw:Help:Extension:Linter/misnested-tag]]",
|
||||
"linter-category-misnested-tag-desc": "Description of category.",
|
||||
"linter-category-misnested-tag-desc": "Description of category",
|
||||
"linter-category-pwrap-bug-workaround": "Name of lint error category. See [[:mw:Help:Extension:Linter/pwrap-bug-workaround]]",
|
||||
"linter-category-pwrap-bug-workaround-desc": "Description of category.",
|
||||
"linter-category-pwrap-bug-workaround-desc": "Description of category",
|
||||
"linter-category-tidy-whitespace-bug": "Name of lint error category. See [[:mw:Help:Extension:Linter/tidy-whitespace-bug]]",
|
||||
"linter-category-tidy-whitespace-bug-desc": "Description of category.",
|
||||
"linter-category-tidy-whitespace-bug-desc": "Description of category",
|
||||
"linter-category-html5-misnesting": "Name of lint error category. See [[:mw:Help:Extension:Linter/html5-misnesting]]",
|
||||
"linter-category-html5-misnesting-desc": "Description of category",
|
||||
"linter-category-tidy-font-bug": "Name of lint error category. See [[:mw:Help:Extension:Linter/tidy-font-bug]]. Don't translate \"font\".",
|
||||
"linter-category-tidy-font-bug-desc": "Description of category",
|
||||
"linter-category-multiple-unclosed-formatting-tags": "Name of lint error category. See [[:mw:Help:Extension:Linter/multiple-unclosed-formatting-tags]]",
|
||||
"linter-category-multiple-unclosed-formatting-tags-desc": "Description of category",
|
||||
"linter-category-unclosed-quotes-in-heading": "Name of lint error category. See [[:mw:Help:Extension:Linter/unclosed-quotes-in-heading]]",
|
||||
"linter-category-unclosed-quotes-in-heading-desc": "Description of category",
|
||||
"linter-category-multiline-html-table-in-list": "Name of lint error category. See [[:mw:Help:Extension:Linter/multiline-html-table-in-list]]",
|
||||
"linter-category-multiline-html-table-in-list-desc": "Description of category",
|
||||
"linter-category-misc-tidy-replacement-issues": "Name of lint error category. See [[:mw:Help:Extension:Linter/misc-tidy-replacement-issues]]",
|
||||
"linter-category-misc-tidy-replacement-issues-desc": "Description of category ",
|
||||
"linter-numerrors": "Shown after a category link to indicate how many errors are in that category. $1 is the number of errors, and can be used for PLURAL.\n{{Identical|Error}}",
|
||||
"linter-page-title-edit": "Used in a table cell. $1 is a link to the page, $2 is pipe separated links to the edit and history pages, the link text is {{msg-mw|linter-page-edit}} and {{msg-mw|linter-page-history}}",
|
||||
"linter-page-edit": "Link text for edit link in {{msg-mw|linter-page-title-edit}}\n{{Identical|Edit}}",
|
||||
|
|
|
@ -49,6 +49,10 @@ class CategoryManager {
|
|||
'multi-colon-escape' => 11,
|
||||
'html5-misnesting' => 12,
|
||||
'tidy-font-bug' => 13,
|
||||
'multiple-unclosed-formatting-tags' => 14,
|
||||
'unclosed-quotes-in-heading' => 15,
|
||||
'multiline-html-table-in-list' => 16,
|
||||
'misc-tidy-replacement-issues' => 17,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -146,6 +146,8 @@ class LintErrorsPager extends TablePager {
|
|||
'stripped-tag',
|
||||
'html5-misnesting',
|
||||
'tidy-font-bug',
|
||||
'multiple-unclosed-formatting-tags',
|
||||
'unclosed-quotes-in-heading',
|
||||
];
|
||||
if ( in_array( $this->category, $hasNameCats ) && isset( $lintError->params['name'] ) ) {
|
||||
return Html::element( 'code', [], $lintError->params['name'] );
|
||||
|
@ -167,6 +169,13 @@ class LintErrorsPager extends TablePager {
|
|||
} elseif ( $this->category === 'multi-colon-escape' &&
|
||||
isset( $lintError->params['href'] ) ) {
|
||||
return Html::element( 'code', [], $lintError->params['href'] );
|
||||
} elseif ( $this->category === 'multiline-html-table-in-list' ) {
|
||||
/* ancestor and name will be set */
|
||||
return Html::element( 'code', [],
|
||||
$lintError->params['ancestorName'] . " > " . $lintError->params['name'] );
|
||||
} elseif ( $this->category === 'misc-tidy-replacement-issues' ) {
|
||||
/* There will be a 'subtype' param to disambiguate */
|
||||
return Html::element( 'code', [], $lintError->params['subtype'] );
|
||||
}
|
||||
return '';
|
||||
case 'template':
|
||||
|
|
Loading…
Reference in a new issue