add motd schema and motd editor
This commit is contained in:
@@ -218,10 +218,14 @@ def should_collapse(text, surrounding):
|
||||
|
||||
return False
|
||||
|
||||
def babycode_to_html(s):
|
||||
def babycode_to_html(s, banned_tags=None):
|
||||
allowed_tags = list(TAGS.keys())
|
||||
if banned_tags is not None:
|
||||
for tag in banned_tags:
|
||||
allowed_tags.remove(tag)
|
||||
subj = escape(s.strip().replace('\r\n', '\n').replace('\r', '\n'))
|
||||
parser = Parser(subj)
|
||||
parser.valid_bbcode_tags = TAGS.keys()
|
||||
parser.valid_bbcode_tags = allowed_tags
|
||||
parser.bbcode_tags_only_text_children = TEXT_ONLY
|
||||
parser.valid_emotes = EMOJI.keys()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user