Skip to content

Commit f9e56e8

Browse files
committed
[markdown mode] Better support for nested brackets in link text
Closes codemirror#5476
1 parent 70408ce commit f9e56e8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mode/markdown/markdown.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
506506
}
507507

508508
if (ch === '[' && !state.image) {
509+
if (state.linkText && stream.match(/^.*?\]/)) return getType(state)
509510
state.linkText = true;
510511
if (modeCfg.highlightFormatting) state.formatting = "link";
511512
return getType(state);

0 commit comments

Comments
 (0)