Open elinxie opened 3 years ago
Actually I found something funny that happens
So with
Markdown
''' python
def sample(args):
return args[0]
'''
( Other docs here )
If I had some text above the code block like below
Markdown
(some text here)
''' python
def sample(args):
return args[0]
'''
Then I get the error I showed
rst
(some text here)
```python
def sample(args):
return args[0]
... code-block:: python
(Other docs here)
But if I add a space:
Markdown
(some text here)
''' python
def sample(args):
return args[0]
'''
Then I get the correct output
rst
(some text here)
... code-block:: python
def sample(args):
return args[0]
(Other docs here)
So I guess m2r2 does support python syntax highlighting however there is this bug with the space. Is this something that should be fixed?
I'll be looking into this next
@elinxie I jush pushed some tests:
Or you can see the full diff here
Those tests are passing right now, so I'm not sure I have quite understood your problem... would you be able to provide a failing test?
I am try to convert the following code (sample function, replacing back-ticks with apostrophes )
Markdown
to
Rst
But the rst looks like this
rst
Do you know what is going on? I looked into your code and saw that there is the function
block_code
that helps convert a markdown code block to a rst code block, and I see that m2r2 supportsshell
orbash
syntax highlighting, but for some reason it's not working with python. Do you know what is going on?