Skip to content

Commit

Permalink
Fix brackets in links in markdown lexer (#1444)
Browse files Browse the repository at this point in the history
When hiding brackets inside links (with backticks),
coloring was breaking. This makes the lexer search
for the open bracket or paren that starts the url
or reference link
  • Loading branch information
Ravlen committed Feb 20, 2020
1 parent 65207be commit a59a5f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rouge/lexers/markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def html
end

state :link do
rule %r/(\[)(#{edot}*?)(\])/ do
rule %r/(\[)(#{edot}*?)(?=\][\[(])/ do
groups Punctuation, Str::Symbol, Punctuation
pop!
end
Expand Down

0 comments on commit a59a5f9

Please sign in to comment.