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

Incorrect Link Parsing #576

Open
butuzov opened this issue Nov 11, 2019 · 0 comments
Open

Incorrect Link Parsing #576

butuzov opened this issue Nov 11, 2019 · 0 comments

Comments

@butuzov
Copy link

butuzov commented Nov 11, 2019

Tested v1 and v2. Both affected.

Short Description

Whitespace(s) or Tab before parentheses (()) opening is ignored if it comes after brackets ([]).

Long Description

In the text blocks that "like" a link, are treated as a link, even if they are a links of a different kind.


Reproducible Example

package main

import (
	"fmt"

	"gopkg.in/russross/blackfriday.v2"
)

var input = `
* [example_org link]
* [example_net link](https://example.net)
* [example_com link] (hey, there is space before parenthese, ignoge me please)


[example_org link]: https://example.org
[example_com link]: https://example.com
`

func main() {
	output := string(blackfriday.Run([]byte(input)))
	fmt.Println(output)
}

Expected Output

<ul>
<li><a href="https://example.org">example_org link</a></li>
<li><a href="https://example.net">example_net link</a></li>
<li><a href="https://example.com">example_com link</a> (hey, there is space before parenthese, ignoge me please)</li>
</ul>

Actual Output

<ul>
<li><a href="https://example.org">example_org link</a></li>
<li><a href="https://example.net">example_net link</a></li>
<li><a href="hey, there is space before parenthese, ignoge me please">example_com link</a></li>
</ul>
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

1 participant