Handle line breaks in blockquote's
This commit is contained in:
		
							parent
							
								
									88b9288b1e
								
							
						
					
					
						commit
						3e48622ccc
					
				|  | @ -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) | ||||
| 
 | ||||
|  |  | |||
|  | @ -1 +1 @@ | |||
| __version__=0.51 | ||||
| __version__=0.52 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue