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

Square brackets in links #365

Open
rdelepine opened this issue Nov 6, 2015 · 3 comments
Open

Square brackets in links #365

rdelepine opened this issue Nov 6, 2015 · 3 comments
Labels

Comments

@rdelepine
Copy link

Input:

[Your guide to \[[...] more.](http://www.php7book.com/)

[Your guide to [...] more.](http://www.php7book.com/)

[Your guide to [...]\] more.](http://www.php7book.com/)

Actual:

<p>[Your guide to [[...] more.](<a href="http://www.php7book.com/">http://www.php7book.com/</a>)</p>
<p><a href="http://www.php7book.com/">Your guide to [...] more.</a></p>
<p>[Your guide to [...]] more.](<a href="http://www.php7book.com/">http://www.php7book.com/</a>)</p>

Expected:

<p><a href="http://www.php7book.com/">Your guide to &#91;[...] more.</a></p>
<p><a href="http://www.php7book.com/">Your guide to [...] more.</a></p>
<p><a href="http://www.php7book.com/">Your guide to [...]&#93; more.</a></p>

Tested with Parsedown and ParsedowExtra

@erusev erusev added the bug label Nov 6, 2015
@praveenscience
Copy link

I guess I can fix this, but can we just make a simple replace like:

$str = str_replace(array('\[', '\]'), array("&#91;", "&#93;"), $str);

Does it work?

@erusev
Copy link
Owner

erusev commented Feb 25, 2016

@praveenscience i don't think so, this would be in conflict with the specification

@praveenscience
Copy link

@erusev Oh okay... I didn't know that. Thanks for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants