Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit e103915

Browse files
committed
Split link dest from link reference, more explicit
Still fails, though. cc @aroben
1 parent eeb8692 commit e103915

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

app/assets/javascripts/task_list.coffee

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,20 @@ itemPattern = ///
125125
#{escapePattern(complete)}|
126126
#{escapePattern(incomplete)}
127127
)
128-
(?! # is not a link
129-
\s* # with optional whitespace
130-
(?:\(.*?\)|\[.*?\]) # because of destination or reference
128+
(?! # but not a link to this destination
129+
\s*
130+
\(.*?\)
131131
)
132+
(?= # and not part of a link reference
133+
\s*
134+
(?:(?:\[.*?\]\s*){2})*
135+
(?:[^\[]|$)
136+
)
137+
# (?! # is not a link
138+
# \s* # with optional whitespace
139+
# (?:\(.*?\)|\[.*?\]) # because of destination or reference
140+
# (?:\s*[^\[\(]) # but itself not first part of a link
141+
# )
132142
(?=\s) # is followed by whitespace
133143
///
134144

0 commit comments

Comments
 (0)