OXIESEC PANEL
- Current Dir:
/
/
snap
/
certbot
/
4737
/
usr
/
lib
/
python3
/
dist-packages
/
pip
/
_vendor
/
pygments
/
formatters
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/12/2025 06:19:49 PM
rwxr-xr-x
📄
__init__.py
5.3 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
_mapping.py
4.08 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
bbcode.py
3.24 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
groff.py
4.97 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
html.py
34.78 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
img.py
21.42 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
irc.py
4.86 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
latex.py
18.9 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
other.py
4.95 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
pangomarkup.py
2.16 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
rtf.py
4.9 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
svg.py
7.16 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
terminal.py
4.56 KB
10/18/2024 05:04:47 PM
rw-r--r--
📄
terminal256.py
11.48 KB
10/18/2024 05:04:47 PM
rw-r--r--
Editing: pangomarkup.py
Close
""" pygments.formatters.pangomarkup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for Pango markup output. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pip._vendor.pygments.formatter import Formatter __all__ = ['PangoMarkupFormatter'] _escape_table = { ord('&'): '&', ord('<'): '<', } def escape_special_chars(text, table=_escape_table): """Escape & and < for Pango Markup.""" return text.translate(table) class PangoMarkupFormatter(Formatter): """ Format tokens as Pango Markup code. It can then be rendered to an SVG. .. versionadded:: 2.9 """ name = 'Pango Markup' aliases = ['pango', 'pangomarkup'] filenames = [] def __init__(self, **options): Formatter.__init__(self, **options) self.styles = {} for token, style in self.style: start = '' end = '' if style['color']: start += '<span fgcolor="#%s">' % style['color'] end = '</span>' + end if style['bold']: start += '<b>' end = '</b>' + end if style['italic']: start += '<i>' end = '</i>' + end if style['underline']: start += '<u>' end = '</u>' + end self.styles[token] = (start, end) def format_unencoded(self, tokensource, outfile): lastval = '' lasttype = None outfile.write('<tt>') for ttype, value in tokensource: while ttype not in self.styles: ttype = ttype.parent if ttype == lasttype: lastval += escape_special_chars(value) else: if lastval: stylebegin, styleend = self.styles[lasttype] outfile.write(stylebegin + lastval + styleend) lastval = escape_special_chars(value) lasttype = ttype if lastval: stylebegin, styleend = self.styles[lasttype] outfile.write(stylebegin + lastval + styleend) outfile.write('</tt>')