From: Waylan L. <wa...@gm...> - 2008-02-17 02:59:40
|
Blake, this is an interesting approach I hadn't thought of and I like it . However, what about code blocks and spans in which the author had included an escape sequence? When we run through the unescape code, how do we know that it was an escaped character, not something intentionally typed by the author that should be left alone? For example: The escape sequence for a backslash (`\\`) is: `\`. Or is that why you also escape the `&`? Either way, I was never particularly fond of the way markdown currently handles escaping. I think your solution is much more elegant and I'd prefer to use something very much like it. However, I'm thinking that one of two things needs to happen: 1. The escaping needs to happen at the inline pattern level (or at least right before/after them, perhaps in _handleInline), rather than on the entire document. That eliminates the need to worry about messing with code blocks and raw html. 2. Assuming the above concern is moot, the escaping and unescaping should be pre and post processors respectively. Check the doc strings on the latest in svn (see below) for TextPreprocessor (line 413) and TextPostprocessor (line 945) which run on the entire document as a single string rather than split lines. I appreciate all your hard work on this. However, it would be helpful if your diffs were against the latest in svn. There's been quite a few changes since 1.6. You can checkout from here: svn co https://python-markdown.svn.sourceforge.net/svnroot/python-markdown python-markdown Which includes the test suite so you can check whether your breaking anything else. Or if you don't have access to subversion, at least the file markdown.py is available here: http://python-markdown.svn.sourceforge.net/viewvc/python-markdown/markdown.py?view=markup -- ---- Waylan Limberg wa...@gm... |