polarwinkel / mdtex2html

python3-library to convert Markdown with included LaTeX-Formulas to HTML with MathML
GNU Lesser General Public License v2.1
41 stars 5 forks source link

Further indented bulleted entries in numbered lists defaulting #3

Open nxfi777 opened 7 months ago

nxfi777 commented 7 months ago

Sample of the issue:

Sample of the issue

Input:

4. **Curl:**
   - The curl of a vector field is a vector field that represents the rotation or swirling strength of the original vector field at each point.
   - It is denoted as ∇ × F for a vector field F.

Expected:

4. 𝐂𝐮𝐫𝐥:
   • The curl of a vector field is a vector field that represents the rotation or swirling strength of the original vector field at each point.
   • It is denoted as ∇ × F for a vector field F.
polarwinkel commented 7 months ago

Sorry, I don't really understand your issue, could you provide a minimal code example that shows the issue? Like

mdtex2html.convert('### Foo\n  - bar', extensions=[])

With the python-markdown extensions I use by default (among others def_list, nl2br and sane_lists) your code renders just as expected for me.

Maybe you are not using extensions you are used to in a different context?

polarwinkel commented 7 months ago

(sorry, wrong click,didn't want to close it)

nxfi777 commented 7 months ago

Sorry, I don't really understand your issue, could you provide a minimal code example that shows the issue? Like

mdtex2html.convert('### Foo\n  - bar', extensions=[])

With the python-markdown extensions I use by default (among others def_list, nl2br and sane_lists) your code renders just as expected for me.

Maybe you are not using extensions you are used to in a different context?

I tested both cases and managed to reproduce the issue with the following code:

import mdtex2html

example_text = """4. **Curl:**
   - The curl of a vector field is a vector field that represents the rotation or swirling strength of the original vector field at each point.
   - It is denoted as ∇ × F for a vector field F.
"""

print(mdtex2html.convert(example_text))

Headers are parsed correctly there are no issues with that as you said, but the issue above remains.

polarwinkel commented 2 months ago

Are you possibly just missing one whitespace in your sub-list?

4. **Curl:**
   - The curl of a vector field is a vector field that represents the rotation or swirling strength of the original vector field at each point.
   - It is denoted as ∇ × F for a vector field F.

doesn't work (even though it renders different on my firefox than on your screenshot), but

4. **Curl:**
    - The curl of a vector field is a vector field that represents the rotation or swirling strength of the original vector field at each point.
    - It is denoted as ∇ × F for a vector field F.

does render as expected.