Skip to content

Commit 54ec95a

Browse files
committed
[markdown mode] Don't swallow markup on indented lines in paragraph
Closes codemirror#4773
1 parent c81cba4 commit 54ec95a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

mode/markdown/markdown.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
131131
}
132132

133133
function blockNormal(stream, state) {
134-
135134
var sol = stream.sol();
136135

137136
var prevLineIsList = state.list !== false,
@@ -153,15 +152,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
153152
}
154153

155154
var match = null;
156-
if (state.indentationDiff >= 4) {
155+
if (state.indentationDiff >= 4 && (prevLineIsIndentedCode || lineIsEmpty(state.prevLine))) {
157156
stream.skipToEnd();
158-
if (prevLineIsIndentedCode || lineIsEmpty(state.prevLine)) {
159-
state.indentation -= 4;
160-
state.indentedCode = true;
161-
return tokenTypes.code;
162-
} else {
163-
return null;
164-
}
157+
state.indentation -= 4;
158+
state.indentedCode = true;
159+
return tokenTypes.code;
165160
} else if (stream.eatSpace()) {
166161
return null;
167162
} else if ((match = stream.match(atxHeaderRE)) && match[1].length <= 6) {

0 commit comments

Comments
 (0)