From: Mark E. <ei...@gm...> - 2009-08-21 04:10:12
|
I'd like to write a treeprocessor that takes the <h2> elements and stuffs <a name="..."> anchors before them (with the anchorname derived from the h2 text.) markdown.etree does give me findall... but the Elements I get back don't appear to have any sibling operations that would let me do that. First question is of course "is there a better way to do that"... second is, does it make sense to consider lxml.etree another candidate for etree_loader.importETree? (That would at least give me addprevious which does exactly what I'm looking for...) I did try import lxml.etree markdown.etree = lxml.etree (right after the "import markdown" itself) which got a couple of FutureWarnings and a fatal complaint about null bytes in strings, so it doesn't Just Work... -- _Mark_ <ei...@th...> <ei...@gm...> |