Skip to content
Permalink
Browse files

fix: continuelist works in codeblock (fix: #529)

  • Loading branch information...
Sohee Lee authored and sohee-lee7 committed Jun 17, 2019
1 parent 967ebf0 commit 517ae42c25ea6250a651883f107e832a3e583158
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/js/codemirror/continuelist.js
@@ -32,7 +32,17 @@ CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
var ranges = cm.listSelections(), replacements = [];
for (var i = 0; i < ranges.length; i++) {
var pos = ranges[i].head;

// If we're not in Markdown mode, fall back to normal newlineAndIndent
var eolState = cm.getStateAfter(pos.line);
var inner = CodeMirror.innerMode(cm.getMode(), eolState);
if (inner.mode.name !== "markdown") {
cm.execCommand("newlineAndIndent");
return;
} else {
eolState = inner.state;
}

var inList = eolState.list !== false;
var inQuote = eolState.quote !== 0;

0 comments on commit 517ae42

Please sign in to comment.
You can’t perform that action at this time.