From: Waylan L. <wa...@gm...> - 2008-02-19 21:30:01
|
After posting this last night I spent some time playing with an idea I had. What if the inlinepatterns had two stages? In the first stage, the regex was run against the text and any resulting matches are stored for later retrieval. Throughout this process the text remains a single string. Then, only after all the patterns have run and all the matches found do we modify the string by looping through the matches and call the handleMatch method of each pattern. The result is here [1]. It doesn't currently handle nesting well (or at all), but that should be fairly easy, the api for storage is ugly (really ugly) and it's probably terribly slow. I'm also not using the dom, but that should be easy to change. It certainly is not ready for public consumption. But what do you think? It is worth further efforts? What I find most compelling is that with dom support added back in, this continues to support the current extension api. In fact, there should be little to no need for adjustments to existing extensions In any event, there are some other good ideas here. Perhaps with a little from everyone, we'll see something that works. And I'm half inclined to drop the dom from inlinepatterns as well. [1]: https://code.achinghead.com/browser/md_branches/inlinePatterns/patterns.py -- ---- Waylan Limberg wa...@gm... |