Skip to content

Markdown in rdf/xml annotations doesn't render paragraphs or lists #765

@sensespidey

Description

@sensespidey

Describe the bug

When generating HTML from an RDF/XML ontology file with markdown in rdfs:comment annotations, newlines are removed, resulting in missing paragraph and list tags in the rendered HTML.

To Reproduce
Steps to reproduce the behavior:

  1. Add some newlines and * or - list items in Markdown format, in the rdfs:comment text for an owl:Class annotation in an RDF/XML serialized ontology.
  2. Render docs from said ontology using something like java -jar bin/widoco-1.4.25-jar-with-dependencies_JDK-11.jar -ontFile ONTOLOGY.owl -outFolder docs -oops -rewriteAll -uniteSections -webVowl
  3. Open rendered documentation in your browser
  4. Look for <p> and <ul><li> tags in the Class description HTML
  5. Observe no paragraph or list tags, newlines are removed from the innerText, and - and * characters are left intact.

Expected behavior

I expected the newlines to persist in the Markdown-formatted rdfs:comment annotations, and result in paragraphs and lists rendered in HTML.

Screenshots
Let me know if it's helpful to see an image of the markup or something, but hopefully my description above is clear :)

Desktop (please complete the following information):

  • OS: Linux (Ubuntu 22.04)
  • Browser Firefox
  • Version 138.0.1

(I don't believe this is particularly relevant, but I'm running openJDK 11 and Widoco 1.4.25)

Additional context

I've poked at this to understand that the marked library is running correctly against these Class descriptions, but the text that's in there is missing newlines that are present in the source file I'm pointing Widoco too. I gather from this that the code that's loading my Ontology in order to produce this HTML is sanitizing or otherwise "cleaning" this text somewhere along the line. I haven't been able to track down where that is, but if I find it (or someone more knowledgeable points me to it) I'll happily take a crack at improving this :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions