mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-01-22 13:19:52 +01:00
KML improvements
Don't parse > since that has a different meaning for us, also whitelisting a few more markdown tags so lists work.
This commit is contained in:
parent
a484244392
commit
03433810f1
@ -2162,7 +2162,8 @@ def sendUSStatItems():
|
||||
# KoboldAI Markup Formatting (Mixture of Markdown and sanitized html)
|
||||
#==================================================================#
|
||||
def kml(txt):
|
||||
txt = bleach.clean(markdown.markdown(txt), tags = ['p', 'em', 'strong', 'code', 'h1', 'h2', 'h3', 'h4', 'h5', 'b', 'i', 'a', 'span', 'button'], styles = ['color', 'font-weight'], attributes=['id', 'class', 'style', 'href'])
|
||||
txt = txt.replace('>', '>')
|
||||
txt = bleach.clean(markdown.markdown(txt), tags = ['p', 'em', 'strong', 'code', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'ul', 'b', 'i', 'a', 'span', 'button'], styles = ['color', 'font-weight'], attributes=['id', 'class', 'style', 'href'])
|
||||
return txt
|
||||
|
||||
#==================================================================#
|
||||
|
Loading…
Reference in New Issue
Block a user