From: Martin G. <gim...@gi...> - 2002-11-07 20:31:03
|
Jeff Dairiki <da...@da...> writes: > The new "nestled" emphasis: *bold*, _italic_, and =monospace=. (I > think ''emph'' and __strong__ are quasi-deprecated.) There's a problem with this markup: it only works when there's a space after the closing *, _ or =. So your example doesn't work as you typed it - you have to type it like this: *bold* , _italic_ , and =monospace= . Which, of course, looks awful because of the spaces before ','... Also, why is the underscore used for italic? I've always thought that one used /slashes/ for italic and _underscore_ for underlining. At least that's how Gnus pretty-prints my mails, and it also seams more logical to me. I changed the Markup_nestled_emphasis class so do the markup like this, but I'm afraid that it will change something else, because I changed the huge regular expressions (which I didn't understand fully) to much simpler versions... Perhaps someone could explain, what all the look-ahead and look-behind does? The changed class is this: class Markup_nestled_emphasis extends BalancedMarkup { var $_start_regexp = '[*_=\/]'; function getEndRegexp ($match) { return "\\" . $match; } function markup ($match, $body) { switch ($match) { case '*': return new HtmlElement('b', $body); case '_': return new HtmlElement('u', $body); case '=': return new HtmlElement('tt', $body); default: return new HtmlElement('i', $body); } } } -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather => Shows the current weather on your webpage and PHP Shell => A telnet-connection (almost :-) in a PHP page. |