Skip to content

Commit

Permalink
Fix escaping issue in mock code markup
Browse files Browse the repository at this point in the history
  • Loading branch information
nickclark2016 committed Aug 9, 2023
1 parent e8098d1 commit 6c1ea55
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/wiki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ class ArticleParser {
let result = "";
let piece = "";
let in_inline_code = false;
let prev = "";
for (const c of line) {
if (c === "`") {
if (in_inline_code) {
Expand All @@ -218,10 +219,11 @@ class ArticleParser {
result += this.substitute_placeholders_no_code(piece);
piece = c;
}
in_inline_code = !in_inline_code;
in_inline_code = prev !== "\\" ? !in_inline_code : in_inline_code;
} else {
piece += c;
}
prev = c;
}
return result + (in_inline_code ? piece : this.substitute_placeholders_no_code(piece));
}
Expand Down

0 comments on commit 6c1ea55

Please sign in to comment.