Handle line breaks in blockquote's

This commit is contained in:
Oly 2018-11-02 08:36:59 +00:00
parent 88b9288b1e
commit 3e48622ccc
2 changed files with 7 additions and 3 deletions

View File

@ -45,9 +45,11 @@ def parse_text_html(doc, token, cls="", root=True):
# return f"<p{cls}>{token.value}</p>"
return f"{token.value}"
def blockquote(doc, token, cls="", root=True):
return "<%s%s>%s</%s>\n" % (tag, cls, item.value.replace("\n", "</br>"), tag)
def blockquote(doc, token, cls="", root=True):
return "<blockquote%s>%s</blockquote>\n" % (
cls, token.value.replace("\n", "<br />")
)
builddoc = {
@ -72,6 +74,7 @@ def handle_token(doc, item, root=False):
match = builddoc.get(item.token)
if not match:
return ""
tag, cls = match
if cls:
cls = f' class="{cls}"'
@ -79,6 +82,7 @@ def handle_token(doc, item, root=False):
cls = ""
if callable(tag):
return tag(doc, item, cls, root=root)
else:
return "<%s%s>%s</%s>\n" % (tag, cls, item.value, tag)

View File

@ -1 +1 @@
__version__=0.51
__version__=0.52