Skip to content

Commit 3c3a607

Browse files
lwchkgazu
authored andcommitted
Fix (parser): fix infinity loop (2nd attempt) (#59)
fix (parser): fix infinity loop (2nd attempt)
1 parent d247808 commit 3c3a607

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

src/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { hasTitle } from "./title";
1212
import { getTemplateContent, readFileFromPath } from "./template";
1313
import { codeBlockBacktick } from "./backtick-maker";
1414

15-
const markdownLinkFormatRegExp = /\[((?:[^\]]|\\.)*?)\]\(((?:[^\)]|\\.)*?)\)/gm;
15+
const markdownLinkFormatRegExp = /\[(?=((?:[^\]]|\\.)*))\1\]\((?=((?:[^\)]|\\.)*))\2\)/gm;
1616

1717
const keyEx = "\\w+";
1818
const kvsepEx = "[:=]";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Issue by [Infinite loop with a specific markdown file · Issue #57 · azu/gitbook-plugin-include-codeblock](https://github.com/azu/gitbook-plugin-include-codeblock/issues/57 "Infinite loop with a specific markdown file · Issue #57 · azu/gitbook-plugin-include-codeblock")
2+
3+
[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890](\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
"pluginsConfig": {
3+
"include-codeblock": {}
4+
}
5+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Issue by [Infinite loop with a specific markdown file · Issue #57 · azu/gitbook-plugin-include-codeblock](https://github.com/azu/gitbook-plugin-include-codeblock/issues/57 "Infinite loop with a specific markdown file · Issue #57 · azu/gitbook-plugin-include-codeblock")
2+
3+
[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890[\1\2\34567890](\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890(\1\2\34567890

0 commit comments

Comments
 (0)