Skip to content

Commit

Permalink
Fixed backtick bug.
Browse files Browse the repository at this point in the history
The parser added an extra (and unnecessary) `</code>` at the end of the
HTML result when the Markdown data contained an even number of backticks.
  • Loading branch information
thomas-daniels committed Oct 6, 2014
1 parent 318b901 commit 8229e99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function markdown(src) {
.replace(/([^;["])(https?:\/\/([^\s("&]+\.[^\s("&]+))/g, '$1' + '$3'.link('$2'))
.replace(/^(https?:\/\/([^\s("&]+\.[^\s("&]+))/g, '$2'.link('$1'))
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
.replace(/\*([^*]+)\*/g, '<em>$1</em>') + (i == arr.length - 1 && i != 0 ? '</code>' : '');
.replace(/\*([^*]+)\*/g, '<em>$1</em>');
}
}).join('');
}
Expand Down

0 comments on commit 8229e99

Please sign in to comment.