1
0

Allow tabs in fenced code blocks

This commit is contained in:
Ryan Fox 2021-03-30 01:57:42 +00:00
parent 256566a141
commit 33f581ad10
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E

View File

@ -3,9 +3,10 @@
import sys
import markdown
from template import template
from pymdownx.superfences import SuperFencesCodeExtension
def main():
md = markdown.Markdown(extensions = ["meta", "extra", "toc"])
md = markdown.Markdown(extensions = ["meta", "extra", "toc", SuperFencesCodeExtension(preserve_tabs=True)])
with open(sys.argv[1], "r", encoding="utf-8") as file_in:
html = md.convert(file_in.read())
output = template(html, sys.argv[2], ".html", md.Meta) if "template" in md.Meta else html