| Server IP : 170.10.162.208 / Your IP : 216.73.216.38 Web Server : LiteSpeed System : Linux altar19.supremepanel19.com 4.18.0-553.69.1.lve.el8.x86_64 #1 SMP Wed Aug 13 19:53:59 UTC 2025 x86_64 User : deltahospital ( 1806) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/opt/alt/python313/lib/python3.13/site-packages/textile/ |
Upload File : |
from .core import Textile
class TextileFactory(object):
""" Use TextileFactory to create a Textile object which can be re-used to
process multiple strings with the same settings."""
def __init__(self, restricted=False, lite=False, sanitize=False,
noimage=None, get_sizes=False, html_type='xhtml'):
self.class_parms = {}
self.method_parms = {}
if lite and not restricted:
raise ValueError("lite can only be enabled in restricted mode")
if restricted:
self.class_parms['restricted'] = True
self.class_parms['lite'] = lite
self.method_parms['rel'] = 'nofollow'
if noimage is None:
noimage = bool(restricted)
self.class_parms['noimage'] = noimage
self.method_parms['sanitize'] = sanitize
self.class_parms['get_sizes'] = get_sizes
if html_type not in ['xhtml', 'html5']:
raise ValueError("html_type must be 'xhtml' or 'html5'")
else:
self.class_parms['html_type'] = html_type
def process(self, text):
return Textile(**self.class_parms).parse(text, **self.method_parms)