From: Dave P. <dav...@gm...> - 2014-08-26 06:40:47
|
On 26 August 2014 00:59, Waylan Limberg <way...@ic...> wrote: > Dave, > > I assume you are referring to access to the parse tree from which you can > render your own output. Not as I saw it? I wanted to isolate the tokens sought by the parse, with the possibility of adding new ones? > I just can't see maintaining the > existing API and moving to such a different way of parsing Markdown text. I > think there is plenty of room for both implementations to thrive. My issue with that is the constraints of being limited to the original token set? > > That said, while Python-Markdown doesn't technically generate a parse tree - > it does create the entire document as an ElementTree, and the serializer can > be swapped out for your own - so you could write your own serializer which > output XML if you desired. Thanks, I hadn't thought of that aspect. Of course, you would then have to work out how to > handle the Postprocessors that run after the serializer - but it's not > impossible. See this [test][2] which demonstrates how to swap out the > serializer. > > [1]: https://github.com/lepture/mistune > [2]: > https://github.com/waylan/Python-Markdown/blob/master/tests/test_apis.py#L38 > 6 Thanks for the links. regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk |