Skip to content

Commit

Permalink
Optimized block regexps to prevent struggling on large files. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Sep 1, 2016
1 parent 86aa3d2 commit 1a86d34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions components/prism-asciidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
};
Prism.languages.asciidoc = {
'comment-block': {
pattern: /^(\/{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1/m,
pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m,
alias: 'comment'
},
'table': {
Expand All @@ -46,23 +46,23 @@
},

'passthrough-block': {
pattern: /^(\+{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,
pattern: /^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,
inside: {
'punctuation': /^\++|\++$/
// See rest below
}
},
// Literal blocks and listing blocks
'literal-block': {
pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,
pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,
inside: {
'punctuation': /^(?:-+|\.+)|(?:-+|\.+)$/
// See rest below
}
},
// Sidebar blocks, quote blocks, example blocks and open blocks
'other-block': {
pattern: /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,
pattern: /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,
inside: {
'punctuation': /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/
// See rest below
Expand Down
2 changes: 1 addition & 1 deletion components/prism-asciidoc.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a86d34

Please sign in to comment.