Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a library for python that allows conversions from markdown to html (including lists)?

Is there a library for python that allows conversions from markdown to html (including lists)?

I have tried using two libraries: markdown and markdown2
Both of these libraries take this input:
enter image description here

###Stepped
The translation will pause if:
- There are no translations for this word
- There are multiple translations for this word

And will ask you how to continue

and convert it to this:
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<h3>Stepped</h3>

<p>The translation will pause if:
- There are no translations for this word
- There are multiple translations for this word</p>

<p>And will ask you how to continue</p>

I’m looking for functionality similar to https://markdowntohtml.com/

>Solution :

That’s a pretty standard feature.

The problem is likely your input. Add a blank line above the list:

###Stepped
The translation will pause if:

- There are no translations for this word
- There are multiple translations for this word

And will ask you how to continue

I suggest also adding a blank line after the heading, and a space separating the hashes from the heading text:

### Stepped

The translation will pause if:

- There are no translations for this word
- There are multiple translations for this word

And will ask you how to continue

This aids readability of the source code, which was an explicit design consideration:

The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

The space between ### and Stepped is also required in many specs and implementations, including CommonMark, which is rapidly gaining traction:

The opening sequence of # characters must be followed by spaces or tabs, or by the end of line.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading