progrium / viewdocs

Read the Docs meets Gist.io for simple Markdown project documentation

Home Page:http://viewdocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

viewdocs.io should not strip class & id attributes (or any other attributes) from markdown embedded html

marfarma opened this issue · comments

html (not in a code block) is valid markdown. However, when I did this:

<div id="jsonnav">
{"content":"some json content"}
</div>

or this:

<div class="jsonnav">
{"content":"some json content"}
</div>

I got this:

<div>
{"content":"some json content"}
</div>

in my rendered page. The difficulty here is that when attempting to act on that div, I had to resort to an xpath selector to find it -- and that path changed every time I adjusted the layout in my template.

Eventually I may want to add other html that requires different attributes in order to render correctly (i.e. if I want to embed something, like a plunker example) and the work-around could be more painful, if those were stripped as well.

It seems that the github markdown API does this - quite disappointing. How possible would it be to use blackfriday instead? If it's not out of the question, I'd see about maybe making the change as my first 'go' experience.

Hi @marfarma! Not sure if you're still interested in working on this feature, but it seems like it could be worthwhile. If you are, feel free to throw a PR our way and we'll see if we can't get it into master :)

Note: content within the template isn't rendered via the github markdown API, so that might be a route for this, especially if you are doing custom navigation.