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

Allow file:/// protocol in links #108

Closed
mtmacdonald opened this issue May 29, 2015 · 1 comment
Closed

Allow file:/// protocol in links #108

mtmacdonald opened this issue May 29, 2015 · 1 comment

Comments

@mtmacdonald
Copy link

In plain HTML, I can link to a local file using the file:/// protocol, like so:

 <a href="file:///C:/test.docx">Link</a>

I would expect the equivalent CommonMark link to be expressed like this:

 [Link](file:///C:/test.docx)

I can't see anything in the CommonMark spec that prohibits the file:/// protocol from being used in links, and indeed the reference implementation parses this as expected:

bug1

However the markdown-it implementation does not:

bug2

Is this a bug?

@puzrin
Copy link
Member

puzrin commented May 29, 2015

https://github.com/markdown-it/markdown-it/blob/master/lib/index.js#L285

That's a security restriction to be safe by default. Override it if needed.

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