Skip to content

fix reference link regex#31

Merged
benbalter merged 1 commit into
benbalter:masterfrom
qwtel:fix
Sep 22, 2017
Merged

fix reference link regex#31
benbalter merged 1 commit into
benbalter:masterfrom
qwtel:fix

Conversation

@qwtel

@qwtel qwtel commented Sep 21, 2017

Copy link
Copy Markdown
Collaborator

Short version: fixed a bug I introduced that breaks sites with reference links

Long version: Regexes work differently in JavaScript (which I know) and Ruby.
In JS, \s matches all whitepace, but not newlines. However, in ruby (and I think most languages) newlines are included. That, in combination with not using the non-greedy *? quantifier caused all newlines in front of a reference link to be replaced, resulting in invalid reference links, e.g. [test].
[test]: http://github.com

@benbalter

Copy link
Copy Markdown
Owner

Nice catch. Thanks for this @qwtel!

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.

2 participants