superset
superset copied to clipboard
Elements of markdown not supported by Text layout Element
Hello,
with Superset 3.1.1 (and previous), the layout element "Text" does not support markdown syntax for: • syntax highlighting of code blocks • the borders of a table
Screenshot
Markdown
The markdown source is joined source.md
Regards
I think we use the python markdown lib, on the main branch that's currently markdown==3.6. We would support what they support, and while our requirements/base.txt pins the lib at a specific version, you're free to upgrade to another version ahead of the pinned one. Our pyproject.toml says "markdown>=3.0", meaning you can pip upgrade markdown in your local builds
Much of this can be styled as well, so you can (re)add the borders on tables and things like that with dashboard css templates. There are a few examples here.
See their changelog here -> https://python-markdown.github.io/changelog/ . If there are features you'd like to see in Superset around markdown support, it has to go through that library.
Thanks for yours responses.
I test a markdown file with the library :
import markdown
with open("my_markdown.md", "r", encoding="utf-8") as input_file:
text = input_file.read()
html = markdown.markdown(text, extensions=['tables', 'fenced_code'])
with open("my_markdown_output.html", "w", encoding="utf-8", errors="xmlcharrefreplace") as output_file:
output_file.write(html)
The rendering is identical to that of Superset. For visual customization, I'll look at the CSS. Thanks again