aboutsummaryrefslogtreecommitdiff
path: root/textoutpc/builtin/_Show.py
blob: 4bcab19daedc2d72888867f36ad188486a0aaabb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/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"]


class ShowTag(_BlockTag):
	""" Tag which shows the HTML code that is produced by textout().
		Example uses:

		[show][b]hello world![/show]
	"""

	aliases = ('[show]',)
	notempty = True
	superblock = True
	inlined = True
	generic = False
	raw = False

	def preprocess_html(self, content):
		return _htmlescape(content)

	def begin_html(self):
		return '<span class="inline-code">'

	def end_html(self):
		return '</span>'

# End of file.