wikilint 2.29.1 → 2.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,7 +77,7 @@ const mw = {
77
77
  },
78
78
  },
79
79
  };
80
- const pkg = "wikilint", version = "2.29.1";
80
+ const pkg = "wikilint", version = "2.29.2";
81
81
  let mwConfig;
82
82
  /**
83
83
  * Get the parser configuration for a Wikimedia Foundation project.
@@ -68,7 +68,7 @@ const parseCommentAndExt = (wikitext, config, accum, includeOnly) => {
68
68
  wikitext = wikitext.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu, m => {
69
69
  stack.push(m);
70
70
  return `\0${stack.length - 1}\x7F`;
71
- }).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu, (_, p1, p2) => {
71
+ }).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu, (_, p1, p2) => {
72
72
  const l = accum.length;
73
73
  // @ts-expect-error abstract class
74
74
  new translate_1.TranslateToken(p1, p2 && (0, string_1.restore)(p2, stack), newConfig, accum);
@@ -76,8 +76,7 @@ let ConverterToken = (() => {
76
76
  const [firstRule] = rules, hasColon = firstRule.includes(':'),
77
77
  // @ts-expect-error abstract class
78
78
  firstRuleToken = new converterRule_1.ConverterRuleToken(firstRule, hasColon, config, accum);
79
- if (hasColon && firstRuleToken.length === 1
80
- || !hasColon && rules.length === 2 && !(0, string_1.removeComment)(rules[1]).trim()) {
79
+ if (hasColon ? firstRuleToken.length === 1 : rules.length === 2 && !(0, string_1.removeComment)(rules[1]).trim()) {
81
80
  this.insertAt(
82
81
  // @ts-expect-error abstract class
83
82
  new converterRule_1.ConverterRuleToken(rules.join(';'), false, config, accum));
@@ -200,8 +200,7 @@ let TranscludeToken = (() => {
200
200
  return false;
201
201
  }
202
202
  const magicWord = lcModifier.slice(0, -1).toLowerCase(), isRaw = raw.includes(magicWord), isSubst = subst.includes(magicWord);
203
- if (this.#raw && isRaw
204
- || !this.#raw && (isSubst || !modifier)
203
+ if ((this.#raw ? isRaw : isSubst || !modifier)
205
204
  || (debug_1.Shadow.running || this.length > 1) && (isRaw || isSubst || !modifier)) {
206
205
  this.setAttribute('modifier', modifier);
207
206
  this.#raw = isRaw;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikilint",
3
- "version": "2.29.1",
3
+ "version": "2.29.2",
4
4
  "description": "A Node.js linter for MediaWiki markup",
5
5
  "keywords": [
6
6
  "mediawiki",