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, rendering
was breaking. This makes the lexer search for `](` or `](`
to find the end delimiting the link text.
  • Loading branch information
Ravlen committed Feb 20, 2020
1 parent 65207be commit 1d146ae
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 1d146ae

Please sign in to comment.