Skip to content

Commit

Permalink
fix: isolating regex check to highlightmode option (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
gratcliff authored Oct 26, 2020
1 parent 8fec606 commit aec7c81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/codeMirror/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const ReadmeCodeMirror = (code, lang, opts = { tokenizeVariables: false, highlig

CodeMirror.runMode(code, mode, (text, style) => {
const lineBreakRegex = /\r?\n/;
if (style !== curStyle || lineBreakRegex.test(text)) {
if (style !== curStyle || (opts.highlightMode && lineBreakRegex.test(text))) {
flush();
curStyle = style;
accum = text;
Expand Down

0 comments on commit aec7c81

Please sign in to comment.