Skip to content

Commit

Permalink
Info strings for tilde code blocks can contain backticks and tildes (…
Browse files Browse the repository at this point in the history
  • Loading branch information
robinst committed Apr 11, 2019
1 parent 74ba555 commit 357106d
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,13 @@ private static FencedCodeBlockParser checkOpener(CharSequence line, int index, i
}
}
if (backticks >= 3 && tildes == 0) {
// spec: The info string may not contain any backtick characters.
// spec: If the info string comes after a backtick fence, it may not contain any backtick characters.
if (Parsing.find('`', line, index + backticks) != -1) {
return null;
}
return new FencedCodeBlockParser('`', backticks, indent);
} else if (tildes >= 3 && backticks == 0) {
// This follows commonmark.js but the spec is unclear about this:
// https://github.com/commonmark/CommonMark/issues/119
if (Parsing.find('~', line, index + tildes) != -1) {
return null;
}
// spec: Info strings for tilde code blocks can contain backticks and tildes
return new FencedCodeBlockParser('~', tildes, indent);
} else {
return null;
Expand Down

0 comments on commit 357106d

Please sign in to comment.