OpenEnergyPlatform / oeplatform

Repository for the code of the Open Energy Platform (OEP) website. The OEP provides an interface to the Open Energy Family
http://openenergyplatform.org/
GNU Affero General Public License v3.0
61 stars 19 forks source link

Tutorials from markdown look different in preview then in final version #656

Closed wingechr closed 3 years ago

wingechr commented 3 years ago

Steps to reproduce:

<a name="anchor">i am an anchor</a>
[i am a link to the anchor](#anchor)

preview

rendered

jh-RLI commented 3 years ago

I have provided a hotfix to escape the html that fixes this bug. (see linked PR)

Thereby I came across new bugs: Some markdown elements are not rendered as expected (elements like checkbox and code blocks).

Why does it behave like this: It seems that Markdown2 and the preview of the easymde Markdown Editor generate different results. Easymde does a better job rendering the markdown, but it does not generate html.

Markdown2 is generating (markdown to html) which is then saved to DB, the following is not generated as expected:

checkbox:

"- [ ]" as :

<ul>
<li>[ ] Y</li>
</ul>

codeblocks (containing HTML are also escaped):

"description:

code"

or "code" as:

<pre><code>
code
</code></pre>
jh-RLI commented 3 years ago

I will have a look at how to set anchors in markdown or insert anchors as HTML. Are there any other HTML tags needed? @wingechr

wingechr commented 3 years ago

no, but we can also forgo the anchors, if it's too much hassel. it's more of a nice to have