├── discount
├── VERSION
├── config.h
├── tests
│ ├── chrome.text
│ ├── embedlinks.text
│ ├── links.text
│ ├── style.t
│ ├── linkypix.t
│ ├── reparse.t
│ ├── para.t
│ ├── footnotes.t
│ ├── toc.t
│ ├── paranoia.t
│ ├── misc.t
│ ├── backslash.t
│ ├── code.t
│ ├── snakepit.t
│ ├── flow.t
│ ├── crash.t
│ ├── pseudo.t
│ ├── compat.t
│ ├── tabstop.t
│ ├── emphasis.t
│ ├── header.t
│ ├── autolink.t
│ ├── xml.t
│ ├── peculiarities.t
│ ├── dl.t
│ ├── list3deep.t
│ ├── pandoc.t
│ ├── div.t
│ ├── smarty.t
│ ├── automatic.t
│ ├── html.t
│ ├── tables.t
│ ├── list.t
│ ├── linkylinky.t
│ └── schiraldi.t
├── tools
│ ├── echo.c
│ └── cols.c
├── version.c.in
├── makepage.c
├── amalloc.h
├── README
├── Plan9
│ ├── mkfile
│ ├── README
│ ├── markdown.1
│ ├── markdown.2
│ └── markdown.6
├── docheader.c
├── mkd-line.3
├── Csio.c
├── xmlpage.c
├── CREDITS
├── css.c
├── INSTALL
├── xml.c
├── COPYRIGHT
├── toc.c
├── amalloc.c
├── cstring.h
├── mkdio.h
├── Makefile.in
├── markdown.1.in
├── markdown.3
├── theme.1
├── resource.c
├── dumptree.c
├── configure.sh
├── mkd2html.c
├── mkd-extensions.7
├── mkd-functions.3
├── main.c
├── markdown.h
├── mkdio.c
├── theme.c
└── markdown.c
├── README.md
├── Rakefile
├── compile.sh
└── down.ooc
/discount/VERSION:
--------------------------------------------------------------------------------
1 | 1.5.5
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Run it:
2 |
3 | ./compile.sh
4 | ./down
5 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | task :default do
2 | if system("./compile.sh")
3 | exec "./down"
4 | else
5 | puts :fail
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/discount/config.h:
--------------------------------------------------------------------------------
1 |
2 | /* rdiscount extension configuration */
3 |
4 | #undef USE_AMALLOC
5 |
6 | #define TABSTOP 4
7 | #define COINTOSS() (random()&1)
8 | #define INITRNG(x) srandom((unsigned int)x)
9 | #define RELAXED_EMPHASIS 1
10 |
--------------------------------------------------------------------------------
/discount/tests/chrome.text:
--------------------------------------------------------------------------------
1 | ->###chrome with my markdown###<-
2 |
3 | 1. `(c)` -> `©` (c)
4 | 2. `(r)` -> `®` (r)
5 | 3. `(tm)` -> `™` (tm)
6 | 4. `...` -> `…` ...
7 | 5. `--` -> `&emdash;` --
8 | 6. `-` -> `–` - (but not if it's between-words)
9 | 7. "fancy quoting"
10 | 8. 'fancy quoting (#2)'
11 | 9. don't do it unless it's a real quote.
12 | 10. `` (`) ``
13 |
14 |
--------------------------------------------------------------------------------
/discount/tests/embedlinks.text:
--------------------------------------------------------------------------------
1 | * [] (http://dustmite.org)
2 | * [[an embedded link](http://wontwork.org)](http://willwork.org)
3 | * [![dustmite][]] (http:/dustmite.org)
4 | * ![dustmite][]
5 | * ![dustmite][dustmite]
6 | * [cheat me](http://I.am.cheating)
7 |
8 | [dustmite]: http://dustmite.org/mite.jpg =25x25 "here I am!"
9 |
10 |
--------------------------------------------------------------------------------
/discount/tests/links.text:
--------------------------------------------------------------------------------
1 | 1. a a [a][] [b][]: hi [test](bad:protocol) AAA < `hi there ``hi there foo here.
'
35 |
36 | try 'single-line paragraph' 'a' 'b
34 |
34 |
36 | H1
37 |
38 | >' '`>`' '>`' '`` ` ``' '`
'
34 |
35 | try 'unclosed single backtick' '`hi there' 'this is
32 | code
33 | hi there
And how are you today?
' 34 | 35 | try 'two lists punctuated with a HR' \ 36 | '* A 37 | * * * 38 | * B 39 | * C' \ 40 | '[foo](id:bar)
' 30 | try '[](class:) links' '[foo](class:bar)' '' 31 | try -fnoext '[](class:) links with -fnoext' '[foo](class:bar)' '
[foo](class:bar)
' 32 | try '[](raw:) links' '[foo](raw:bar)' 'bar
' 33 | try -fnoext '[](raw:) links with -fnoext' '[foo](raw:bar)' '[foo](raw:bar)
' 34 | 35 | exit $rc 36 | -------------------------------------------------------------------------------- /down.ooc: -------------------------------------------------------------------------------- 1 | include ./mkdio 2 | 3 | // Down is our Markdown class. 4 | // Down new("some *markdown*!") toHtml() 5 | Down: class { 6 | html: String 7 | 8 | init: func(=html) {} 9 | 10 | toHtml: func -> String { 11 | res := String 12 | doc := mkd_string(html, html length(), 0) 13 | 14 | if (mkd_compile(doc, 0)) { 15 | mkd_document(doc, res&) 16 | return res 17 | } else { 18 | return "markdown failed" 19 | } 20 | } 21 | 22 | // Shortcut: 23 | // Down toHtml("*hi*") 24 | toHtml: static func ~classLevel ( html : String ) -> String { 25 | return new(html) toHtml() 26 | } 27 | } 28 | 29 | // Bits of Discount we want to use 30 | DiscountDoc: cover from MMIOT* 31 | mkd_string: extern func (text : String, length : Int, flags : Int) -> DiscountDoc 32 | mkd_compile: extern func (doc : DiscountDoc, flags : Int) -> Int 33 | mkd_document: extern func (doc : DiscountDoc, text : String*) -> Int 34 | 35 | main: func { 36 | Down toHtml("*hi*") println() 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /discount/docheader.c: -------------------------------------------------------------------------------- 1 | /* 2 | * docheader -- get values from the document header 3 | * 4 | * Copyright (C) 2007 David L Parsons. 5 | * The redistribution terms are provided in the COPYRIGHT file that must 6 | * be distributed with this source code. 7 | */ 8 | #include "config.h" 9 | #includethis is a test
' 32 | try -f1.0 'implicit reference links (-f1.0)' "$LINKY" '[this] is a test
' 33 | 34 | WSP=' ' 35 | WHITESPACE=" 36 | white space$WSP 37 | and more" 38 | 39 | try 'trailing whitespace' "$WHITESPACE" 'white space ''
40 | and more
41 | '
42 |
43 | try -f1.0 'trailing whitespace (-f1.0)' "$WHITESPACE" 'white space''
44 | and more
45 | '
46 |
47 | exit $rc
48 |
--------------------------------------------------------------------------------
/discount/tests/tabstop.t:
--------------------------------------------------------------------------------
1 | rc=0
2 | unset MARKDOWN_FLAGS
3 | unset MKD_TABSTOP
4 |
5 | try() {
6 | unset FLAGS
7 | case "$1" in
8 | -*) FLAGS=$1
9 | shift ;;
10 | esac
11 |
12 | ./echo -n " $1" '..................................' | ./cols 36
13 |
14 | Q=`./echo "$2" | ./markdown $FLAGS`
15 |
16 | if [ "$3" = "$Q" ]; then
17 | ./echo " ok"
18 | else
19 | ./echo " FAILED"
20 | ./echo "wanted: $3"
21 | ./echo "got : $Q"
22 | rc=1
23 | fi
24 | }
25 |
26 | eval `./markdown -V | tr ' ' '\n' | grep TAB`
27 |
28 | if [ "${TAB:-4}" -eq 8 ]; then
29 | ./echo "dealing with tabstop derangement"
30 |
31 | LIST='
32 | * A
33 | * B
34 | * C'
35 |
36 | try 'markdown with TAB=8' \
37 | "$LIST" \
38 | 'hi
' 29 | try '* -> *' 'A * A' 'A * A
' 30 | try -fstrict '***A**B*' '***A**B*' 'AB
' 31 | try -fstrict '***A*B**' '***A*B**' 'AB
' 32 | try -fstrict '**A*B***' '**A*B***' 'AB
' 33 | try -fstrict '*A**B***' '*A**B***' 'AB
' 34 | 35 | if ./markdown -V | grep RELAXED >/dev/null; then 36 | try -frelax '_A_B with -frelax' '_A_B' '_A_B
' 37 | try -fstrict '_A_B with -fstrict' '_A_B' 'AB
' 38 | fi 39 | 40 | exit $rc 41 | -------------------------------------------------------------------------------- /discount/tests/header.t: -------------------------------------------------------------------------------- 1 | ./echo "headers" 2 | 3 | rc=0 4 | MARKDOWN_FLAGS= 5 | 6 | try() { 7 | unset FLAGS 8 | case "$1" in 9 | -*) FLAGS=$1 10 | shift ;; 11 | esac 12 | 13 | S=`./echo -n "$1" '..................................' | ./cols 34` 14 | ./echo -n " $S " 15 | 16 | Q=`./echo "$2" | ./markdown $FLAGS` 17 | 18 | 19 | if [ "$3" = "$Q" ]; then 20 | ./echo "ok" 21 | else 22 | ./echo "FAILED" 23 | ./echo "wanted: $3" 24 | ./echo "got : $Q" 25 | rc=1 26 | fi 27 | } 28 | 29 | try 'single #' '#' '#
' 30 | try 'empty ETX' '##' 'http://www.pell.portland.or.us/~orc/Code/discount
' 29 | 30 | try -fautolink 'link surrounded by text' \ 31 | 'here http://it is?' \ 32 | 'here http://it is?
' 33 | 34 | try -fautolink 'naked @' '@' '@
' 35 | 36 | try -fautolink 'parenthesised (url)' \ 37 | '(http://here)' \ 38 | '' 39 | 40 | try -fautolink 'token with trailing @' 'orc@' 'orc@
' 41 | 42 | exit $rc 43 | -------------------------------------------------------------------------------- /discount/mkd-line.3: -------------------------------------------------------------------------------- 1 | .\" 2 | .Dd January 18, 2008 3 | .Dt MKD_LINE 3 4 | .Os Mastodon 5 | .Sh NAME 6 | .Nm mkd_line 7 | .Nd do Markdown translation of small items 8 | .Sh LIBRARY 9 | Markdown 10 | .Pq libmarkdown , -lmarkdown 11 | .Sh SYNOPSIS 12 | .Fd #include“hello,sailor”
' 33 | try -fnocdata '... from mkd_generateline()' -t'"hello,sailor"' '“hello,sailor”' 34 | 35 | try -fcdata 'xml output with multibyte utf-8' \ 36 | 'tecnología y servicios más confiables' \ 37 | '<p>tecnología y servicios más confiables</p>' 38 | 39 | exit $rc 40 | -------------------------------------------------------------------------------- /discount/tests/peculiarities.t: -------------------------------------------------------------------------------- 1 | ./echo "markup peculiarities" 2 | 3 | rc=0 4 | MARKDOWN_FLAGS= 5 | 6 | try() { 7 | unset FLAGS 8 | case "$1" in 9 | -*) FLAGS=$1 10 | shift ;; 11 | esac 12 | 13 | ./echo -n " $1" '..................................' | ./cols 36 14 | 15 | Q=`./echo "$2" | ./markdown $FLAGS` 16 | 17 | if [ "$3" = "$Q" ]; then 18 | ./echo " ok" 19 | else 20 | ./echo " FAILED" 21 | ./echo "wanted: $3" 22 | ./echo "got : $Q" 23 | rc=1 24 | fi 25 | } 26 | 27 | try 'list followed by header .......... ' \ 28 | " 29 | - AAA 30 | - BBB 31 | -" \ 32 | 'this
58 |
this
' 61 | try -fnohtml 'markdownfoo
62 |
=this=
58 | 59 |is an ugly
60 |
61 |
62 | =test=
63 | 64 |eh?
65 | '
66 |
67 | fi
68 |
69 | exit $rc
70 |
--------------------------------------------------------------------------------
/discount/Csio.c:
--------------------------------------------------------------------------------
1 | #include % title 38 | % author(s) 39 | % date
' 40 | 41 | try 'invalid header' \ 42 | '% title 43 | % author(s) 44 | a pony!' \ 45 | '% title 46 | % author(s) 47 | a pony!
' 48 | 49 | try 'offset header' \ 50 | ' 51 | % title 52 | % author(s) 53 | % date' \ 54 | '% title 55 | % author(s) 56 | % date
' 57 | 58 | try 'indented header' \ 59 | ' % title 60 | % author(s) 61 | % date' \ 62 | '% title 63 | % author(s) 64 | % date
' 65 | 66 | else 67 | 68 | try 'ignore headers' "$HEADER" '% title 69 | % author(s) 70 | % date
' 71 | 72 | fi 73 | 74 | exit $rc 75 | -------------------------------------------------------------------------------- /discount/tests/div.t: -------------------------------------------------------------------------------- 1 | ./markdown -V | grep DIV >/dev/null || exit 0 2 | 3 | ./echo "%div% blocks" 4 | 5 | rc=0 6 | MARKDOWN_FLAGS= 7 | 8 | try() { 9 | unset FLAGS 10 | case "$1" in 11 | -*) FLAGS=$1 12 | shift ;; 13 | esac 14 | 15 | ./echo -n " $1" '..................................' | ./cols 36 16 | 17 | Q=`./echo "$2" | ./markdown $FLAGS` 18 | 19 | 20 | if [ "$3" = "$Q" ]; then 21 | ./echo " ok" 22 | else 23 | ./echo " FAILED" 24 | ./echo "wanted: $3" 25 | ./echo "got : $Q" 26 | rc=1 27 | fi 28 | } 29 | 30 | try 'simple >%div% block' \ 31 | '>%this% 32 | this this' \ 33 | 'this this
this this
that that
this this
this this
that
more
©
' 30 | try '(r) -> ®' '(r)' '®
' 31 | try '(tm) -> ™' '(tm)' '™
' 32 | try '... -> …' '...' '…
' 33 | 34 | try '"--" -> —' '--' '—
' 35 | 36 | try '"-" -> –' 'regular -' 'regular –
' 37 | try 'A-B -> A-B' 'A-B' 'A-B
' 38 | try '"fancy" -> “fancy”' '"fancy"' '“fancy”
' 39 | try "'fancy'" "'fancy'" '‘fancy’
' 40 | try "don't -> don’t" "don't" 'don’t
' 41 | try "don't -> don’t" "don't" 'don’t
' 42 | try "it's -> it’s" "it's" 'it’s
' 43 | 44 | if ./markdown -V | grep SUPERSCRIPT >/dev/null; then 45 | try -frelax 'A^B -> AB (-frelax)' 'A^B' 'AB
' 46 | try -fstrict 'A^B != AB (-fstrict)' 'A^B' 'A^B
' 47 | try -frelax 'A^B in link title' '[link](here "A^B")' '' 48 | fi 49 | 50 | exit $rc 51 | -------------------------------------------------------------------------------- /discount/CREDITS: -------------------------------------------------------------------------------- 1 | Discount is primarily my work, but it has only reached the point 2 | where it is via contributions, critiques, and bug reports from a 3 | host of other people, some of which are listed before. If your 4 | name isn't on this list, please remind me 5 | -david parsons (orc@pell.chi.il.us) 6 | 7 | 8 | Josh Wood -- Plan9 support. 9 | Mike Schiraldi -- Reddit style automatic links, MANY MANY MANY 10 | bug reports about boundary conditions and 11 | places where I didn't get it right. 12 | Jjgod Jiang -- Table of contents support. 13 | Petite Abeille -- Many bug reports about places where I didn't 14 | get it right. 15 | Tim Channon -- inspiration for the `mkd_xhtmlpage()` function 16 | Christian Herenz-- Many bug reports regarding my implementation of 17 | `[]()` and `![]()` 18 | A.S.Bradbury -- Portability bug reports for 64 bit systems. 19 | Joyent -- Loan of a solaris box so I could get discount 20 | working under solaris. 21 | Ryan Tomayko -- Portability requests (and the rdiscount ruby 22 | binding.) 23 | yidabu -- feedback on the documentation, bug reports 24 | against utf-8 support. 25 | Pierre Joye -- bug reports, php discount binding. 26 | Masayoshi Sekimura- perl discount binding. 27 | Jeremy Hinegardner- bug reports about list handling. 28 | Andrew White -- bug reports about the format of generated urls. 29 | Steve Huff -- bug reports about Makefile portability (for Fink) 30 | Ignacio Burgue?o-- bug reports about `>%class%` 31 | Henrik Nyh -- bug reports about embedded html handling. 32 | 33 | 34 | -------------------------------------------------------------------------------- /discount/tests/automatic.t: -------------------------------------------------------------------------------- 1 | ./echo "automatic links" 2 | 3 | rc=0 4 | MARKDOWN_FLAGS= 5 | 6 | try() { 7 | unset FLAGS 8 | case "$1" in 9 | -*) FLAGS=$1 10 | shift ;; 11 | esac 12 | 13 | ./echo -n " $1" '..................................' | ./cols 36 14 | 15 | Q=`./echo "$2" | ./markdown $FLAGS` 16 | 17 | 18 | if [ "$3" = "$Q" ]; then 19 | ./echo " ok" 20 | else 21 | ./echo " FAILED" 22 | ./echo "wanted: $3" 23 | ./echo "got : $Q" 24 | rc=1 25 | fi 26 | } 27 | 28 | match() { 29 | ./echo -n " $1" '..................................' | ./cols 36 30 | 31 | if ./echo "$2" | ./markdown | grep "$3" >/dev/null; then 32 | ./echo " ok" 33 | else 34 | ./echo " FAILED" 35 | rc=1 36 | fi 37 | } 38 | 39 | try 'http url' '<orc@>
' 44 | try 'invalid <@pell>' '<@pell>' '<@pell>
' 45 | try 'invalid<orc@pell>
' 46 | try 'invalid<orc@.pell>
' 47 | try 'invalid<orc@pell.>
' 48 | match 'text
' 35 | 36 | try 'self-closing block tags (hr/)' \ 37 | 'text
' 44 | 45 | try 'self-closing block tags (br)' \ 46 | 'text
' 53 | 54 | try 'html comments' \ 55 | '' \ 58 | '' 61 | 62 | try 'no smartypants inside tags (#1)' \ 63 | '<b>hi!</b>
' 71 | try -fhtml 'allow html with -fhtml' 'hi!' 'hi!
' 72 | 73 | 74 | # check that nested raw html blocks terminate properly. 75 | # 76 | BLOCK1SRC='Markdown works fine *here*. 77 | 78 | *And* here. 79 | 80 |81 |
Markdown works fine here.
88 | 89 |And here.
90 | 91 |92 |
Markdown here is not parsed by RDiscount.
96 | 97 |Nor in this paragraph, and there are no paragraph breaks.
' 98 | 99 | try 'nested html blocks (1)' "$BLOCK1SRC" "$BLOCK1OUT" 100 | 101 | try 'nested html blocks (2)' \ 102 | '| 36 | | hello | 37 |
|---|---|
| 42 | | sailor | 43 |
| a | 57 |b | 58 |
|---|---|
| hello | 63 |sailor | 64 |
| a | 76 |b | 77 |c | 78 |
|---|---|---|
| hello | 83 |84 | | sailor | 85 |
| a | 99 |b | 100 |
|---|---|
| hello | 105 |106 | |
| 109 | | sailor | 110 |
| a | 123 |b | 124 |
|---|---|
| hello | 129 |sailor | 130 |
| a | 143 |b | 144 |
|---|---|
| hello | 149 |sailor|boy | 150 |
a|b 160 | –|– 161 | hello|sailor
' 162 | 163 | 164 | exit $rc 165 | -------------------------------------------------------------------------------- /discount/tests/list.t: -------------------------------------------------------------------------------- 1 | ./echo "lists" 2 | 3 | rc=0 4 | MARKDOWN_FLAGS= 5 | 6 | try() { 7 | unset FLAGS 8 | case "$1" in 9 | -*) FLAGS=$1 10 | shift ;; 11 | esac 12 | 13 | ./echo -n " $1" '..................................' | ./cols 36 14 | 15 | Q=`./echo "$2" | ./markdown $FLAGS` 16 | 17 | if [ "$3" = "$Q" ]; then 18 | ./echo " ok" 19 | else 20 | ./echo " FAILED" 21 | ./echo "wanted: $3" 22 | ./echo "got : $Q" 23 | rc=1 24 | fi 25 | } 26 | 27 | try 'two separated items' \ 28 | ' * A 29 | 30 | * B' \ 31 | 'A
B
space, the final frontier
' 57 | 58 | try 'nested lists (1)' \ 59 | ' * 1. Sub (list) 60 | 2. Two (items) 61 | 3. Here' \ 62 | 'A (list)
82 | 83 |Here
' 108 | 109 | try 'blockquote inside list' \ 110 | ' * A (list) 111 | 112 | > quote 113 | > me 114 | 115 | dont quote me' \ 116 | 'A (list)
101 | 102 |103 |
107 |- Sub (list)
104 |- Two (items)
105 |- Here
106 |
A (list)
118 | 119 |121 | 122 |quote 120 | me
dont quote me
[foo]
' 63 | 64 | try 'pseudo-protocol "id:"'\ 65 | '[foo](id:bar)' \ 66 | '' 67 | 68 | try 'pseudo-protocol "class:"' \ 69 | '[foo](class:bar)' \ 70 | '' 71 | 72 | try 'pseudo-protocol "abbr:"'\ 73 | '[foo](abbr:bar)' \ 74 | '
foo
' 75 | 76 | try 'nested [][]s' \ 77 | '[[z](y)](x)' \ 78 | '' 79 | 80 | try 'empty [][] tags' \ 81 | '[![][1]][2] 82 | 83 | [1]: image1 84 | [2]: image2' \ 85 | '' 86 | 87 | try 'footnote cuddled up to text' \ 88 | 'foo 89 | [bar]:bar' \ 90 | 'foo
' 91 | 92 | try 'mid-paragraph footnote' \ 93 | 'talk talk talk talk 94 | [bar]: bar 95 | talk talk talk talk' \ 96 | 'talk talk talk talk 97 | talk talk talk talk
' 98 | 99 | try 'mid-blockquote footnote' \ 100 | '>blockquote! 101 | [footnote]: here! 102 | >blockquote!' \ 103 | '' 105 | 106 | try 'end-blockquote footnote' \ 107 | '>blockquote! 108 | >blockquote! 109 | [footnote]: here!' \ 110 | 'blockquote! 104 | blockquote!
' 112 | 113 | try 'start-blockquote footnote' \ 114 | '[footnote]: here! 115 | >blockquote! 116 | >blockquote!' \ 117 | 'blockquote! 111 | blockquote!
' 119 | 120 | try '[text] (text) not a link' \ 121 | '[test] (me)' \ 122 | 'blockquote! 118 | blockquote!
[test] (me)
' 123 | 124 | exit $rc 125 | -------------------------------------------------------------------------------- /discount/resource.c: -------------------------------------------------------------------------------- 1 | /* markdown: a C implementation of John Gruber's Markdown markup language. 2 | * 3 | * Copyright (C) 2007 David L Parsons. 4 | * The redistribution terms are provided in the COPYRIGHT file that must 5 | * be distributed with this source code. 6 | */ 7 | #includefoo
30 |
#
' 43 | 44 | try -frelax '* processing with -frelax' \ 45 | '2*4 = 8 * 1 = 2**3' \ 46 | '2*4 = 8 * 1 = 2**3
' 47 | 48 | try -fnopants '[]() with a single quote mark' \ 49 | '[Poe'"'"'s law](http://rationalwiki.com/wiki/Poe'"'"'s_Law)' \ 50 | '' 51 | 52 | try -fautolink 'autolink url with escaped spaces' \ 53 | 'http://\(here\ I\ am\)' \ 54 | '' 55 | 56 | try -fautolink 'autolink café_racer' \ 57 | 'http://en.wikipedia.org/wiki/café_racer' \ 58 | 'http://en.wikipedia.org/wiki/caf%C3%A9_racer
' 59 | 60 | try -fautolink 'autolink url with arguments' \ 61 | 'http://foo.bar?a&b=c' \ 62 | '' 63 | 64 | try '\( escapes in []()' \ 65 | '[foo](http://a.com/\(foo\))' \ 66 | '' 67 | 68 | try -fautolink 'autolink url with escaped ()' \ 69 | 'http://a.com/\(foo\)' \ 70 | '' 71 | 72 | try -fautolink 'autolink url with escaped \' \ 73 | 'http://a.com/\\\)' \ 74 | '' 75 | 76 | try -fautolink 'autolink url with -' \ 77 | 'http://experts-exchange.com' \ 78 | '' 79 | 80 | try -fautolink 'autolink url with +' \ 81 | 'http://www67.wolframalpha.com/input/?i=how+old+was+jfk+jr+when+jfk+died' \ 82 | 'http://www67.wolframalpha.com/input/?i=how+old+was+jfk+jr+when+jfk+died
' 83 | 84 | try -fautolink 'autolink url with &' \ 85 | 'http://foo.bar?a&b=c' \ 86 | '' 87 | 88 | 89 | try -fautolink 'autolink url with ,' \ 90 | 'http://www.spiegel.de/international/europe/0,1518,626171,00.html' \ 91 | 'http://www.spiegel.de/international/europe/0,1518,626171,00.html
' 92 | 93 | try -fautolink 'autolink url with : & ;' \ 94 | 'http://www.biblegateway.com/passage/?search=Matthew%205:29-30;&version=31;' \ 95 | 'http://www.biblegateway.com/passage/?search=Matthew%205:29-30;&version=31;
' 96 | 97 | exit $rc 98 | -------------------------------------------------------------------------------- /discount/dumptree.c: -------------------------------------------------------------------------------- 1 | /* markdown: a C implementation of John Gruber's Markdown markup language. 2 | * 3 | * Copyright (C) 2007 David L Parsons. 4 | * The redistribution terms are provided in the COPYRIGHT file that must 5 | * be distributed with this source code. 6 | */ 7 | #include