Skip to content

Commit

Permalink
AsciiDoc: Some regexes are too greedy (#3481)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Jun 25, 2022
1 parent 5665930 commit c4cbeea
Show file tree
Hide file tree
Showing 3 changed files with 1,073 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 @@ -28,7 +28,7 @@

var asciidoc = Prism.languages.asciidoc = {
'comment-block': {
pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m,
pattern: /^(\/{4,})$[\s\S]*?^\1/m,
alias: 'comment'

This comment was marked as off-topic.

Copy link
@ramusesan

ramusesan Jun 28, 2022

fddfdfds

This comment was marked as spam.

Copy link
@ramusesan

ramusesan Jun 28, 2022

fdgfdgfdg

},
'table': {
Expand All @@ -47,23 +47,23 @@
},

'passthrough-block': {
pattern: /^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,
pattern: /^(\+{4,})$[\s\S]*?^\1$/m,
inside: {
'punctuation': /^\++|\++$/
// See rest below
}
},
// Literal blocks and listing blocks
'literal-block': {
pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,
pattern: /^(-{4,}|\.{4,})$[\s\S]*?^\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)(?:[\s\S]*(?:\r?\n|\r))??\1$/m,
pattern: /^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\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.

Loading

0 comments on commit c4cbeea

Please # to comment.