Skip to content

Commit

Permalink
[markdown mode] Fix handling of escaped characters
Browse files Browse the repository at this point in the history
Issue #2792
  • Loading branch information
marijnh committed Sep 3, 2014
1 parent 68ae134 commit a5075e5
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions mode/markdown/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {

var ch = stream.next();

if (state.escape) {
state.escape = false;
return getType(state);
}

if (ch === '\\') {
if (modeCfg.highlightFormatting) state.formatting = "escape";
state.escape = true;
return getType(state);
stream.next();
if (modeCfg.highlightFormatting) return getType(state) + " escape";
}

// Matches link titles present on next line
Expand Down Expand Up @@ -650,7 +644,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
inline: inlineNormal,
text: handleText,

escape: false,
formatting: false,
linkText: false,
linkHref: false,
Expand Down Expand Up @@ -683,7 +676,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {

inline: s.inline,
text: s.text,
escape: false,
formatting: false,
linkTitle: s.linkTitle,
em: s.em,
Expand Down Expand Up @@ -718,9 +710,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.thisLineHasContent = true;
}

// Reset state.escape
state.escape = false;

// Reset state.taskList
state.taskList = false;

Expand Down

0 comments on commit a5075e5

Please sign in to comment.