Timwi wrote:
in response to Brion Vibber's reply to my posting to the wrong mailing list (apologies),
No problem. :)
This takes care of quite a lot of weird cases and nestings. However, of course I'm aware that it is not perfect. I can construct cases where it will still fail, but those are cases that I don't think will ever actually come up in an encyclopedia article (or if they do, the author was feeling fancy and deserves to be shot ;-) ).
Hmm, here are some cases that really oughtn't fail; even if they're probably rare, they're perfectly legit. Using a pattern twice on the same line shouldn't cause it to fail. :(
* ''em '''em-strong''''' normal ''em '''em-strong''''' goes to: <em>em <strong>em-strong<em><strong> normal </em>em </strong>em-strong</em></strong>
* '''strong ''em-strong''''' normal '''strong ''em-strong''''' <strong>strong <em>em-strong<em><strong> normal </strong>strong </em>em-strong</em></strong>
* '''''em-strong'' strong''' normal '''''em-strong'' strong''' <em><strong>em-strong<em> strong</strong> normal </em><strong>em-strong</em> strong</strong>
An alternate implementation, incidentally, might be to treat '' and ''' as toggles rather than nestable delimiters, and ensure that the correct nesting level in the output HTML is maintained upon changing the toggles.
How do you usually handle casual programmer contributions? Are they usually posted to this mailing list? Or do you have a BugZilla installation somewhere where I should upload this as a patch? Or is there an actual chance I might get write access to the repository?
In theory you can upload patches on sourceforge, but no one will ever look at it. :) Posting to the list is the most likely way to get people to look it over.
If we ever get around to setting up a CVS commit notification mailer that would do as well...
-- brion vibber (brion @ pobox.com)