├── .hgignore ├── .hgtags ├── LICENSE ├── Makefile ├── README.md ├── cmd └── markdown │ ├── main.go │ └── pprof.go ├── doc.go ├── elemheap.go ├── markdown.go ├── markdown_test.go ├── misc ├── benchmark.rc ├── bmprepare.rc ├── c2go.sed ├── devel.mk ├── func-name2line.rc └── gofmt.rc ├── out-groffmm.go ├── output.go ├── parser.leg ├── parser.leg.go ├── portid └── tests ├── README.md ├── gen.rc ├── issues ├── footnotes-10.html ├── footnotes-10.mm └── footnotes-10.text └── md1.0.3 ├── Amps and angle encoding.html ├── Amps and angle encoding.mm ├── Amps and angle encoding.text ├── Auto links.html ├── Auto links.mm ├── Auto links.text ├── Backslash escapes.html ├── Backslash escapes.mm ├── Backslash escapes.text ├── Blockquotes with code blocks.html ├── Blockquotes with code blocks.mm ├── Blockquotes with code blocks.text ├── Code Blocks.html ├── Code Blocks.mm ├── Code Blocks.text ├── Code Spans.html ├── Code Spans.mm ├── Code Spans.text ├── Hard-wrapped paragraphs with list-like lines.html ├── Hard-wrapped paragraphs with list-like lines.mm ├── Hard-wrapped paragraphs with list-like lines.text ├── Horizontal rules.html ├── Horizontal rules.mm ├── Horizontal rules.text ├── Inline HTML (Advanced).html ├── Inline HTML (Advanced).mm ├── Inline HTML (Advanced).text ├── Inline HTML (Simple).html ├── Inline HTML (Simple).mm ├── Inline HTML (Simple).text ├── Inline HTML comments.html ├── Inline HTML comments.mm ├── Inline HTML comments.text ├── Links, inline style.mm ├── Links, reference style.mm ├── Links, shortcut references.mm ├── Literal quotes in titles.html ├── Literal quotes in titles.mm ├── Literal quotes in titles.text ├── Markdown Documentation - Basics.html ├── Markdown Documentation - Basics.mm ├── Markdown Documentation - Basics.text ├── Markdown Documentation - Syntax.html ├── Markdown Documentation - Syntax.mm ├── Markdown Documentation - Syntax.text ├── Nested blockquotes.html ├── Nested blockquotes.mm ├── Nested blockquotes.text ├── Ordered and unordered lists.html ├── Ordered and unordered lists.mm ├── Ordered and unordered lists.text ├── Strong and em together.html ├── Strong and em together.mm ├── Strong and em together.text ├── Tabs.html ├── Tabs.mm ├── Tabs.text ├── Tidyness.html ├── Tidyness.mm └── Tidyness.text /.hgignore: -------------------------------------------------------------------------------- 1 | # use glob syntax. 2 | syntax: glob 3 | 4 | parser.leg.go 5 | cmd/markdown 6 | orig-c-src 7 | core 8 | +* 9 | *.orig 10 | [58].* 11 | *.[58] 12 | ,* 13 | *~ 14 | [#]* 15 | -------------------------------------------------------------------------------- /.hgtags: -------------------------------------------------------------------------------- 1 | 967ded207024eabaabfc910339eb2f96220634f7 go.r58 2 | 8f1973a5e0863401f09c338b4a822310fd288fc8 go.r59 3 | 8f1973a5e0863401f09c338b4a822310fd288fc8 go.r60 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | markdown in Go, implemented using PEG grammar 2 | 3 | Copyright (c) 2010 Michael Teichgräber 4 | 5 | This is a translation of peg-markdown, written 6 | by John MacFarlane, into Go: 7 | 8 | Copyright (c) 2008 John MacFarlane 9 | 10 | peg-markdown is released under both the GPL and MIT licenses. 11 | You may pick the license that best fits your needs. 12 | 13 | The GPL 14 | 15 | This program is free software; you can redistribute it and/or modify 16 | it under the terms of the GNU General Public License as published by 17 | the Free Software Foundation; either version 2 of the License, or 18 | (at your option) any later version. 19 | 20 | This program is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | GNU General Public License for more details. 24 | 25 | You should have received a copy of the GNU General Public License 26 | along with this program; if not, write to the Free Software 27 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 28 | 29 | The MIT License 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy 32 | of this software and associated documentation files (the "Software"), to deal 33 | in the Software without restriction, including without limitation the rights 34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 35 | copies of the Software, and to permit persons to whom the Software is 36 | furnished to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in 39 | all copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 47 | THE SOFTWARE. 48 | 49 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 50 | 51 | peg (http://github.com/pointlander/peg), 52 | based on http://piumarta.com/software/peg/, 53 | written by Andrew J Snodgrass. 54 | 55 | Modifications to support LE grammars by Michael Teichgräber 56 | 57 | Copyright (c) 2010, Go Authors 58 | All rights reserved. 59 | 60 | Redistribution and use in source and binary forms, with or without modification, 61 | are permitted provided that the following conditions are met: 62 | * Redistributions of source code must retain the above copyright notice, 63 | this list of conditions and the following disclaimer. 64 | * Redistributions in binary form must reproduce the above copyright notice, 65 | this list of conditions and the following disclaimer in the documentation and/or 66 | other materials provided with the distribution. 67 | * Neither the name of the Go Authors nor the names of its contributors may be used to 68 | endorse or promote products derived from this software without specific prior written permission. 69 | 70 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 71 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 72 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 73 | THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 74 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 75 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 76 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 77 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 78 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 79 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @echo 'targets: nuke parser clean' 3 | 4 | cmd: package 5 | cd cmd/markdown && go build -v 6 | 7 | package: parser.leg.go 8 | go install -v 9 | 10 | clean: 11 | go clean . ./... 12 | rm -rf ,,prevmd ,,pmd 13 | 14 | parser: parser.leg.go 15 | 16 | nuke: 17 | rm -f parser.leg.go 18 | 19 | 20 | # LEG parser rules 21 | # 22 | ifeq ($(MAKECMDGOALS),parser) 23 | include $(shell go list -f '{{.Dir}}' github.com/knieriem/peg)/Make.inc 24 | %.leg.go: %.leg $(LEG) 25 | $(LEG) -verbose -switch -O all $< > $@ 26 | 27 | endif 28 | 29 | 30 | include misc/devel.mk 31 | 32 | .PHONY: \ 33 | all\ 34 | cmd\ 35 | nuke\ 36 | package\ 37 | parser\ 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is an implementation of John Gruber's [markdown][] in 2 | [Go][]. It is a translation of [peg-markdown][], written by 3 | John MacFarlane in C, into Go. It is using a modified version 4 | of Andrew J Snodgrass' PEG parser [peg][] -- now supporting 5 | LEG grammars --, which itself is based on the parser used 6 | by peg-markdown. 7 | 8 | [markdown]: http://daringfireball.net/projects/markdown/ 9 | [peg-markdown]: https://github.com/jgm/peg-markdown 10 | [peg]: https://github.com/pointlander/peg 11 | [Go]: http://golang.org/ 12 | 13 | Support for HTML and groff mm output is implemented, but LaTeX 14 | output has not been ported. The output is identical 15 | to that of peg-markdown. 16 | 17 | I try to keep the grammar in sync with the C version, by 18 | cherry-picking relevant changes. In the commit history the 19 | corresponding revisions have a suffix *[jgm/peg-markdown].* 20 | 21 | The Markdown parser has a performance similar to that of 22 | the original C version, and consumes less memory. 23 | 24 | ## Installation 25 | 26 | Provided you have a copy of Go 1, and git is available, 27 | 28 | go get github.com/knieriem/markdown 29 | 30 | should download and install the package according to 31 | your GOPATH settings. 32 | 33 | See doc.go for an example how to use the package. 34 | 35 | --- 36 | 37 | To create the command line program *markdown,* run 38 | 39 | go build github.com/knieriem/markdown/cmd/markdown 40 | 41 | the binary should then be available in the current directory. 42 | 43 | To run tests, type 44 | 45 | go test github.com/knieriem/markdown 46 | 47 | At the moment, tests are based on the .text files from the 48 | Markdown 1.0.3 test suite created by John Gruber, [imported from 49 | peg-markdown][testsuite]. The output of the conversion of these 50 | .text files to html is compared to the output of peg-markdown. 51 | 52 | [testsuite]: https://github.com/jgm/peg-markdown/tree/master/MarkdownTest_1.0.3 53 | 54 | ## Development 55 | 56 | There is not yet a way to create a Go source file like 57 | `parser.leg.go` automatically from another file, `parser.leg`, 58 | when building packages and commands using the Go tool. To make 59 | *markdown* installable using `go get`, `parser.leg.go` has 60 | been added to the VCS. 61 | 62 | `Make parser` will update `parser.leg.go` using `leg` – which 63 | is part of [knieriem/peg][] at github –, if parser.leg has 64 | been changed, or if the Go file is missing. If a copy of *peg* 65 | is not yet present on your system, run 66 | 67 | go get github.com/knieriem/peg 68 | 69 | Then `make parser` should succeed. 70 | 71 | [knieriem/peg]: https://github.com/knieriem/peg 72 | 73 | 74 | ## Extensions 75 | 76 | In addition to the extensions already present in peg-markdown, 77 | this package also supports definition lists (option `-dlists`) 78 | similar to the way they are described in the documentation of 79 | [PHP Markdown Extra][]. 80 | 81 | Definitions (`
").str(elt.contents.str).s("
")
191 | case HTML:
192 | s = elt.contents.str
193 | case LINK:
194 | o := w.obfuscate
195 | if strings.Index(elt.contents.link.url, "mailto:") == 0 {
196 | w.obfuscate = true /* obfuscate mailto: links */
197 | }
198 | w.s(` 0 {
200 | w.s(` title="`).str(elt.contents.link.title).s(`"`)
201 | }
202 | w.s(">").elist(elt.contents.link.label).s("")
203 | w.obfuscate = o
204 | case IMAGE:
205 | w.s(`", elt) 229 | case HRULE: 230 | w.sp().s("
").str(elt.contents.str).s("
")
235 | case BULLETLIST:
236 | w.listBlock("\n").skipPadding().children(elt).br().s("") 249 | case REFERENCE: 250 | /* Nonprinting */ 251 | case NOTE: 252 | /* if contents.str == 0, then print note; else ignore, since this 253 | * is a note block that has been incorporated into the notes list 254 | */ 255 | if elt.contents.str == "" { 256 | w.endNotes = append(w.endNotes, elt) /* add an endnote to global endnotes list */ 257 | w.notenum++ 258 | nn := w.notenum 259 | s = fmt.Sprintf(`[%d]`, 260 | nn, nn, nn, nn) 261 | } 262 | default: 263 | log.Fatalf("htmlOut.elem encountered unknown element key = %d\n", elt.key) 264 | } 265 | if s != "" { 266 | w.s(s) 267 | } 268 | return w 269 | } 270 | 271 | func (w *htmlOut) printEndnotes() { 272 | extraNewline := func() { 273 | // add an extra newline to maintain 274 | // compatibility with the C version. 275 | w.padded-- 276 | } 277 | 278 | counter := 0 279 | 280 | w.s("
Here is a footnote reference,[1] and another.[2]
2 | 3 |This paragraph won't be part of the note, because it 4 | isn't indented.
5 | 6 |Here is the footnote.
[back] 11 |Here's one with multiple blocks.
15 | 16 |Subsequent paragraphs are indented to show that they 17 | belong to the previous footnote.
18 | 19 |{ some.code }
20 |
21 |
22 | The whole paragraph can be indented, or just the first 23 | line. In this way, multi-paragraph footnotes work like 24 | multi-paragraph list items.
[back] 25 |AT&T has an ampersand in their name.
2 | 3 |AT&T is another way to write it.
4 | 5 |This & that.
6 | 7 |4 < 5.
8 | 9 |6 > 5.
10 | 11 |Here's a link with an ampersand in the URL.
12 | 13 |Here's a link with an amersand in the link text: AT&T.
14 | 15 |Here's an inline link.
16 | 17 |Here's an inline link.
18 | -------------------------------------------------------------------------------- /tests/md1.0.3/Amps and angle encoding.mm: -------------------------------------------------------------------------------- 1 | .P 2 | AT&T has an ampersand in their name. 3 | .P 4 | ATT is another way to write it. 5 | .P 6 | This & that. 7 | .P 8 | 4 < 5. 9 | .P 10 | 6 > 5. 11 | .P 12 | Here's a link (http://example.com/?foo=1&bar=2) with an ampersand in the URL. 13 | .P 14 | Here's a link with an amersand in the link text: AT&T (http://att.com/)\[char46] 15 | .P 16 | Here's an inline link (/script?foo=1&bar=2)\[char46] 17 | .P 18 | Here's an inline link (/script?foo=1&bar=2)\[char46] 19 | -------------------------------------------------------------------------------- /tests/md1.0.3/Amps and angle encoding.text: -------------------------------------------------------------------------------- 1 | AT&T has an ampersand in their name. 2 | 3 | AT&T is another way to write it. 4 | 5 | This & that. 6 | 7 | 4 < 5. 8 | 9 | 6 > 5. 10 | 11 | Here's a [link] [1] with an ampersand in the URL. 12 | 13 | Here's a link with an amersand in the link text: [AT&T] [2]. 14 | 15 | Here's an inline [link](/script?foo=1&bar=2). 16 | 17 | Here's an inline [link](). 18 | 19 | 20 | [1]: http://example.com/?foo=1&bar=2 21 | [2]: http://att.com/ "AT&T" -------------------------------------------------------------------------------- /tests/md1.0.3/Auto links.html: -------------------------------------------------------------------------------- 1 |Link: http://example.com/.
2 | 3 |With an ampersand: http://example.com/?foo=1&bar=2
4 | 5 |12 |14 | 15 |Blockquoted: http://example.com/
13 |
Auto-links should not occur here: <http://example.com/>
or here: <http://example.com/>
18 |
19 |
--------------------------------------------------------------------------------
/tests/md1.0.3/Auto links.mm:
--------------------------------------------------------------------------------
1 | .P
2 | Link: http://example.com/ (http://example.com/)\[char46]
3 | .P
4 | With an ampersand: http://example.com/?foo=1&bar=2 (http://example.com/?foo=1&bar=2)
5 | .BL
6 | .LI
7 | In a list?
8 | .LI
9 | http://example.com/ (http://example.com/)
10 | .LI
11 | It should.
12 | .LE 1
13 | .DS I
14 | .P
15 | Blockquoted: http://example.com/ (http://example.com/)
16 | .DE
17 | .P
18 | Auto-links should not occur here: \fCThese should all get escaped:
2 | 3 |Backslash: \
4 | 5 |Backtick: `
6 | 7 |Asterisk: *
8 | 9 |Underscore: _
10 | 11 |Left brace: {
12 | 13 |Right brace: }
14 | 15 |Left bracket: [
16 | 17 |Right bracket: ]
18 | 19 |Left paren: (
20 | 21 |Right paren: )
22 | 23 |Greater-than: >
24 | 25 |Hash: #
26 | 27 |Period: .
28 | 29 |Bang: !
30 | 31 |Plus: +
32 | 33 |Minus: -
34 | 35 |These should not, because they occur within a code block:
36 | 37 |Backslash: \\
38 |
39 | Backtick: \`
40 |
41 | Asterisk: \*
42 |
43 | Underscore: \_
44 |
45 | Left brace: \{
46 |
47 | Right brace: \}
48 |
49 | Left bracket: \[
50 |
51 | Right bracket: \]
52 |
53 | Left paren: \(
54 |
55 | Right paren: \)
56 |
57 | Greater-than: \>
58 |
59 | Hash: \#
60 |
61 | Period: \.
62 |
63 | Bang: \!
64 |
65 | Plus: \+
66 |
67 | Minus: \-
68 |
69 |
70 | Nor should these, which occur in code spans:
71 | 72 |Backslash: \\
Backtick: \`
Asterisk: \*
Underscore: \_
Left brace: \{
Right brace: \}
Left bracket: \[
Right bracket: \]
Left paren: \(
Right paren: \)
Greater-than: \>
Hash: \#
Period: \.
Bang: \!
Plus: \+
Minus: \-
These should get escaped, even though they're matching pairs for 105 | other Markdown constructs:
106 | 107 |*asterisks*
108 | 109 |_underscores_
110 | 111 |`backticks`
112 | 113 |This is a code span with a literal backslash-backtick sequence: \`
This is a tag with unescaped backticks bar.
116 | 117 |This is a tag with backslashes bar.
118 | -------------------------------------------------------------------------------- /tests/md1.0.3/Backslash escapes.mm: -------------------------------------------------------------------------------- 1 | .P 2 | These should all get escaped: 3 | .P 4 | Backslash: \e 5 | .P 6 | Backtick: ` 7 | .P 8 | Asterisk: * 9 | .P 10 | Underscore: _ 11 | .P 12 | Left brace: { 13 | .P 14 | Right brace: } 15 | .P 16 | Left bracket: [ 17 | .P 18 | Right bracket: ] 19 | .P 20 | Left paren: ( 21 | .P 22 | Right paren: ) 23 | .P 24 | Greater-than: > 25 | .P 26 | Hash: # 27 | .P 28 | Period: \[char46] 29 | .P 30 | Bang: ! 31 | .P 32 | Plus: + 33 | .P 34 | Minus: - 35 | .P 36 | These should not, because they occur within a code block: 37 | .VERBON 2 38 | Backslash: \e\e 39 | 40 | Backtick: \e` 41 | 42 | Asterisk: \e* 43 | 44 | Underscore: \e_ 45 | 46 | Left brace: \e{ 47 | 48 | Right brace: \e} 49 | 50 | Left bracket: \e[ 51 | 52 | Right bracket: \e] 53 | 54 | Left paren: \e( 55 | 56 | Right paren: \e) 57 | 58 | Greater-than: \e> 59 | 60 | Hash: \e# 61 | 62 | Period: \e. 63 | 64 | Bang: \e! 65 | 66 | Plus: \e+ 67 | 68 | Minus: \e- 69 | .VERBOFF 70 | .P 71 | Nor should these, which occur in code spans: 72 | .P 73 | Backslash: \fC\e\e\fR 74 | .P 75 | Backtick: \fC\e`\fR 76 | .P 77 | Asterisk: \fC\e*\fR 78 | .P 79 | Underscore: \fC\e_\fR 80 | .P 81 | Left brace: \fC\e{\fR 82 | .P 83 | Right brace: \fC\e}\fR 84 | .P 85 | Left bracket: \fC\e[\fR 86 | .P 87 | Right bracket: \fC\e]\fR 88 | .P 89 | Left paren: \fC\e(\fR 90 | .P 91 | Right paren: \fC\e)\fR 92 | .P 93 | Greater-than: \fC\e>\fR 94 | .P 95 | Hash: \fC\e#\fR 96 | .P 97 | Period: \fC\e.\fR 98 | .P 99 | Bang: \fC\e!\fR 100 | .P 101 | Plus: \fC\e+\fR 102 | .P 103 | Minus: \fC\e-\fR 104 | .P 105 | These should get escaped, even though they're matching pairs for 106 | other Markdown constructs: 107 | .P 108 | *asterisks* 109 | .P 110 | _underscores_ 111 | .P 112 | `backticks` 113 | .P 114 | This is a code span with a literal backslash-backtick sequence: \fC\e`\fR 115 | .P 116 | This is a tag with unescaped backticks bar\[char46] 117 | .P 118 | This is a tag with backslashes bar\[char46] 119 | -------------------------------------------------------------------------------- /tests/md1.0.3/Backslash escapes.text: -------------------------------------------------------------------------------- 1 | These should all get escaped: 2 | 3 | Backslash: \\ 4 | 5 | Backtick: \` 6 | 7 | Asterisk: \* 8 | 9 | Underscore: \_ 10 | 11 | Left brace: \{ 12 | 13 | Right brace: \} 14 | 15 | Left bracket: \[ 16 | 17 | Right bracket: \] 18 | 19 | Left paren: \( 20 | 21 | Right paren: \) 22 | 23 | Greater-than: \> 24 | 25 | Hash: \# 26 | 27 | Period: \. 28 | 29 | Bang: \! 30 | 31 | Plus: \+ 32 | 33 | Minus: \- 34 | 35 | 36 | 37 | These should not, because they occur within a code block: 38 | 39 | Backslash: \\ 40 | 41 | Backtick: \` 42 | 43 | Asterisk: \* 44 | 45 | Underscore: \_ 46 | 47 | Left brace: \{ 48 | 49 | Right brace: \} 50 | 51 | Left bracket: \[ 52 | 53 | Right bracket: \] 54 | 55 | Left paren: \( 56 | 57 | Right paren: \) 58 | 59 | Greater-than: \> 60 | 61 | Hash: \# 62 | 63 | Period: \. 64 | 65 | Bang: \! 66 | 67 | Plus: \+ 68 | 69 | Minus: \- 70 | 71 | 72 | Nor should these, which occur in code spans: 73 | 74 | Backslash: `\\` 75 | 76 | Backtick: `` \` `` 77 | 78 | Asterisk: `\*` 79 | 80 | Underscore: `\_` 81 | 82 | Left brace: `\{` 83 | 84 | Right brace: `\}` 85 | 86 | Left bracket: `\[` 87 | 88 | Right bracket: `\]` 89 | 90 | Left paren: `\(` 91 | 92 | Right paren: `\)` 93 | 94 | Greater-than: `\>` 95 | 96 | Hash: `\#` 97 | 98 | Period: `\.` 99 | 100 | Bang: `\!` 101 | 102 | Plus: `\+` 103 | 104 | Minus: `\-` 105 | 106 | 107 | These should get escaped, even though they're matching pairs for 108 | other Markdown constructs: 109 | 110 | \*asterisks\* 111 | 112 | \_underscores\_ 113 | 114 | \`backticks\` 115 | 116 | This is a code span with a literal backslash-backtick sequence: `` \` `` 117 | 118 | This is a tag with unescaped backticks bar. 119 | 120 | This is a tag with backslashes bar. 121 | -------------------------------------------------------------------------------- /tests/md1.0.3/Blockquotes with code blocks.html: -------------------------------------------------------------------------------- 1 |2 |16 | -------------------------------------------------------------------------------- /tests/md1.0.3/Blockquotes with code blocks.mm: -------------------------------------------------------------------------------- 1 | .DS I 2 | .P 3 | Example: 4 | .VERBON 2 5 | sub status { 6 | print "working"; 7 | } 8 | .VERBOFF 9 | .P 10 | Or: 11 | .VERBON 2 12 | sub status { 13 | return "working"; 14 | } 15 | .VERBOFF 16 | .DE 17 | -------------------------------------------------------------------------------- /tests/md1.0.3/Blockquotes with code blocks.text: -------------------------------------------------------------------------------- 1 | > Example: 2 | > 3 | > sub status { 4 | > print "working"; 5 | > } 6 | > 7 | > Or: 8 | > 9 | > sub status { 10 | > return "working"; 11 | > } 12 | -------------------------------------------------------------------------------- /tests/md1.0.3/Code Blocks.html: -------------------------------------------------------------------------------- 1 |Example:
3 | 4 |8 | 9 |sub status { 5 | print "working"; 6 | } 7 |
Or:
10 | 11 |15 |sub status { 12 | return "working"; 13 | } 14 |
code block on the first line
2 |
3 |
4 | Regular text.
5 | 6 |code block indented by spaces
7 |
8 |
9 | Regular text.
10 | 11 |the lines in this block
12 | all contain trailing spaces
13 |
14 |
15 | Regular Text.
16 | 17 |code block on the last line
18 |
19 |
--------------------------------------------------------------------------------
/tests/md1.0.3/Code Blocks.mm:
--------------------------------------------------------------------------------
1 | .VERBON 2
2 | code block on the first line
3 | .VERBOFF
4 | .P
5 | Regular text.
6 | .VERBON 2
7 | code block indented by spaces
8 | .VERBOFF
9 | .P
10 | Regular text.
11 | .VERBON 2
12 | the lines in this block
13 | all contain trailing spaces
14 | .VERBOFF
15 | .P
16 | Regular Text.
17 | .VERBON 2
18 | code block on the last line
19 | .VERBOFF
20 |
--------------------------------------------------------------------------------
/tests/md1.0.3/Code Blocks.text:
--------------------------------------------------------------------------------
1 | code block on the first line
2 |
3 | Regular text.
4 |
5 | code block indented by spaces
6 |
7 | Regular text.
8 |
9 | the lines in this block
10 | all contain trailing spaces
11 |
12 | Regular Text.
13 |
14 | code block on the last line
--------------------------------------------------------------------------------
/tests/md1.0.3/Code Spans.html:
--------------------------------------------------------------------------------
1 | <test a="
content of attribute ">
Fix for backticks within HTML tag: like this
4 | 5 |Here's how you put `backticks`
in a code span.
In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked like a 5 | list item.
6 | 7 |Here's one with a bullet. 8 | * criminey.
9 | -------------------------------------------------------------------------------- /tests/md1.0.3/Hard-wrapped paragraphs with list-like lines.mm: -------------------------------------------------------------------------------- 1 | .P 2 | In Markdown 1.0.0 and earlier. Version 3 | 8. This line turns into a list item. 4 | Because a hard-wrapped line in the 5 | middle of a paragraph looked like a 6 | list item. 7 | .P 8 | Here's one with a bullet. 9 | * criminey. 10 | -------------------------------------------------------------------------------- /tests/md1.0.3/Hard-wrapped paragraphs with list-like lines.text: -------------------------------------------------------------------------------- 1 | In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked like a 5 | list item. 6 | 7 | Here's one with a bullet. 8 | * criminey. 9 | -------------------------------------------------------------------------------- /tests/md1.0.3/Horizontal rules.html: -------------------------------------------------------------------------------- 1 |Dashes:
2 | 3 |---
12 |
13 |
14 | - - -
23 |
24 |
25 | Asterisks:
26 | 27 |***
36 |
37 |
38 | * * *
47 |
48 |
49 | Underscores:
50 | 51 |___
60 |
61 |
62 | _ _ _
71 |
72 |
--------------------------------------------------------------------------------
/tests/md1.0.3/Horizontal rules.mm:
--------------------------------------------------------------------------------
1 | .P
2 | Dashes:
3 | \l'\n(.lu*8u/10u'
4 | \l'\n(.lu*8u/10u'
5 | \l'\n(.lu*8u/10u'
6 | \l'\n(.lu*8u/10u'
7 | .VERBON 2
8 | ---
9 | .VERBOFF
10 | \l'\n(.lu*8u/10u'
11 | \l'\n(.lu*8u/10u'
12 | \l'\n(.lu*8u/10u'
13 | \l'\n(.lu*8u/10u'
14 | .VERBON 2
15 | - - -
16 | .VERBOFF
17 | .P
18 | Asterisks:
19 | \l'\n(.lu*8u/10u'
20 | \l'\n(.lu*8u/10u'
21 | \l'\n(.lu*8u/10u'
22 | \l'\n(.lu*8u/10u'
23 | .VERBON 2
24 | ***
25 | .VERBOFF
26 | \l'\n(.lu*8u/10u'
27 | \l'\n(.lu*8u/10u'
28 | \l'\n(.lu*8u/10u'
29 | \l'\n(.lu*8u/10u'
30 | .VERBON 2
31 | * * *
32 | .VERBOFF
33 | .P
34 | Underscores:
35 | \l'\n(.lu*8u/10u'
36 | \l'\n(.lu*8u/10u'
37 | \l'\n(.lu*8u/10u'
38 | \l'\n(.lu*8u/10u'
39 | .VERBON 2
40 | ___
41 | .VERBOFF
42 | \l'\n(.lu*8u/10u'
43 | \l'\n(.lu*8u/10u'
44 | \l'\n(.lu*8u/10u'
45 | \l'\n(.lu*8u/10u'
46 | .VERBON 2
47 | _ _ _
48 | .VERBOFF
49 |
--------------------------------------------------------------------------------
/tests/md1.0.3/Horizontal rules.text:
--------------------------------------------------------------------------------
1 | Dashes:
2 |
3 | ---
4 |
5 | ---
6 |
7 | ---
8 |
9 | ---
10 |
11 | ---
12 |
13 | - - -
14 |
15 | - - -
16 |
17 | - - -
18 |
19 | - - -
20 |
21 | - - -
22 |
23 |
24 | Asterisks:
25 |
26 | ***
27 |
28 | ***
29 |
30 | ***
31 |
32 | ***
33 |
34 | ***
35 |
36 | * * *
37 |
38 | * * *
39 |
40 | * * *
41 |
42 | * * *
43 |
44 | * * *
45 |
46 |
47 | Underscores:
48 |
49 | ___
50 |
51 | ___
52 |
53 | ___
54 |
55 | ___
56 |
57 | ___
58 |
59 | _ _ _
60 |
61 | _ _ _
62 |
63 | _ _ _
64 |
65 | _ _ _
66 |
67 | _ _ _
68 |
--------------------------------------------------------------------------------
/tests/md1.0.3/Inline HTML (Advanced).html:
--------------------------------------------------------------------------------
1 | Simple block on one line:
2 | 3 |And nested without indentation:
6 | 7 |Here's a simple block:
2 | 3 |This should be a code block, though:
8 | 9 |<div>
10 | foo
11 | </div>
12 |
13 |
14 | As should this:
15 | 16 |<div>foo</div>
17 |
18 |
19 | Now, nested:
20 | 21 |This should just be an HTML comment:
30 | 31 | 32 | 33 |Multiline:
34 | 35 | 39 | 40 |Code block:
41 | 42 |<!-- Comment -->
43 |
44 |
45 | Just plain comment, with trailing spaces on the line:
46 | 47 | 48 | 49 |Code:
50 | 51 |<hr />
52 |
53 |
54 | Hr's:
55 | 56 |Paragraph one.
2 | 3 | 4 | 5 | 8 | 9 |Paragraph two.
10 | 11 | 12 | 13 |The end.
14 | -------------------------------------------------------------------------------- /tests/md1.0.3/Inline HTML comments.mm: -------------------------------------------------------------------------------- 1 | .P 2 | Paragraph one. 3 | .P 4 | Paragraph two. 5 | .P 6 | The end. 7 | -------------------------------------------------------------------------------- /tests/md1.0.3/Inline HTML comments.text: -------------------------------------------------------------------------------- 1 | Paragraph one. 2 | 3 | 4 | 5 | 8 | 9 | Paragraph two. 10 | 11 | 12 | 13 | The end. 14 | -------------------------------------------------------------------------------- /tests/md1.0.3/Links, inline style.mm: -------------------------------------------------------------------------------- 1 | .P 2 | Just a URL (/url/)\[char46] 3 | .P 4 | URL and title (/url/)\[char46] 5 | .P 6 | URL and title (/url/)\[char46] 7 | .P 8 | URL and title (/url/)\[char46] 9 | .P 10 | URL and title (/url/)\[char46] 11 | .P 12 | Empty ()\[char46] 13 | -------------------------------------------------------------------------------- /tests/md1.0.3/Links, reference style.mm: -------------------------------------------------------------------------------- 1 | .P 2 | Foo bar (/url/)\[char46] 3 | .P 4 | Foo bar (/url/)\[char46] 5 | .P 6 | Foo bar (/url/)\[char46] 7 | .P 8 | With embedded [brackets] (/url/)\[char46] 9 | .P 10 | Indented once (/url)\[char46] 11 | .P 12 | Indented twice (/url)\[char46] 13 | .P 14 | Indented thrice (/url)\[char46] 15 | .P 16 | Indented [four][] times. 17 | .VERBON 2 18 | [four]: /url 19 | .VERBOFF 20 | \l'\n(.lu*8u/10u' 21 | .P 22 | this (foo) should work 23 | .P 24 | So should this (foo)\[char46] 25 | .P 26 | And this (foo)\[char46] 27 | .P 28 | And this (foo)\[char46] 29 | .P 30 | And this (foo)\[char46] 31 | .P 32 | But not [that] []\[char46] 33 | .P 34 | Nor [that][]\[char46] 35 | .P 36 | Nor [that]\[char46] 37 | .P 38 | [Something in brackets like this (foo) should work] 39 | .P 40 | [Same with this (foo)\[char46]] 41 | .P 42 | In this case, this (/somethingelse/) points to something else. 43 | .P 44 | Backslashing should suppress [this] and [this]\[char46] 45 | \l'\n(.lu*8u/10u' 46 | .P 47 | Here's one where the link 48 | breaks (/url/) across lines. 49 | .P 50 | Here's another where the link 51 | breaks (/url/) across lines, but with a line-ending space. 52 | -------------------------------------------------------------------------------- /tests/md1.0.3/Links, shortcut references.mm: -------------------------------------------------------------------------------- 1 | .P 2 | This is the simple case (/simple)\[char46] 3 | .P 4 | This one has a line 5 | break (/foo)\[char46] 6 | .P 7 | This one has a line 8 | break (/foo) with a line-ending space. 9 | .P 10 | this (/that) and the other (/other) 11 | -------------------------------------------------------------------------------- /tests/md1.0.3/Literal quotes in titles.html: -------------------------------------------------------------------------------- 1 |Foo bar.
2 | 3 |Foo bar.
4 | -------------------------------------------------------------------------------- /tests/md1.0.3/Literal quotes in titles.mm: -------------------------------------------------------------------------------- 1 | .P 2 | Foo bar (/url/)\[char46] 3 | .P 4 | Foo bar (/url/)\[char46] 5 | -------------------------------------------------------------------------------- /tests/md1.0.3/Literal quotes in titles.text: -------------------------------------------------------------------------------- 1 | Foo [bar][]. 2 | 3 | Foo [bar](/url/ "Title with "quotes" inside"). 4 | 5 | 6 | [bar]: /url/ "Title with "quotes" inside" 7 | 8 | -------------------------------------------------------------------------------- /tests/md1.0.3/Markdown Documentation - Basics.html: -------------------------------------------------------------------------------- 1 |This page offers a brief overview of what it's like to use Markdown. 14 | The syntax page provides complete, detailed documentation for 15 | every feature, but Markdown should be very easy to pick up simply by 16 | looking at a few examples of it in action. The examples on this page 17 | are written in a before/after style, showing example syntax and the 18 | HTML output produced by Markdown.
19 | 20 |It's also helpful to simply try Markdown out; the Dingus is a 21 | web application that allows you type your own Markdown-formatted text 22 | and translate it to XHTML.
23 | 24 |Note: This document is itself written using Markdown; you 25 | can see the source for it by adding '.text' to the URL.
26 | 27 |A paragraph is simply one or more consecutive lines of text, separated 30 | by one or more blank lines. (A blank line is any line that looks like a 31 | blank line -- a line containing nothing spaces or tabs is considered 32 | blank.) Normal paragraphs should not be intended with spaces or tabs.
33 | 34 |Markdown offers two styles of headers: Setext and atx.
35 | Setext-style headers for <h1>
and <h2>
are created by
36 | "underlining" with equal signs (=
) and hyphens (-
), respectively.
37 | To create an atx-style header, you put 1-6 hash marks (#
) at the
38 | beginning of the line -- the number of hashes equals the resulting
39 | HTML header level.
Blockquotes are indicated using email-style '>
' angle brackets.
Markdown:
44 | 45 |A First Level Header
46 | ====================
47 |
48 | A Second Level Header
49 | ---------------------
50 |
51 | Now is the time for all good men to come to
52 | the aid of their country. This is just a
53 | regular paragraph.
54 |
55 | The quick brown fox jumped over the lazy
56 | dog's back.
57 |
58 | ### Header 3
59 |
60 | > This is a blockquote.
61 | >
62 | > This is the second paragraph in the blockquote.
63 | >
64 | > ## This is an H2 in a blockquote
65 |
66 |
67 | Output:
68 | 69 |<h1>A First Level Header</h1>
70 |
71 | <h2>A Second Level Header</h2>
72 |
73 | <p>Now is the time for all good men to come to
74 | the aid of their country. This is just a
75 | regular paragraph.</p>
76 |
77 | <p>The quick brown fox jumped over the lazy
78 | dog's back.</p>
79 |
80 | <h3>Header 3</h3>
81 |
82 | <blockquote>
83 | <p>This is a blockquote.</p>
84 |
85 | <p>This is the second paragraph in the blockquote.</p>
86 |
87 | <h2>This is an H2 in a blockquote</h2>
88 | </blockquote>
89 |
90 |
91 | Markdown uses asterisks and underscores to indicate spans of emphasis.
94 | 95 |Markdown:
96 | 97 |Some of these words *are emphasized*.
98 | Some of these words _are emphasized also_.
99 |
100 | Use two asterisks for **strong emphasis**.
101 | Or, if you prefer, __use two underscores instead__.
102 |
103 |
104 | Output:
105 | 106 |<p>Some of these words <em>are emphasized</em>.
107 | Some of these words <em>are emphasized also</em>.</p>
108 |
109 | <p>Use two asterisks for <strong>strong emphasis</strong>.
110 | Or, if you prefer, <strong>use two underscores instead</strong>.</p>
111 |
112 |
113 | Unordered (bulleted) lists use asterisks, pluses, and hyphens (*
,
116 | +
, and -
) as list markers. These three markers are
117 | interchangable; this:
* Candy.
120 | * Gum.
121 | * Booze.
122 |
123 |
124 | this:
125 | 126 |+ Candy.
127 | + Gum.
128 | + Booze.
129 |
130 |
131 | and this:
132 | 133 |- Candy.
134 | - Gum.
135 | - Booze.
136 |
137 |
138 | all produce the same output:
139 | 140 |<ul>
141 | <li>Candy.</li>
142 | <li>Gum.</li>
143 | <li>Booze.</li>
144 | </ul>
145 |
146 |
147 | Ordered (numbered) lists use regular numbers, followed by periods, as 148 | list markers:
149 | 150 |1. Red
151 | 2. Green
152 | 3. Blue
153 |
154 |
155 | Output:
156 | 157 |<ol>
158 | <li>Red</li>
159 | <li>Green</li>
160 | <li>Blue</li>
161 | </ol>
162 |
163 |
164 | If you put blank lines between items, you'll get <p>
tags for the
165 | list item text. You can create multi-paragraph list items by indenting
166 | the paragraphs by 4 spaces or 1 tab:
* A list item.
169 |
170 | With multiple paragraphs.
171 |
172 | * Another item in the list.
173 |
174 |
175 | Output:
176 | 177 |<ul>
178 | <li><p>A list item.</p>
179 | <p>With multiple paragraphs.</p></li>
180 | <li><p>Another item in the list.</p></li>
181 | </ul>
182 |
183 |
184 | Markdown supports two styles for creating links: inline and 187 | reference. With both styles, you use square brackets to delimit the 188 | text you want to turn into a link.
189 | 190 |Inline-style links use parentheses immediately after the link text. 191 | For example:
192 | 193 |This is an [example link](http://example.com/).
194 |
195 |
196 | Output:
197 | 198 |<p>This is an <a href="http://example.com/">
199 | example link</a>.</p>
200 |
201 |
202 | Optionally, you may include a title attribute in the parentheses:
203 | 204 |This is an [example link](http://example.com/ "With a Title").
205 |
206 |
207 | Output:
208 | 209 |<p>This is an <a href="http://example.com/" title="With a Title">
210 | example link</a>.</p>
211 |
212 |
213 | Reference-style links allow you to refer to your links by names, which 214 | you define elsewhere in your document:
215 | 216 |I get 10 times more traffic from [Google][1] than from
217 | [Yahoo][2] or [MSN][3].
218 |
219 | [1]: http://google.com/ "Google"
220 | [2]: http://search.yahoo.com/ "Yahoo Search"
221 | [3]: http://search.msn.com/ "MSN Search"
222 |
223 |
224 | Output:
225 | 226 |<p>I get 10 times more traffic from <a href="http://google.com/"
227 | title="Google">Google</a> than from <a href="http://search.yahoo.com/"
228 | title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
229 | title="MSN Search">MSN</a>.</p>
230 |
231 |
232 | The title attribute is optional. Link names may contain letters, 233 | numbers and spaces, but are not case sensitive:
234 | 235 |I start my morning with a cup of coffee and
236 | [The New York Times][NY Times].
237 |
238 | [ny times]: http://www.nytimes.com/
239 |
240 |
241 | Output:
242 | 243 |<p>I start my morning with a cup of coffee and
244 | <a href="http://www.nytimes.com/">The New York Times</a>.</p>
245 |
246 |
247 | Image syntax is very much like link syntax.
250 | 251 |Inline (titles are optional):
252 | 253 |
254 |
255 |
256 | Reference-style:
257 | 258 |![alt text][id]
259 |
260 | [id]: /path/to/img.jpg "Title"
261 |
262 |
263 | Both of the above examples produce the same output:
264 | 265 |<img src="/path/to/img.jpg" alt="alt text" title="Title" />
266 |
267 |
268 | In a regular paragraph, you can create code span by wrapping text in
271 | backtick quotes. Any ampersands (&
) and angle brackets (<
or
272 | >
) will automatically be translated into HTML entities. This makes
273 | it easy to use Markdown to write about HTML example code:
I strongly recommend against using any `<blink>` tags.
276 |
277 | I wish SmartyPants used named entities like `—`
278 | instead of decimal-encoded entites like `—`.
279 |
280 |
281 | Output:
282 | 283 |<p>I strongly recommend against using any
284 | <code><blink></code> tags.</p>
285 |
286 | <p>I wish SmartyPants used named entities like
287 | <code>&mdash;</code> instead of decimal-encoded
288 | entites like <code>&#8212;</code>.</p>
289 |
290 |
291 | To specify an entire block of pre-formatted code, indent every line of
292 | the block by 4 spaces or 1 tab. Just like with code spans, &
, <
,
293 | and >
characters will be escaped automatically.
Markdown:
296 | 297 |If you want your page to validate under XHTML 1.0 Strict,
298 | you've got to put paragraph tags in your blockquotes:
299 |
300 | <blockquote>
301 | <p>For example.</p>
302 | </blockquote>
303 |
304 |
305 | Output:
306 | 307 |<p>If you want your page to validate under XHTML 1.0 Strict,
308 | you've got to put paragraph tags in your blockquotes:</p>
309 |
310 | <pre><code><blockquote>
311 | <p>For example.</p>
312 | </blockquote>
313 | </code></pre>
314 |
315 |
--------------------------------------------------------------------------------
/tests/md1.0.3/Markdown Documentation - Basics.mm:
--------------------------------------------------------------------------------
1 | .H 1 "Markdown: Basics"
2 | .H 2 "Getting the Gist of Markdown's Formatting Syntax"
3 | .P
4 | This page offers a brief overview of what it's like to use Markdown.
5 | The syntax page (/projects/markdown/syntax) provides complete, detailed documentation for
6 | every feature, but Markdown should be very easy to pick up simply by
7 | looking at a few examples of it in action. The examples on this page
8 | are written in a before/after style, showing example syntax and the
9 | HTML output produced by Markdown.
10 | .P
11 | It's also helpful to simply try Markdown out; the Dingus (/projects/markdown/dingus) is a
12 | web application that allows you type your own Markdown-formatted text
13 | and translate it to XHTML.
14 | .P
15 | \fBNote:\fR This document is itself written using Markdown; you
16 | can see the source for it by adding '\[char46]text' to the URL (/projects/markdown/basics.text)\[char46]
17 | .H 2 "Paragraphs, Headers, Blockquotes"
18 | .P
19 | A paragraph is simply one or more consecutive lines of text, separated
20 | by one or more blank lines. (A blank line is any line that looks like a
21 | blank line -- a line containing nothing spaces or tabs is considered
22 | blank.) Normal paragraphs should not be intended with spaces or tabs.
23 | .P
24 | Markdown offers two styles of headers: \fISetext\fR and \fIatx\fR\[char46]
25 | Setext-style headers for \fCNow is the time for all good men to come to 64 | the aid of their country. This is just a 65 | regular paragraph.
66 | 67 |The quick brown fox jumped over the lazy 68 | dog's back.
69 | 70 |73 |79 | .VERBOFF 80 | .H 3 "Phrase Emphasis" 81 | .P 82 | Markdown uses asterisks and underscores to indicate spans of emphasis. 83 | .P 84 | Markdown: 85 | .VERBON 2 86 | Some of these words *are emphasized*. 87 | Some of these words _are emphasized also_. 88 | 89 | Use two asterisks for **strong emphasis**. 90 | Or, if you prefer, __use two underscores instead__. 91 | .VERBOFF 92 | .P 93 | Output: 94 | .VERBON 2 95 |This is a blockquote.
74 | 75 |This is the second paragraph in the blockquote.
76 | 77 |This is an H2 in a blockquote
78 |
Some of these words are emphasized. 96 | Some of these words are emphasized also.
97 | 98 |Use two asterisks for strong emphasis. 99 | Or, if you prefer, use two underscores instead.
100 | .VERBOFF 101 | .H 2 "Lists" 102 | .P 103 | Unordered (bulleted) lists use asterisks, pluses, and hyphens (\fC*\fR, 104 | \fC+\fR, and \fC-\fR) as list markers. These three markers are 105 | interchangable; this: 106 | .VERBON 2 107 | * Candy. 108 | * Gum. 109 | * Booze. 110 | .VERBOFF 111 | .P 112 | this: 113 | .VERBON 2 114 | + Candy. 115 | + Gum. 116 | + Booze. 117 | .VERBOFF 118 | .P 119 | and this: 120 | .VERBON 2 121 | - Candy. 122 | - Gum. 123 | - Booze. 124 | .VERBOFF 125 | .P 126 | all produce the same output: 127 | .VERBON 2 128 |\fR tags for the 153 | list item text. You can create multi-paragraph list items by indenting 154 | the paragraphs by 4 spaces or 1 tab: 155 | .VERBON 2 156 | * A list item. 157 | 158 | With multiple paragraphs. 159 | 160 | * Another item in the list. 161 | .VERBOFF 162 | .P 163 | Output: 164 | .VERBON 2 165 |
A list item.
167 |With multiple paragraphs.
Another item in the list.
This is an 186 | example link.
187 | .VERBOFF 188 | .P 189 | Optionally, you may include a title attribute in the parentheses: 190 | .VERBON 2 191 | This is an [example link](http://example.com/ "With a Title"). 192 | .VERBOFF 193 | .P 194 | Output: 195 | .VERBON 2 196 |This is an 197 | example link.
198 | .VERBOFF 199 | .P 200 | Reference-style links allow you to refer to your links by names, which 201 | you define elsewhere in your document: 202 | .VERBON 2 203 | I get 10 times more traffic from [Google][1] than from 204 | [Yahoo][2] or [MSN][3]. 205 | 206 | [1]: http://google.com/ "Google" 207 | [2]: http://search.yahoo.com/ "Yahoo Search" 208 | [3]: http://search.msn.com/ "MSN Search" 209 | .VERBOFF 210 | .P 211 | Output: 212 | .VERBON 2 213 |I get 10 times more traffic from Google than from Yahoo or MSN.
217 | .VERBOFF 218 | .P 219 | The title attribute is optional. Link names may contain letters, 220 | numbers and spaces, but are \fInot\fR case sensitive: 221 | .VERBON 2 222 | I start my morning with a cup of coffee and 223 | [The New York Times][NY Times]. 224 | 225 | [ny times]: http://www.nytimes.com/ 226 | .VERBOFF 227 | .P 228 | Output: 229 | .VERBON 2 230 |I start my morning with a cup of coffee and 231 | The New York Times.
232 | .VERBOFF 233 | .H 3 "Images" 234 | .P 235 | Image syntax is very much like link syntax. 236 | .P 237 | Inline (titles are optional): 238 | .VERBON 2 239 |  240 | .VERBOFF 241 | .P 242 | Reference-style: 243 | .VERBON 2 244 | ![alt text][id] 245 | 246 | [id]: /path/to/img.jpg "Title" 247 | .VERBOFF 248 | .P 249 | Both of the above examples produce the same output: 250 | .VERBON 2 251 |