wikiparser-node 1.5.5 → 1.5.6

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.
package/dist/lib/title.js CHANGED
@@ -103,12 +103,6 @@ class Title {
103
103
  }
104
104
  catch { }
105
105
  }
106
- else if (fragment.includes('.')) {
107
- try {
108
- fragment = decodeURIComponent(fragment.replace(/\./gu, '%'));
109
- }
110
- catch { }
111
- }
112
106
  this.fragment = fragment;
113
107
  title = title.slice(0, i).trim();
114
108
  }
@@ -154,10 +154,12 @@ let ExtLinkToken = (() => {
154
154
  }
155
155
  /** 修正空白字符 */
156
156
  #correct() {
157
+ const { lastChild, length } = this, { firstChild } = lastChild;
157
158
  if (!this.#space
158
- && this.length > 1
159
+ && length > 1
160
+ && (firstChild?.type === 'text' || firstChild?.type === 'converter')
159
161
  // 都替换成`<`肯定不对,但无妨
160
- && /^[^[\]<>"{\0-\x1F\x7F\p{Zs}\uFFFD]/u.test(this.lastChild.text().replace(/&[lg]t;/u, '<'))) {
162
+ && /^[^[\]<>"\0-\x1F\x7F\p{Zs}\uFFFD]/u.test(lastChild.text().replace(/&[lg]t;/u, '<'))) {
161
163
  this.#space = ' ';
162
164
  }
163
165
  }
@@ -145,7 +145,7 @@ let TdToken = (() => {
145
145
  result.escape ||= esc;
146
146
  result.correction = str.includes('\n') && debug_1.Shadow.run(() => {
147
147
  const config = this.getAttribute('config'), include = this.getAttribute('include');
148
- return String(new index_2.Token(str, config).parseOnce(0, include).parseOnce()).includes('\n');
148
+ return String(new index_2.Token(str, config).parseOnce(0, include).parseOnce().parseOnce()).includes('\n');
149
149
  });
150
150
  if (subtype === 'th' && result.subtype !== 'th') {
151
151
  result.subtype = 'th';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikiparser-node",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "A Node.js parser for MediaWiki markup with AST",
5
5
  "keywords": [
6
6
  "mediawiki",