Skip to content

Commit

Permalink
fix(MediaWiki): very long line ending with inExtToken()
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsd-harry committed May 28, 2024
1 parent 73fc745 commit 09b811d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
## 2.14.2

*2024-05-28*
*2024-05-29*

**Fixed**

- Ignore `:` inside HTML tags in the MediaWiki mode
- Lines following a very long line containing extension tags in the MediaWiki mode

**Changed**

- Behavior changed for closing tags in a wrong order in the MediaWiki mode

## 2.14.1

Expand Down
4 changes: 2 additions & 2 deletions dist/main.min.js

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions src/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1510,11 +1510,9 @@ export class MediaWiki {
*
* @param tags
*/
mediawiki(tags = this.tags): StreamParser<State> {
mediawiki(tags?: string[]): StreamParser<State> {
return {
name: 'mediawiki',

startState: () => startState(this.eatWikiText(''), tags),
startState: () => startState(this.eatWikiText(''), tags || this.tags),

copyState,

Expand Down Expand Up @@ -1578,6 +1576,9 @@ export class MediaWiki {
data.firstSingleLetterWord = null;
data.firstMultiLetterWord = null;
data.firstSpace = null;
if (state.tokenize.name === 'inExtTokens') {
pop(state);
}
}
readyTokens.length = 0;
data.mark = null;
Expand Down Expand Up @@ -1634,11 +1635,15 @@ export class MediaWiki {
}
},

tokenTable: {
...this.tokenTable,
...this.hiddenTable,
'': Tag.define(),
},
...tags
? undefined
: {
tokenTable: {
...this.tokenTable,
...this.hiddenTable,
'': Tag.define(),
},
},
};
}

Expand Down

0 comments on commit 09b811d

Please sign in to comment.