Arc Forumnew | comments | leaders | submitlogin
Markdown improvements
8 points by sjs 6117 days ago | 1 comment
The Markdown parser is, er, barebones (to put it nicely). Starting to feel the need for regexes. Regardless, here's a crappy "patch" for markdown (app.arc:400-something) to parse [this style of link](url).

It should be obvious where these lines should be inserted:

                      (and (no nolinks)
                           (litmatch "[" s i)
                           (= e (pos #\] s (+ i 1)))
                           (is #\( (s (+ 1 e))))
                        (withs (txtstart (+ i 1)
                                txtend   (pos #\] s txtstart)
                                urlstart (+ 2 txtend)
                                urlend   (pos #\) s urlstart)
                                txt      (subseq s txtstart txtend)
                                url      (subseq s urlstart urlend))
                          (tag (a href url rel 'nofollow)
                               (pr txt))
                          (= i (+ 1 urlend)))
By all means, lets share our extensions to markdown and sooner or later we'll have a decent parser. The current "design" is going to get messy fast.


2 points by nex3 6117 days ago | link

I've added this to the Git and Subversion Anarkies. Very cool.

Also, there is regular expression support, if you're using the Anarki code.

-----