2
0
Fork 0
textout/textoutpc/builtin/_Show.py

37 lines
860 B
Python
Raw Normal View History

#!/usr/bin/env python3
#******************************************************************************
# Copyright (C) 2018 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
# This file is part of the textoutpc project, which is MIT-licensed.
#******************************************************************************
from html import escape as _htmlescape
from .. import BlockTag as _BlockTag
__all__ = ["ShowTag"]
2018-08-25 17:38:24 +02:00
class ShowTag(_BlockTag):
""" Tag which shows the HTML code that is produced by textout().
Example uses:
2018-08-25 17:38:24 +02:00
[show][b]hello world![/show]
"""
aliases = ('[show]',)
notempty = True
superblock = True
2018-06-22 01:35:41 +02:00
inlined = True
generic = False
raw = False
def preprocess_html(self, content):
return _htmlescape(content)
def begin_html(self):
2018-07-29 19:51:42 +02:00
return '<span class="inline-code">'
def end_html(self):
return '</span>'
# End of file.