convert more shortcodes

This commit is contained in:
dousha 2025-01-06 18:18:48 +08:00
parent e94735125b
commit ab5d52480b

14
main.py
View File

@ -78,6 +78,20 @@ def fix_short_code_content(tag, params, content):
return f"::: graphviz\n{content}\n:::\n" return f"::: graphviz\n{content}\n:::\n"
elif tag == 'abcjs' or tag == 'abc': elif tag == 'abcjs' or tag == 'abc':
return f"::: abc\n{content}\n:::\n" return f"::: abc\n{content}\n:::\n"
elif tag == 'kbd' or tag == 'key':
return f"<k content=\"{content}\">"
elif tag == 'tr':
if params.strip() == '':
return f"<tx content=\"{content}\">"
else:
return f"<tx {params.strip()} content=\"{content}\">"
elif tag == 'cl':
if params.strip() == '':
return f"<cl content=\"{content}\">"
else:
return f"<cl {params.strip()} content=\"{content}\">"
elif tag == 'btn' or tag == 'ctl':
return f"<btn {params.strip()} content=\"{content}\">"
else: else:
return None return None