Merge "Add tracking category for pages that use a deprecated LaTeX syntax"

This commit is contained in:
jenkins-bot 2020-04-02 10:24:00 +00:00 committed by Gerrit Code Review
commit b9dcb9525e
3 changed files with 12 additions and 2 deletions

View file

@ -85,6 +85,8 @@
"math-tracking-category-error-desc": "Pages in this category have errors in the usage of math tags.",
"math-tracking-category-mhchem-deprecation": "Pages that use a deprecated format of the chem tags",
"math-tracking-category-mhchem-deprecation-desc": "Pages in this category use a deprecated format of the chem tags",
"math-tracking-category-texvc-deprecation": "Pages that use a deprecated format of the math tags",
"math-tracking-category-texvc-deprecation-desc": "Pages in this category use a deprecated format of the math tags",
"math-tracking-category-render-error": "Pages with math render errors",
"math-tracking-category-render-error-desc": "Pages in this category have rendering errors in the math tags.",
"math_unknown_error": "unknown error",

View file

@ -85,6 +85,8 @@
"math-tracking-category-error-desc": "Tracking category description.",
"math-tracking-category-mhchem-deprecation": "Tracking category name.",
"math-tracking-category-mhchem-deprecation-desc": "Tracking category description.",
"math-tracking-category-texvc-deprecation": "Tracking category name.",
"math-tracking-category-texvc-deprecation-desc": "Tracking category description.",
"math-tracking-category-render-error": "Tracking category name.",
"math-tracking-category-render-error-desc": "Tracking category description.",
"math_unknown_error": "Used as error message for unknown texvc error.\n\nThis message follows the message {{msg-mw|Math failure}}.\n{{Identical|Unknown error}}",

View file

@ -66,8 +66,14 @@ class MathMathML extends MathRenderer {
parent::addTrackingCategories( $parser );
if ( $this->hasWarnings() ) {
foreach ( $this->warnings as $warning ) {
if ( isset( $warning->type ) && $warning->type === 'mhchem-deprecation' ) {
$parser->addTrackingCategory( 'math-tracking-category-mhchem-deprecation' );
if ( isset( $warning->type ) ) {
switch ( $warning->type ) {
case 'mhchem-deprecation':
$parser->addTrackingCategory( 'math-tracking-category-mhchem-deprecation' );
break;
case 'texvc-deprecation':
$parser->addTrackingCategory( 'math-tracking-category-texvc-deprecation' );
}
}
}
}