some links from Arch Wiki are broken after rendering #102

Open
jiyinyiyong opened this Issue Dec 22, 2012 · 2 comments

2 participants

@jiyinyiyong

I used marked in my personal blog. Several links was rendered incrrectly.

There are really some incredible links on the Chinese version, such as:

https://wiki.archlinux.org/index.php/GNOME_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#.E9.80.9A.E8.BF.87.E4.BF.AE.E6.94.B9_settings.ini_.E6.94.B9.E5.8F.98_GTK3_.E4.B8.BB.E9.A2.98

And the rendering result on my blog:

https://raw.github.com/jiyinyiyong/blog2/master/posts/linux/arch-reinstall.md
http://blog.jiyinyiyong.info/linux/arch-reinstall.md

which was fine when I post that in a Github Issue:

https://github.com/jiyinyiyong/blog2/issues/1

@Mithgol

May be worked around by replacing ) with %29 in URLs.

Note: using \( instead of ( is not necessary in URLs, using \) instead of ) is not necessary in URLs, marked does not seem to process any Markdown escaped characters in URLs.

@Mithgol

The fix may probably be achieved by processing some Markdown escapes (specifically \)) in URLs.

Such a fix would also require replacing

inline._href = /\s*<?([^\s]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;

with

inline._href = /\s*<?([^\s]*?[^\])>?(?:\s+['"]([\s\S]*?)['"])?\s*/;

so that the URL is required to end with [^\] (not an escaping backslash).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment