Closed ItsSforSam closed 8 months ago
See below:
import markdown
# Option 1: Don't indent content of your string which triggers indented code blocks.
MD = """
# Heading level 1
## Heading level 2
### Heading level 3
#### Heading level 4
##### Heading level 5
###### Heading level 6
"""
print('==== Option 1 ====')
print(markdown.markdown(MD))
# Option 2: "dendent" your indented content
import textwrap
MD = """
# Heading level 1
## Heading level 2
### Heading level 3
#### Heading level 4
##### Heading level 5
###### Heading level 6
"""
print('==== Option 2 ====')
print(markdown.markdown(textwrap.dedent(MD)))
$ python3 example.py
==== Option 1 ====
<h1>Heading level 1</h1>
<h2>Heading level 2</h2>
<h3>Heading level 3</h3>
<h4>Heading level 4</h4>
<h5>Heading level 5</h5>
<h6>Heading level 6</h6>
==== Option 2 ====
<h1>Heading level 1</h1>
<h2>Heading level 2</h2>
<h3>Heading level 3</h3>
<h4>Heading level 4</h4>
<h5>Heading level 5</h5>
I'm closing this as there is no bug here. This is a support question which has been answered.
the way I imagine it should be return
I can't find anywhere in the docs on this, nor to prevent this from occurring if it's intentional