More textile optional.
[fnpdjango.git] / fnpdjango / utils / text / textilepl.py
1 try:
2     from textile import Textile
3 except ImportError:
4     pass
5 else:
6
7     class TextilePL(Textile):
8         """Polish version of Textile.
9
10          Changes opening quote to Polish lower-double.
11         """
12         glyph_definitions = dict(Textile.glyph_definitions,
13             quote_double_open = '„'
14         )
15
16
17     def textile_pl(text):
18         return TextilePL().parse(text)
19
20
21     def textile_restricted_pl(text):
22         return TextilePL(restricted=True, lite=True, noimage=True).parse(
23             text, rel='nofollow')