Changeset 1146
- Timestamp:
- Nov 29, 2010, 9:45:22 PM (13 years ago)
- Location:
- branches/experimental/py3k/genshi/template
- Files:
-
- 2 edited
-
markup.py (modified) (2 diffs)
-
tests/markup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/experimental/py3k/genshi/template/markup.py
r1120 r1146 309 309 match_templates = ctxt._match_templates 310 310 311 tail = [] 312 def _strip(stream, append=tail.append): 311 def _strip(stream, append): 313 312 depth = 1 314 313 next = stream.next … … 354 353 if 'match_once' not in hints and 'not_recursive' in hints: 355 354 pre_end -= 1 356 inner = _strip(stream) 355 tail = [] 356 inner = _strip(stream, tail.append) 357 357 if pre_end > 0: 358 358 inner = self._match(inner, ctxt, start=start, -
branches/experimental/py3k/genshi/template/tests/markup.py
r1143 r1146 733 733 </html>""", tmpl.generate().render(encoding=None)) 734 734 735 def test_match_tail_handling(self): 736 # See <http://genshi.edgewall.org/ticket/399> 737 xml = ("""<rhyme xmlns:py="http://genshi.edgewall.org/"> 738 <py:match path="*[@type]"> 739 ${select('.')} 740 </py:match> 741 742 <lines> 743 <first type="one">fish</first> 744 <second type="two">fish</second> 745 <third type="red">fish</third> 746 <fourth type="blue">fish</fourth> 747 </lines> 748 </rhyme>""") 749 tmpl = MarkupTemplate(xml, filename='test.html') 750 self.assertEqual("""<rhyme> 751 <lines> 752 <first type="one">fish</first> 753 <second type="two">fish</second> 754 <third type="red">fish</third> 755 <fourth type="blue">fish</fourth> 756 </lines> 757 </rhyme>""", tmpl.generate().render(encoding=None)) 758 735 759 736 760 def suite():
Note: See TracChangeset
for help on using the changeset viewer.
