Skip to content

Commit

Permalink
fix(codeBlock): do not handle \ for prism bash
Browse files Browse the repository at this point in the history
Fixed #15
  • Loading branch information
jiawei686 committed Nov 4, 2021
1 parent 7c28a91 commit d6c54fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/hooks/CodeBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default class CodeBlock extends ParagraphBase {
}
// $code = this.$replaceSpecialChar($code);
$code = $code.replace(/~X/g, '\\`');
$code = $code.replace(/\\/g, '\\\\');
if ($lang !== 'bash') $code = $code.replace(/\\/g, '\\\\');
cacheCode = this.renderCodeBlock($code, $lang, sign, lines);
cacheCode = this.$codeCache(sign, cacheCode);
return prependLineFeedForParagraph(match, leadingSpaces + this.pushCache(cacheCode, sign), true);
Expand Down

0 comments on commit d6c54fd

Please sign in to comment.