Skip to content

Commit aec7c81

Browse files
authored
fix: isolating regex check to highlightmode option (#25)
1 parent 8fec606 commit aec7c81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/codeMirror/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const ReadmeCodeMirror = (code, lang, opts = { tokenizeVariables: false, highlig
173173

174174
CodeMirror.runMode(code, mode, (text, style) => {
175175
const lineBreakRegex = /\r?\n/;
176-
if (style !== curStyle || lineBreakRegex.test(text)) {
176+
if (style !== curStyle || (opts.highlightMode && lineBreakRegex.test(text))) {
177177
flush();
178178
curStyle = style;
179179
accum = text;

0 commit comments

Comments
 (0)