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 stripping of lines with only spaces and tabs.  3 failures left.
timburks (author)
Tue Nov 06 17:10:38 -0800 2007
commit  3d49f6abe582f983d18f121a585925ec85b421bb
tree    c66d8c97e7edd9d067fe8d96a37f36021599b461
parent  ce6cffabba535a235f21fdfa5981fa44bfeda97b
...
556
557
558
559
560
561
562
563
 
 
564
565
566
...
602
603
604
605
 
606
607
608
...
556
557
558
 
559
560
561
 
562
563
564
565
566
...
602
603
604
 
605
606
607
608
0
@@ -556,11 +556,11 @@
0
 (function markdown_FormParagraphs (str)
0
      (set str (/(\A\n+)|(\n+\z)/ replaceWithString:"" inString:str))
0
      (set paragraphs (/\n{2,}/ splitString:str))
0
-
0
      ; Wrap <p> tags
0
      (set paragraphs (paragraphs map:(do (paragraph)
0
                                          (unless ($g_html_blocks valueForKey:paragraph)
0
- (set paragraph (/^([ \t]*)/ replaceWithString:"<p>$1" inString:(markdown_RunSpanGamut paragraph)))
0
+
0
+ (set paragraph (/^([ \t]*)/ replaceWithString:"<p>" inString:(markdown_RunSpanGamut paragraph)))
0
                                                  (paragraph appendString:"</p>"))
0
                                          paragraph)))
0
      ; Unhashify HTML blocks
0
@@ -602,7 +602,7 @@
0
      ;; Convert tabs into 4 spaces
0
      (set str (markdown_Detab str))
0
      ;; Strip any lines consisting only of spaces and tabs.
0
- (set str (/^[ \t]+$/ replaceWithString:"" inString:str))
0
+ (set str (/^[ \t]+$/m replaceWithString:"" inString:str))
0
      ;; Turn block-level HTML blocks into hash entries
0
      (set str (markdown_HashHTMLBlocks str))
0
      ;; Strip link definitions, store in hashes.

Comments

    No one has commented yet.