lambdamusic / Ontospy

Python library and command-line interface for inspecting and visualizing RDF models aka ontologies.
http://lambdamusic.github.io/Ontospy/
MIT License
218 stars 52 forks source link

Use markdown in rdfs:comments and other fields #64

Open jo-tud opened 6 years ago

jo-tud commented 6 years ago

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?

VladimirAlexiev commented 6 years ago

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)

rvesse commented 9 months ago

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