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

Newline required after last "reference style link" or it is not parsed. #180

Closed
bramp opened this issue Jul 3, 2015 · 1 comment
Closed

Comments

@bramp
Copy link

bramp commented Jul 3, 2015

var test = "[Something][1]\n[1]: http://blah.com"

output := blackfriday.MarkdownCommon([]byte(test))
fmt.Printf(string(output))

produces:

<p>[Something][1]
[1]: <a href="http://blah.com">http://blah.com</a></p>

but

var test = "[Something][1]\n[1]: http://blah.com\n"

correctly produces: <p><a href="http://blah.com">Something</a></p>

The difference is the \n at the end of the test string. Is the Markdown text required to end with a new line? Unless I'm missing a good reason, could we make the parsing more lack, and not require the \n at the end?

@dmitshur
Copy link
Collaborator

dmitshur commented Dec 8, 2015

Unless I'm missing a good reason, could we make the parsing more lack, and not require the \n at the end?

I agree, it'd be better not to require it.

rtfb added a commit that referenced this issue Dec 10, 2015
Technically, not ending a line with a newline is wrong, but this blunder
is so pervasive that we have no other choice but to live with it.

Fixes #180.
@rtfb rtfb mentioned this issue Dec 10, 2015
@rtfb rtfb closed this as completed in #224 Dec 11, 2015
rtfb added a commit that referenced this issue Dec 11, 2015
rtfb added a commit that referenced this issue Feb 12, 2017
The check was introduced with d28de22, when fixing #172 and #173.
Then I removed it with bcd6dd8 when fixing #180
And then it was reintroduced with 232d06c when fixing regression.

It seems that the check can be removed again. All these cases now have
tests (including the one from 69f51af, which seems to have landed to v1
only, copying it here) and they all pass.
@rtfb rtfb mentioned this issue Feb 12, 2017
rtfb added a commit that referenced this issue Feb 14, 2017
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

No branches or pull requests

2 participants