You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Markdown allows me to insert code block between three backticks (```) , and if my code exactly contains three backticks, I can put them between four or more consecutive backticks like:
`````
```cpp
int x = 10;
```
`````
In another word, if my code block is starting with N (N >= 3) backtick sequence, parser should look for another backtick sequence with exact the same length (N) to determine where the code block ends.
Markdown2 works fine by default:
text="""````````cppint x = 10;````````"""print(markdown2.markdown(text))
Activity
nicholasserra commentedon May 6, 2019
Thanks for the report! PRs welcome :)
skywind3000 commentedon May 6, 2019
I wish if I could. But I am not capable for this, not skilled in parsing text and regexp.
The only thing I can do is using a lot of
str.findto replace old code, it may work but I believe that you will not like it.skywind3000 commentedon May 7, 2019
Now I use an ugly preprocessor before passing text to markdown2
This is just an ugly work around which I am using right now.
skywind3000 commentedon Jun 25, 2019
The previous preprocessor has some defects, here is the correct one:
This one works very well as a preprocessor of markdown2
fixed: incorrect parsing nested backtick block in trentm#327
skywind3000 commentedon Sep 6, 2019
@nicholasserra PR is ready:
#333
Merge pull request #418 from Crozzers/fix-issue-327