mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
suggested place to parse lemmy spoiler tags
This commit is contained in:
parent
91ee3b2cc7
commit
274cd536b2
1 changed files with 3 additions and 1 deletions
|
@ -216,7 +216,9 @@ def allowlist_html(html: str) -> str:
|
|||
|
||||
def markdown_to_html(markdown_text) -> str:
|
||||
if markdown_text:
|
||||
return allowlist_html(markdown2.markdown(markdown_text, safe_mode=True, extras={'middle-word-em': False, 'tables': True, 'fenced-code-blocks': True, 'strike': True}))
|
||||
raw_html = markdown2.markdown(markdown_text, safe_mode=True, extras={'middle-word-em': False, 'tables': True, 'fenced-code-blocks': True, 'strike': True})
|
||||
# todo: in raw_html, replace lemmy spoiler tokens with appropriate html tags instead.
|
||||
return allowlist_html(raw_html)
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
|
Loading…
Reference in a new issue