Ontospy icon indicating copy to clipboard operation
Ontospy copied to clipboard

Use markdown in rdfs:comments and other fields

Open jo-tud opened this issue 7 years ago • 2 comments

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?

jo-tud avatar Oct 27 '17 09:10 jo-tud

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)

VladimirAlexiev avatar May 27 '18 07:05 VladimirAlexiev

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

rvesse avatar Sep 27 '23 13:09 rvesse