Skip to content

Commit

Permalink
Merge branch 'mini' into browser
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsd-harry committed Jun 8, 2024
2 parents 1c7be8a + 89b2588 commit b0bbc5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion extensions/gh-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ textarea {
width: 100%;
height: var(--height-editor);
max-height: var(--max-height-editor);
direction: ltr;
padding: .4em;
}
#wikiPretty + #wpTextbox1, div#wikiPretty, .cm-editor, #wpTextbox2, pre {
Expand Down
5 changes: 3 additions & 2 deletions parser/braces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ export const parseBraces = (wikitext: string, config: Config, accum: Token[]): s
new TranscludeToken(m.slice(2, -2), [], config, accum);
return `\0${accum.length - 2}${marks.get(p1)}\x7F`;
});
const lastBraces = wikitext.lastIndexOf('}}') - wikitext.length;
let regex = new RegExp(source, 'gmu'),
mt: BraceExecArray | null = regex.exec(wikitext),
moreBraces = wikitext.includes('}}'),
moreBraces = lastBraces + wikitext.length !== -1,
lastIndex: number | undefined;
while (
mt
Expand Down Expand Up @@ -139,7 +140,7 @@ export const parseBraces = (wikitext: string, config: Config, accum: Token[]): s
}
stack.push(...'0' in top ? [top] : [], mt!);
}
moreBraces &&= wikitext.slice(lastIndex).includes('}}');
moreBraces &&= lastBraces + wikitext.length >= lastIndex;
let curTop = stack[stack.length - 1];
if (!moreBraces && curTop?.[0]?.startsWith('{')) {
stack.pop();
Expand Down

0 comments on commit b0bbc5a

Please sign in to comment.