Skip to content
Snippets Groups Projects
Commit ca72f859 authored by Brandon Frohs's avatar Brandon Frohs Committed by Marijn Haverbeke
Browse files

[markdown] Fix incorrect highlighting of linked images.

parent 4d8eeeb3
No related branches found
No related tags found
No related merge requests found
......@@ -246,8 +246,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return getType(state);
}
if (ch === '!' && stream.match(/\[.*\] ?(?:\(|\[)/, false)) {
stream.match(/\[.*\]/);
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
stream.match(/\[[^\]]*\]/);
state.inline = state.f = linkHref;
return image;
}
......
......@@ -719,6 +719,20 @@ MT.testMode(
]
);
// Inline link with image
MT.testMode(
'linkImage',
'[![foo](http://example.com/)](http://example.com/) bar',
[
'link', '[',
'tag', '![foo]',
'string', '(http://example.com/)',
'link', ']',
'string', '(http://example.com/)',
null, ' bar'
]
);
// Inline link with Em
MT.testMode(
'linkEm',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment