On 7. Oct 2006, at 06:27, Allan Odgaard wrote:

Replying to myself here, as I didn’t get any other replies than the latest from A. Pagaitzis (so checked the archive).

Noticed the patterns for setext style headings are:
    ^(.+)[ \t]*\n=+[ \t]*\n+

Here (.+) is greedy and thus will match as much as possible, including trailing tabs or spaces, thus leaving the [ \t]* with nothing (which will then do zero repeats).

Example:

    % Markdown.pl <<< $'Test    \n=\n'
    <h1>Test    </h1>

While it doesn’t matter, I would expect the intended output to be:

    <h1>Test</h1>

And if not, well, then the above regexp could just as well be:

    ^(.+)\n=+[ \t]*\n+


_______________________________________________
Markdown-Discuss mailing list
[email protected]
http://six.pairlist.net/mailman/listinfo/markdown-discuss

Reply via email to