public
Description: Markdown processing with Nu. Use with any Nu or Objective-C project. Created by Grayson Hansard.
Homepage: http://programming.nu/posts/2007/10/10/markdown-in-nu
Clone URL: git://github.com/timburks/numarkdown.git
Fixed quoting of double quotes in image tags, down to 5 failures.
timburks (author)
Tue Nov 06 16:39:38 -0800 2007
commit  ce6cffabba535a235f21fdfa5981fa44bfeda97b
tree    8f5e4c8247c3ad4493cd3cd414391468c1e34d50
parent  0ded74f2e7a154abf31d4d49880202c083deb294
...
288
289
290
291
292
293
 
 
294
295
296
297
 
298
299
300
...
350
351
352
353
 
354
355
356
357
 
358
359
360
...
288
289
290
 
 
 
291
292
293
 
 
 
294
295
296
297
...
347
348
349
 
350
351
352
 
 
353
354
355
356
0
@@ -288,13 +288,10 @@
0
            (set url (markdown_EncodeItalicsAndBolds ($g_urls objectForKey:link_id)))
0
            (set result "<img src=\"#{url}\" alt=\"#{alt_text}\"")
0
            (if (!= ($g_titles valueForKey:link_id) nil)
0
- (set title (markdown_EncodeItalicsAndBolds ($g_titles objectForKey:link_id)))
0
- (set result (result stringByAppendingString:" title=\"#{title}\""))
0
- )
0
+ (set title (markdown_EncodeQuotes (markdown_EncodeItalicsAndBolds ($g_titles objectForKey:link_id))))
0
+ (set result (result stringByAppendingString:" title=\"#{title}\"")))
0
            (set result (result stringByAppendingString:-" />"))
0
- (else
0
- (set result whole_match)
0
- ))
0
+ (else (set result whole_match)))
0
        (str replaceOccurrencesOfString:whole_match withString:result)))
0
      ; Next, handle inline images: ![alt text](url -"optional title")
0
      (((eregex <<-END
0
@@ -350,11 +347,10 @@
0
            (set url (markdown_EncodeItalicsAndBolds ($g_urls valueForKey:link_id)))
0
            (set result "<a href=\"#{url}\"")
0
            (if (!= ($g_titles valueForKey:link_id) nil)
0
- (set title (markdown_EncodeItalicsAndBolds ($g_titles valueForKey:link_id)))
0
+ (set title (markdown_EncodeQuotes (markdown_EncodeItalicsAndBolds ($g_titles valueForKey:link_id))))
0
                (set result (result stringByAppendingString:" title=\"#{title}\"")))
0
            (set result (result stringByAppendingString:-">#{link_text}</a>"))
0
- (else
0
- (set result whole_match)))
0
+ (else (set result whole_match)))
0
        (str replaceOccurrencesOfString:whole_match withString:result)))
0
      
0
      ; Next, inline-style links: [link text](url -"optional title")

Comments

    No one has commented yet.