It's too complex to set `hard_wrap=True`, may be add it to `create_markdown`?
dantezhu opened this issue · 0 comments
dantezhu commented
If I want to set hard_warp=True
, I have to write lots of codes, like this:
from mistune import InlineParser, HTMLRenderer, Markdown
from mistune.plugins import plugin_strikethrough, plugin_table, plugin_task_lists
renderer = HTMLRenderer(escape=False)
markdown = Markdown(renderer, inline=InlineParser(renderer, hard_wrap=True), plugins=[plugin_strikethrough, plugin_table, plugin_task_lists])
with open('x.md', 'r', encoding='utf8') as f:
html = markdown(f.read())
with open('4.html', 'w') as f2:
f2.write(html)
It's ugly, If it could be added in create_markdown, It will be easier.