Link parsing not accepting closing ')' #109

Open
julianduque opened this Issue Jan 16, 2013 · 4 comments

4 participants

@julianduque

When try to render a link with an ending ')' it is failing.

var marked = require('./lib/marked');
var link = '[snapshot](http://en.wikipedia.org/wiki/Snapshot_(computer_storage\))';
console.log(marked(link));

The result has the closing ')' is outside the link.

<p><a href="http://en.wikipedia.org/wiki/Snapshot_(computer_storage">snapshot</a>)</p>
@chjj
Owner

This has been a problem for a while. I forgot about it for some reason. Back on the todo list.

edit: testing GFM...

http://en.wikipedia.org/wiki/Snapshot_(computer_storage)

test

[test](http://en.wikipedia.org/wiki/Snapshot_(computer_storage\))

edit 2: GFM links handle the parenthesis, regular links do not without the backslash.

@julianduque

I was trying to fix it but i'm not that good in regex so i failed 👎

@Mithgol

See my comments to the related #102.

This was referenced Jun 6, 2013
@caitp

angular/angular.js#6377 We're encountering this with angular and dgeni, it would be nice to fix this. Seems like this hasn't been poked at for a while. I'll see if I can hack together a fix tonight, that would be nice.

The problem with this is, no matter what you do, you can still end up causing certain links to be invalid, there's no real good way to do this. But hmm.

@bmathews bmathews referenced this issue in WikiEducationFoundation/WikiEduDashboard Sep 9, 2015
Closed

Markdown url formatting gets escaped by closing parens in url #316

@puzrin puzrin referenced this issue in pugjs/pug Oct 24, 2015
@fhemberger fhemberger Update vulnerable dependencies
`marked` and `uglify-js` have several reported security issues in versions used by jade:
- https://nodesecurity.io/advisories/module/marked
- https://nodesecurity.io/advisories/module/uglify-js
5f7b667
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment