From: Felix W. <Fel...@gm...> - 2005-09-05 20:17:18
|
David Abrahams wrote: > Felix Wiemann writes: > >> $ echo '***foo bar***' | rst2pseudoxml.py >> <document source="<stdin>"> >> <paragraph> >> <strong> >> <emphasis>foo bar</emphasis> >> >> That's a text node which contains literally "<emphasis>foo >> bar</emphasis>". Correct would be: > > Okay, now that's just spooky. How could that be due to a bug in my > code? I didn't add any code that generates XML tags! The nodes are probably accidentally being converted to strings: Python 2.4.1 (#1, May 7 2005, 18:37:22) [GCC 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie- on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from docutils import nodes >>> emphasis = nodes.emphasis('', 'foo bar') >>> str(emphasis) '<emphasis>foo bar</emphasis>' >>> -- For private mail please ensure that the header contains 'Felix Wiemann'. "the number of contributors [...] is strongly and inversely correlated with the number of hoops each project makes a contributing user go through." -- ESR |