OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """ | 2 """ |
3 markupsafe._native | 3 markupsafe._native |
4 ~~~~~~~~~~~~~~~~~~ | 4 ~~~~~~~~~~~~~~~~~~ |
5 | 5 |
6 Native Python implementation the C module is not compiled. | 6 Native Python implementation the C module is not compiled. |
7 | 7 |
8 :copyright: (c) 2010 by Armin Ronacher. | 8 :copyright: (c) 2010 by Armin Ronacher. |
9 :license: BSD, see LICENSE for more details. | 9 :license: BSD, see LICENSE for more details. |
10 """ | 10 """ |
(...skipping 26 matching lines...) Expand all Loading... |
37 return escape(s) | 37 return escape(s) |
38 | 38 |
39 | 39 |
40 def soft_unicode(s): | 40 def soft_unicode(s): |
41 """Make a string unicode if it isn't already. That way a markup | 41 """Make a string unicode if it isn't already. That way a markup |
42 string is not converted back to unicode. | 42 string is not converted back to unicode. |
43 """ | 43 """ |
44 if not isinstance(s, text_type): | 44 if not isinstance(s, text_type): |
45 s = text_type(s) | 45 s = text_type(s) |
46 return s | 46 return s |
OLD | NEW |