From: Blake W. <bw...@la...> - 2008-02-17 04:19:32
|
Blake Winton wrote: > Waylan Limberg wrote: >> 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. > > Well, I think that escapes can happen (almost) anywhere, not just in > inline patterns. (Unless inline patterns handle everything except code > blocks...) Reading the documentation again, I'm not entirely sure why I > believe that. Perhaps confirmation from Mr. Gruber is in order. And searching the web, I see http://www.koders.com/noncode/fidB157BEC7D3FDEBB090E6CB9A1C01C4C4DD5DD434.aspx which says: 1.0.1 (14 Dec 2004): + Changed the syntax rules for code blocks and spans. Previously, backslash escapes for special Markdown characters were processed everywhere other than within inline HTML tags. Now, the contents of code blocks and spans are no longer processed for backslash escapes. This means that code blocks and spans are now treated literally, with no special rules to worry about regarding backslashes. **NOTE**: This changes the syntax from all previous versions of Markdown. Code blocks and spans involving backslash characters will now generate different output than before. So I guess escapes are only triggered within, uh, anything which isn't a code block or code span or inline html. Hmm, that's going to be ugly. Perhaps I'll just escape them all, and then in those three cases, handle the unescapes. Bleah. Is there a parent class for stuff which isn't a code block, code span, or inline html, by any chance? :) Thanks, Blake. |