Fwd: [SVN] Revision 1203 (markdown)

Charilaos Skiadas skiadas at math.uchicago.edu
Fri Jun 24 04:54:22 UTC 2005


Oops, sorry, meant to send it to the list, not just Hadley.

Begin forwarded message:

> From: Charilaos Skiadas <cskiadas at uchicago.edu>
> Date: June 23, 2005 11:50:14 PM CDT
> To: hadley wickham <h.wickham at gmail.com>
> Subject: Re: [SVN] Revision 1203 (markdown)
>
>
>
> On Jun 23, 2005, at 11:05 PM, hadley wickham wrote:
>> That's odd because when I run markdown preview it is italic -  
>> however,
>> this seems to be because they're all in one paragraph.  I've split
>> each out into it's own paragraph to make this clearer.  I've also
>> changed _italic \_ _ to _italic\__ to make the test case work (and
>> match the bold example).  I've also added another test case to
>> demonstrate _ surrounded by space.
>
> Yes, what happens is that in
>
> _italic \_ _
> *italic__*
>
> the first underscore starts a search for emphasis. The second  
> underscore is escaped, so does not matter. The third underscore has  
> a space before it, so it is not considered as closing emphasis (I  
> think the markdown documentation has a typo there, it should  
> probably say "the opening emphasis is not followed by a space, and  
> the closing emphasis is not preceded by a space" ). The search  
> continues, and if finds the next underscore, which is valid, and  
> hence closes it. The next underscore is just printed as is, since  
> there is no closing underscore. Compare it with this:
> _italic \_ _
> *italic__*
> italic_
>
> in which case, the last underscore finds its match.
>
>> Yes, neither version is correct, so obviously we need to create a
>> regexp that works for both.  The first step in fixing this is to
>> improve the test case (which I'll commit shortly) so we can fix it
>> without breaking anything else.  I also believe that combine the two
>> forms into one regular expression achieves little but making it more
>> complicated.
>
> Yes, I agree. Allan's suggestion does indeed fix the backslashes in  
> the front, if you want to opt for that. I'll leave the decisions to  
> you, you are probably more familiar with the bundle and with  
> markdown, and at the moment I don't even have access to the  
> repository, because my hard-drive died and after replacing it I  
> haven't restored everything to its original condition. So I can't  
> see at this time your changes to the test file, but here are some  
> suggestions: First off, leave one empty line between cases, so that  
> trailing underscores don't get confused with the next case. Empty  
> lines will prompt markdown to break paragraphs, and hence stop the  
> search for emphasis. So for instance:
> _not italic
>
> not end italic_
>
> _italic
> end italic_
>
> Here are some backslashes examples:
>
> \\\\_italic\\_
>
> \\\\_not italic\_
>
> \\\_not italic\\_
>
> \\\\_italic\\_
>
> \\\\_italic\\\_\\\\_
>
> In general, the test was lacking examples of things that are NOT as  
> expected, IMHO. I'd be happy to contribute with more examples if it  
> is helpful.
>
>> Hadley
>>
>
> Charilaos Skiadas
> Department of Mathematics
> University of Chicago
>

Haris


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


More information about the textmate-dev mailing list