Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable multi-line links in Markdown #1465

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rouge/lexers/markdown.rb
Expand Up @@ -102,7 +102,7 @@ def html
end

# links and images
rule %r/(!?\[)(#{edot}*?)(\])(?=[\[(])/ do
rule %r/(!?\[)(#{edot}*?|[^\]]*?)(\])(?=[\[(])/ do
groups Punctuation, Name::Variable, Punctuation
push :link
end
Expand Down
6 changes: 6 additions & 0 deletions spec/visual/samples/markdown
Expand Up @@ -1091,3 +1091,9 @@ $ echo "Sample feature output"
[This is a link to a TOML section `[with brackets]` (and backticks)](example.com)
[This is a link to a TOML section `[[with double brackets]]` (and backticks)](example.com)
[This is not a link `with backticks`] (example.com)

This link has text before it, [it's over two (lines),
has (parens too)](example.com), and text after it.

[this is not a
link]