GithubHelp home page GithubHelp logo

Comments (11)

ncornette avatar ncornette commented on July 2, 2024

Hi, I can confirm apparently python-markdown doesn't handle indented code blocks,

Thank you for reporting the issue.

from python-markdown-editor.

vaygr avatar vaygr commented on July 2, 2024

Interesting, maybe there's a chance to add support for python-markdown2?

from python-markdown-editor.

vaygr avatar vaygr commented on July 2, 2024

Tested with python-markdown2, same issue.

from python-markdown-editor.

ncornette avatar ncornette commented on July 2, 2024

An option would be to add an extension at markdown initialization the same way I did for strikethrough.

A project exists which contains almost all GFM extensions to python markdown including strikethrough : https://github.com/Zopieux/py-gfm

Unfortunately it doesn't seem to support indented codeblocks...

At least this project could improve support for GFM, if it can be confirmed it doesn't support indented codeblocks, making a fork could also be an option.

from python-markdown-editor.

vaygr avatar vaygr commented on July 2, 2024

This project might be helpful. I've managed to make it working using superfences extension with modification from this PR I've just created by executing this:

markdown_edit -x pymdownx.superfences test.md

Should pymdownx.superfences be included by default introducing yet another dependency or should the above-mentioned PR be merged in order to make overriding work correctly?

from python-markdown-editor.

ncornette avatar ncornette commented on July 2, 2024

If pymdownx.superfences extension makes rendering closer to GFM, I would recommend you include it directly into defaults extensions by updating MARKDOWN_EXT constant

from python-markdown-editor.

vaygr avatar vaygr commented on July 2, 2024

@ncornette it should be pretty close. The closest one would probably be pymdownx.github. But the only concern I have is yet another dependency just for ability to use GFM-like code blocks, while with optional -x argument there's more freedom for an end user. But it's not critical, I agree.

By the way, unfortunately I couldn't make the tasklist extension (which is included in pymdownx.github) work properly -- it concatenates list and check chars. Do you have any idea on what would cause that?

from python-markdown-editor.

vaygr avatar vaygr commented on July 2, 2024

Oh, I've figured out it was just missing task-list class. With this patch it works as expected:

--- markdown_editor/css/markdown.css.orig	2016-06-06 18:24:21.000000000 -0400
+++ markdown_editor/css/markdown.css	2017-01-17 20:49:16.872820211 -0500
@@ -113,7 +113,7 @@
 padding-left:30px
 }
 
-.markdown-body ul.no-list,.markdown-body ol.no-list{
+.markdown-body ul.no-list,.markdown-body ul.task-list,.markdown-body ol.no-list,.markdown-body ol.task-list{
 list-style-type:none;
 padding:0
 }

So what do you think? Along with this patch and additional entry of pymdownx.github in MARKDOWN_EXT should we introduce yet another dependency for better GFM support?

It also worth mentioning that pymdownx.github already includes tilde extension, so maybe strikethrough would become redundant in that case.

from python-markdown-editor.

ncornette avatar ncornette commented on July 2, 2024

Hey Vaygr !

It seems you found solutions to improve GFM rendering, don't hesitate to update your PR with your improvements, I will check the result before merging!

Let me know if you agree to proceed this way, I will eventually update the version and publish a new release on PIP.

Thank you for your work !

from python-markdown-editor.

vaygr avatar vaygr commented on July 2, 2024

@ncornette absolutely!

I've pushed respective commits to the above-mentioned PR for your review.

from python-markdown-editor.

vaygr avatar vaygr commented on July 2, 2024

Verified in recently released 1.0.3. Works like a charm. Thanks!

p.s. therefore closing this.

from python-markdown-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.