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

Conversation

Ravlen
Copy link
Contributor

@Ravlen Ravlen commented Mar 18, 2020

Fixes #1450

The markdown standard allows for link text split over multiple lines. This expands the
link regex to enable this.

While I was there, I also allowed for a space between links and link references as well, which is allowed in the spec, and added an example to the markdown test for that as well. Edit: Reverted this change, as per discussion.

When tested with rackup:

Screen Shot 2020-03-18 at 16 20 50

cc @pyrmont

The markdown standard allows for link text
split over multiple lines. This expands the
link regex to enable this.
@Ravlen Ravlen changed the title Enable multi-line links Enable multi-line links in Markdown Mar 19, 2020
@Ravlen
Copy link
Contributor Author

Ravlen commented Mar 19, 2020

For reference, this is how it currently renders on rouge.jneen.com:

Screen Shot 2020-03-19 at 15 24 27

@pyrmont
Copy link
Contributor

pyrmont commented Mar 19, 2020

@Ravlen Sorry for the radio silence :( I've been spending time on some other projects but will get back to getting through these soon!

@Ravlen
Copy link
Contributor Author

Ravlen commented Mar 20, 2020 via email

@pyrmont pyrmont self-assigned this Mar 24, 2020
@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Mar 24, 2020
Copy link
Contributor

@pyrmont pyrmont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A question about the whitespace support:

lib/rouge/lexers/markdown.rb Outdated Show resolved Hide resolved
@pyrmont pyrmont added author-action The PR has been reviewed but action by the author is needed and removed needs-review The PR needs to be reviewed labels Mar 24, 2020
@Ravlen
Copy link
Contributor Author

Ravlen commented Mar 25, 2020

@pyrmont OK, returned it back to the original, so the update only contains the fix for multi-line link text now. I'll update the description.

@pyrmont pyrmont merged commit 71c779a into rouge-ruby:master Mar 25, 2020
@pyrmont
Copy link
Contributor

pyrmont commented Mar 25, 2020

@Ravlen Thanks for another fix!

@pyrmont pyrmont removed the author-action The PR has been reviewed but action by the author is needed label Mar 25, 2020
mattt pushed a commit to NSHipster/rouge that referenced this pull request May 21, 2020
While Markdown is supposed to alow link text to span multiple lines, 
the lexer in Rouge did not support it. This commit enables that support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown lexer does not allow link text over two lines
2 participants