comparison markup/filters.py @ 145:47bbd9d2a5af trunk

* Fix error in expression evaluation when the expression evaluates to an iterable that does not produce event tuples. * The first location step in path expressions longer assumes the `descendant::` axis, but rather the `child::` axis. * Import cleanups.
author cmlenz
date Tue, 15 Aug 2006 09:52:47 +0000
parents 349b3ff5367d
children 2f30ce3fb85e
comparison
equal deleted inserted replaced
144:d1ce85a7f296 145:47bbd9d2a5af
11 # individuals. For the exact contribution history, see the revision 11 # individuals. For the exact contribution history, see the revision
12 # history and logs, available at http://markup.edgewall.org/log/. 12 # history and logs, available at http://markup.edgewall.org/log/.
13 13
14 """Implementation of a number of stream filters.""" 14 """Implementation of a number of stream filters."""
15 15
16 from itertools import chain
17 try: 16 try:
18 frozenset 17 frozenset
19 except NameError: 18 except NameError:
20 from sets import ImmutableSet as frozenset 19 from sets import ImmutableSet as frozenset
21 import re 20 import re
22 21
23 from markup.core import Attributes, Markup, Namespace, escape, stripentities 22 from markup.core import Attributes, Namespace, stripentities
24 from markup.core import END, END_NS, START, START_NS, TEXT 23 from markup.core import END, END_NS, START, START_NS
25 from markup.path import Path
26 24
27 __all__ = ['HTMLSanitizer', 'IncludeFilter'] 25 __all__ = ['HTMLSanitizer', 'IncludeFilter']
28 26
29 27
30 class HTMLSanitizer(object): 28 class HTMLSanitizer(object):
137 contain. 135 contain.
138 136
139 @param stream: the markup event stream to filter 137 @param stream: the markup event stream to filter
140 @param ctxt: the template context 138 @param ctxt: the template context
141 """ 139 """
142 from markup.template import Template, TemplateError, TemplateNotFound 140 from markup.template import TemplateError, TemplateNotFound
143 141
144 ns_prefixes = [] 142 ns_prefixes = []
145 in_fallback = False 143 in_fallback = False
146 include_href, fallback_stream = None, None 144 include_href, fallback_stream = None, None
147 namespace = self.NAMESPACE 145 namespace = self.NAMESPACE
Copyright (C) 2012-2017 Edgewall Software