Ontospy
Ontospy copied to clipboard
Use markdown in rdfs:comments and other fields
I use markdown in rdfs:comments and other fields and I would like to display that markdown rendered as text on the pages. How could that be done?
LODE uses https://github.com/chjj/marked and <span class="markdown">
in various spots (see https://github.com/essepuntato/LODE/blob/master/src/main/webapp/extraction.xsl)
Think the underlying problem here is that the Markdown templates use the Django linebreaks
filter here which per its documentation:
Replaces line breaks in plain text with appropriate HTML; a single newline becomes an HTML line break (
<br>
) and a new line followed by a blank line becomes a paragraph break (</p>
)
Which is entirely unnecessary since Markdown will handle line breaks naturally anyway.
The by-product of this is that Markdown in the rdfs:comment
's doesn't then get rendered because most Markdown renderers don't render Markdown inside HTML block elements like <p>
, if you manually strip out the <p>
tags from the resulting Markdown files then the actual Markdown from your ontology comments does get rendered.
So think the Markdown templates just want updating to not use the linebreaks
filter