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

Markdown.Sanitizer removes <a href= and <img src= tags referencing relative paths #80

Open
GoogleCodeExporter opened this issue Sep 1, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

The part 
    (https?:\/\/|\/)
in Markdown.Sanitizer var img_white only allows full URLs:
    http://... or https://...
or in-site URLs relative to the root
    /...

As a consequence, the markdown code 
      ![buttons](js/pagedown/wmd-buttons.png)"

producing the html code

    <img src="js/pagedown/wmd-buttons.png" alt="buttons" title="" />

is removed by Markdown.Sanitizer, because the in-site URL is relative to the 
current path. 

The same applies to var a_white

Solution:
Add an extra ? as follows:
    (https?:\/\/|\/?)

Original issue reported on code.google.com by [email protected] on 9 Oct 2014 at 12:44

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

No branches or pull requests

1 participant