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"<p{cls}>{token.value}</p>" | ||||||
|     return f"{token.value}" |     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 = { | builddoc = { | ||||||
|  | @ -72,6 +74,7 @@ def handle_token(doc, item, root=False): | ||||||
|     match = builddoc.get(item.token) |     match = builddoc.get(item.token) | ||||||
|     if not match: |     if not match: | ||||||
|         return "" |         return "" | ||||||
|  | 
 | ||||||
|     tag, cls = match |     tag, cls = match | ||||||
|     if cls: |     if cls: | ||||||
|         cls = f' class="{cls}"' |         cls = f' class="{cls}"' | ||||||
|  | @ -79,6 +82,7 @@ def handle_token(doc, item, root=False): | ||||||
|         cls = "" |         cls = "" | ||||||
|     if callable(tag): |     if callable(tag): | ||||||
|         return tag(doc, item, cls, root=root) |         return tag(doc, item, cls, root=root) | ||||||
|  | 
 | ||||||
|     else: |     else: | ||||||
|         return "<%s%s>%s</%s>\n" % (tag, cls, item.value, tag) |         return "<%s%s>%s</%s>\n" % (tag, cls, item.value, tag) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1 +1 @@ | ||||||
| __version__=0.51 | __version__=0.52 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue