datafolklabs / docker-markdown

Python Markdown via Docker
BSD 3-Clause "New" or "Revised" License
4 stars 20 forks source link

Unescaped brackets in XHTML output #1

Open namedgraph opened 1 year ago

namedgraph commented 1 year ago

Hi,

I have Markdown that goes like this:

...the IRI *<http://www.example.com/my/2.0>* might be redirected to *<file:///usr/local/ontologies/imported.v20.owl>*.

which gets converted to the following XHTML:

...the IRI <em><a href="http://www.example.com/my/2.0">http://www.example.com/my/2.0</a></em> might be redirected to <em><file:///usr/local/ontologies/imported.v20.owl></em>.

Why is the http: link converted to <a> and file: is not? In any case, raw brackets in <file:...> look like a bug to me -- they should be entity-escaped as &lt;file:...&gt;, otherwise the file is not well-formed XML.

namedgraph commented 1 year ago

Another example:

3. For every triple <s p o>, M(<s, p, o>)= <M(s), M(p), M(o)>;

becomes

<li>For every triple <s p o>, M(<s, p, o>)= <M(s), M(p), M(o)>;</li>

where it should be

<li>For every triple &lt;s p o&gt;, M(&lt;s, p, o&gt;)= &lt;M(s), M(p), M(o)&gt;;</li>
namedgraph commented 1 year ago

https://github.com/Python-Markdown/markdown/issues/1321