[SVN] Revision 1203 (markdown)

Charilaos Skiadas cskiadas at uchicago.edu
Fri Jun 24 03:21:52 UTC 2005


On Jun 23, 2005, at 9:37 PM, hadley wickham wrote:

> If you look at test-minimal, you'll see _italic \_ _ is not italic.

According to the markdown syntax:
"But if you surround an * or _ with spaces, it’ll be treated as a  
literal asterisk or underscore."

So, according to this, the above example should NOT be italic. In  
fact, running "Markdown Preview" shows it to not be italic. That's  
the purpose of my regular expression, to fix this. Alas, as you point  
out, it does not work well with backslash escaping.

> I'm really not sure what you're trying to do with your regular
> expressions - they don't look like they would cope properly with
> backslash escaping (and indeed they don't)

The purpose of my expression is to consider as italic whatever is  
between "a star or underscore not followed by a space" and "the same  
symbol not preceded by a space or a backslash". Granted, it should be  
changed so that the first star or underscore is also not preceded by  
an odd number of backslashes and the second symbol is not preceded by  
an even number of backslashes, I did forget to take those into  
account. But the command was not working properly in the first place.  
So neither the original version nor my version are correct, as far as  
I understand. Please correct me if I am wrong.

> What was the problem you were trying to fix?

The problem was posted by Xavier Noria: http://thread.gmane.org/ 
gmane.editors.textmate.general/4601
This is his message:
>> Hello! Who is the maintainer of the bundle for Markdown? Looks  
>> like he is missing from the README in svn.
>>
>> I noticed the regexp for emphasis
>>
>>     match = "[*]([^\\\\*]|\\\\.)*?[*]";
>>
>> causes the engine to beautify the bulleted list
>>
>>     * normal *emph*.
>>
>> with " normal " in italics instead of "emph". Do those TM regexps  
>> support some sort of precedence? Do they supoprt look-behind  
>> assertions?
>>
>> In addition, the regexp for itemized lists looks too weak:
>>
>>     begin = "^\\s*[*+-]";
>>
>> According to the current spec it would be something like:
>>
>>     begin = "^ {0,3}[*+-][ \\t]";
>>
>> -- fxn

In my response, I said, among other things (referring to test- 
minimal.markdown):
>> Also in that file, the 4th line or so is:
>> _italic \_ _
>>
>> Now, if I understand correctly, this should not be italisized, right?

But got no responses, so I assumed, and still do, that this statement  
is right. At least markdown seems to think so.
> Hadley
>

Haris


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate-dev/attachments/20050623/789602e4/attachment.html>


More information about the textmate-dev mailing list