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
Added default image title, down to 2 failures.
timburks (author)
Tue Nov 06 17:23:54 -0800 2007
commit  c73dcfcd76d7dced8c800eba896beb471e8f1a79
tree    47281f5ddddf195bec11ef40edf2bfc4cdb66775
parent  3d49f6abe582f983d18f121a585925ec85b421bb
...
288
289
290
291
292
 
 
 
 
 
 
 
293
294
295
...
316
317
318
319
320
 
 
 
 
321
322
323
...
288
289
290
 
 
291
292
293
294
295
296
297
298
299
300
...
321
322
323
 
 
324
325
326
327
328
329
330
0
@@ -288,8 +288,13 @@
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_EncodeQuotes (markdown_EncodeItalicsAndBolds ($g_titles objectForKey:link_id))))
0
- (set result (result stringByAppendingString:" title=\"#{title}\"")))
0
+ (then (set title (markdown_EncodeQuotes (markdown_EncodeItalicsAndBolds ($g_titles objectForKey:link_id))))
0
+ (set result (result stringByAppendingString:" title=\"#{title}\"")))
0
+ ;; it seems like this else clause should be included
0
+ ;; but it breaks the MarkdownTests regressions
0
+ ;; which I think is a bug in Markdown.pl
0
+ ;;(else (set result (result stringByAppendingString:" title=\"\""))
0
+ )
0
            (set result (result stringByAppendingString:-" />"))
0
            (else (set result whole_match)))
0
        (str replaceOccurrencesOfString:whole_match withString:result)))
0
@@ -316,8 +321,10 @@
0
        (set url (m groupAtIndex:3))
0
        (set result "<img src=\"#{url}\" alt=\"#{alt_text}\"")
0
        (if (!= (m groupAtIndex:6) nil)
0
- (set title (markdown_EncodeQuotes (markdown_EncodeItalicsAndBolds (m groupAtIndex:6))))
0
- (set result (result stringByAppendingString:" title=\"#{title}\"")))
0
+ (then (set title (markdown_EncodeQuotes (markdown_EncodeItalicsAndBolds (m groupAtIndex:6))))
0
+ (set result (result stringByAppendingString:" title=\"#{title}\"")))
0
+ (else (set result (result stringByAppendingString:" title=\"\""))))
0
+
0
        (set result (result stringByAppendingString:-" />"))
0
        (str replaceOccurrencesOfString:whole_match withString:result)))
0
      str)

Comments

    No one has commented yet.