maruku 0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. data/bin/maruku +25 -0
  2. data/bin/marutex +29 -0
  3. data/docs/Makefile +25 -0
  4. data/docs/char_codes.xml +884 -0
  5. data/docs/color-package-demo.aux +1 -0
  6. data/docs/color-package-demo.log +127 -0
  7. data/docs/color-package-demo.tex +149 -0
  8. data/docs/index.html +74 -0
  9. data/docs/markdown_syntax.aux +13 -0
  10. data/docs/markdown_syntax.html +266 -0
  11. data/docs/markdown_syntax.log +287 -0
  12. data/docs/markdown_syntax.md +920 -0
  13. data/docs/markdown_syntax.out +0 -0
  14. data/docs/markdown_syntax.pdf +0 -0
  15. data/docs/markdown_syntax.tex +1203 -0
  16. data/docs/maruku.aux +13 -0
  17. data/docs/maruku.html +74 -0
  18. data/docs/maruku.log +294 -0
  19. data/docs/maruku.md +394 -0
  20. data/docs/maruku.out +0 -0
  21. data/docs/maruku.pdf +0 -0
  22. data/docs/maruku.tex +548 -0
  23. data/docs/style.css +65 -0
  24. data/docs/todo.md +12 -0
  25. data/lib/maruku.rb +20 -0
  26. data/lib/maruku/parse_block.rb +577 -0
  27. data/lib/maruku/parse_span.rb +336 -0
  28. data/lib/maruku/string_utils.rb +270 -0
  29. data/lib/maruku/structures.rb +31 -0
  30. data/lib/maruku/to_html.rb +430 -0
  31. data/lib/maruku/to_latex.rb +345 -0
  32. data/lib/maruku/to_latex_strings.rb +330 -0
  33. data/tests/abbreviations.md +11 -0
  34. data/tests/blank.md +4 -0
  35. data/tests/code.md +5 -0
  36. data/tests/code2.md +8 -0
  37. data/tests/code3.md +16 -0
  38. data/tests/email.md +4 -0
  39. data/tests/entities.md +19 -0
  40. data/tests/escaping.md +14 -0
  41. data/tests/extra_dl.md +101 -0
  42. data/tests/extra_header_id.md +13 -0
  43. data/tests/extra_table1.md +40 -0
  44. data/tests/footnotes.md +17 -0
  45. data/tests/headers.md +10 -0
  46. data/tests/hrule.md +10 -0
  47. data/tests/images.md +20 -0
  48. data/tests/inline_html.md +35 -0
  49. data/tests/links.md +31 -0
  50. data/tests/list1.md +4 -0
  51. data/tests/list2.md +5 -0
  52. data/tests/list3.md +8 -0
  53. data/tests/lists.md +32 -0
  54. data/tests/lists_ol.md +39 -0
  55. data/tests/misc_sw.md +105 -0
  56. data/tests/one.md +1 -0
  57. data/tests/paragraphs.md +13 -0
  58. data/tests/sss06.md +352 -0
  59. data/tests/test.md +4 -0
  60. metadata +113 -0
@@ -0,0 +1,287 @@
1
+ This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=pdflatex 2005.12.27) 25 DEC 2006 16:35
2
+ entering extended mode
3
+ **./markdown_syntax
4
+ (./markdown_syntax.tex
5
+ LaTeX2e <2003/12/01>
6
+ Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
7
+ ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
8
+ stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
9
+ h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
10
+ kish, ukrainian, nohyphenation, loaded.
11
+ (/sw/share/texmf-dist/tex/latex/base/article.cls
12
+ Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
13
+ (/sw/share/texmf-dist/tex/latex/base/size10.clo
14
+ File: size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
15
+ )
16
+ \c@part=\count79
17
+ \c@section=\count80
18
+ \c@subsection=\count81
19
+ \c@subsubsection=\count82
20
+ \c@paragraph=\count83
21
+ \c@subparagraph=\count84
22
+ \c@figure=\count85
23
+ \c@table=\count86
24
+ \abovecaptionskip=\skip41
25
+ \belowcaptionskip=\skip42
26
+ \bibindent=\dimen102
27
+ )
28
+ (/sw/share/texmf-dist/tex/latex/listings/listings.sty
29
+ (/sw/share/texmf-dist/tex/latex/graphics/keyval.sty
30
+ Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
31
+ \KV@toks@=\toks14
32
+ )
33
+ \lst@mode=\count87
34
+ \lst@gtempboxa=\box26
35
+ \lst@token=\toks15
36
+ \lst@length=\count88
37
+ \lst@currlwidth=\dimen103
38
+ \lst@column=\count89
39
+ \lst@pos=\count90
40
+ \lst@lostspace=\dimen104
41
+ \lst@width=\dimen105
42
+ \lst@newlines=\count91
43
+ \lst@lineno=\count92
44
+ \c@lstlisting=\count93
45
+ \lst@maxwidth=\dimen106
46
+
47
+ (/sw/share/texmf-dist/tex/latex/listings/lstpatch.sty
48
+ File: lstpatch.sty 2004/10/17 1.3b (Carsten Heinz)
49
+ )
50
+ (/sw/share/texmf-dist/tex/latex/listings/lstmisc.sty
51
+ File: lstmisc.sty 2004/09/07 1.3 (Carsten Heinz)
52
+ \c@lstnumber=\count94
53
+ \lst@skipnumbers=\count95
54
+ \lst@framebox=\box27
55
+ )
56
+ (/sw/share/texmf-dist/tex/latex/listings/listings.cfg
57
+ File: listings.cfg 2004/09/05 1.3 listings configuration
58
+ ))
59
+ Package: listings 2004/10/17 1.3b (Carsten Heinz)
60
+
61
+ (/sw/share/texmf-dist/tex/latex/hyperref/hyperref.sty
62
+ Package: hyperref 2003/11/30 v6.74m Hypertext links for LaTeX
63
+ \@linkdim=\dimen107
64
+ \Hy@linkcounter=\count96
65
+ \Hy@pagecounter=\count97
66
+
67
+ (/sw/share/texmf-dist/tex/latex/hyperref/pd1enc.def
68
+ File: pd1enc.def 2003/11/30 v6.74m Hyperref: PDFDocEncoding definition (HO)
69
+ )
70
+ (/sw/share/texmf-dist/tex/latex/hyperref/hyperref.cfg
71
+ File: hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive and teTeX
72
+ )
73
+ Package hyperref Info: Hyper figures OFF on input line 1880.
74
+ Package hyperref Info: Link nesting OFF on input line 1885.
75
+ Package hyperref Info: Hyper index ON on input line 1888.
76
+ Package hyperref Info: Plain pages ON on input line 1893.
77
+ Package hyperref Info: Backreferencing OFF on input line 1900.
78
+
79
+ Implicit mode ON; LaTeX internals redefined
80
+ Package hyperref Info: Bookmarks ON on input line 2004.
81
+ (/sw/share/texmf-local/tex/latex/html/url.sty
82
+ Package: url 1999/03/02 ver 1.4 Verb mode for urls, email addresses, and file
83
+ names
84
+ )
85
+ LaTeX Info: Redefining \url on input line 2143.
86
+ \Fld@menulength=\count98
87
+ \Field@Width=\dimen108
88
+ \Fld@charsize=\dimen109
89
+ \Choice@toks=\toks16
90
+ \Field@toks=\toks17
91
+ Package hyperref Info: Hyper figures OFF on input line 2618.
92
+ Package hyperref Info: Link nesting OFF on input line 2623.
93
+ Package hyperref Info: Hyper index ON on input line 2626.
94
+ Package hyperref Info: backreferencing OFF on input line 2633.
95
+ Package hyperref Info: Link coloring OFF on input line 2638.
96
+ \c@Item=\count99
97
+ \c@Hfootnote=\count100
98
+ )
99
+ *hyperref using default driver hpdftex*
100
+ (/sw/share/texmf-dist/tex/latex/hyperref/hpdftex.def
101
+ File: hpdftex.def 2003/11/30 v6.74m Hyperref driver for pdfTeX
102
+
103
+ (/sw/share/texmf-dist/tex/latex/psnfss/pifont.sty
104
+ Package: pifont 2004/09/15 PSNFSS-v9.2 Pi font support (SPQR)
105
+ LaTeX Font Info: Try loading font information for U+pzd on input line 63.
106
+
107
+ (/sw/share/texmf-dist/tex/latex/psnfss/upzd.fd
108
+ File: upzd.fd 2001/06/04 font definitions for U/pzd.
109
+ )
110
+ LaTeX Font Info: Try loading font information for U+psy on input line 64.
111
+
112
+ (/sw/share/texmf-dist/tex/latex/psnfss/upsy.fd
113
+ File: upsy.fd 2001/06/04 font definitions for U/psy.
114
+ ))
115
+ \Fld@listcount=\count101
116
+ \@outlinefile=\write3
117
+ )
118
+ (/sw/share/texmf-dist/tex/latex/graphics/color.sty
119
+ Package: color 1999/02/16 v1.0i Standard LaTeX Color (DPC)
120
+
121
+ (/sw/share/texmf-dist/tex/latex/graphics/color.cfg
122
+ File: color.cfg 2005/02/03 v1.3 color configuration of teTeX/TeXLive
123
+ )
124
+ Package color Info: Driver file: pdftex.def on input line 125.
125
+
126
+ (/sw/share/texmf-dist/tex/latex/graphics/pdftex.def
127
+ File: pdftex.def 2002/06/19 v0.03k graphics/color for pdftex
128
+ \Gread@gobject=\count102
129
+ )
130
+ (/sw/share/texmf-dist/tex/latex/graphics/dvipsnam.def
131
+ File: dvipsnam.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
132
+ ))
133
+ Package hyperref Info: Option `colorlinks' set `true' on input line 8.
134
+ (./markdown_syntax.aux)
135
+ \openout1 = `markdown_syntax.aux'.
136
+
137
+ LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9.
138
+ LaTeX Font Info: ... okay on input line 9.
139
+ LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9.
140
+ LaTeX Font Info: ... okay on input line 9.
141
+ LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9.
142
+ LaTeX Font Info: ... okay on input line 9.
143
+ LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9.
144
+ LaTeX Font Info: ... okay on input line 9.
145
+ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9.
146
+ LaTeX Font Info: ... okay on input line 9.
147
+ LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9.
148
+ LaTeX Font Info: ... okay on input line 9.
149
+ LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 9.
150
+ LaTeX Font Info: ... okay on input line 9.
151
+ Package hyperref Info: Link coloring ON on input line 9.
152
+ (/sw/share/texmf-dist/tex/latex/hyperref/nameref.sty
153
+ Package: nameref 2003/12/03 v2.21 Cross-referencing by name of section
154
+ \c@section@level=\count103
155
+ )
156
+ LaTeX Info: Redefining \ref on input line 9.
157
+ LaTeX Info: Redefining \pageref on input line 9.
158
+ (./markdown_syntax.out)
159
+ (./markdown_syntax.out)
160
+ \openout3 = `markdown_syntax.out'.
161
+
162
+ (/sw/share/texmf-dist/tex/context/base/supp-pdf.tex
163
+ (/sw/share/texmf-dist/tex/context/base/supp-mis.tex
164
+ loading : Context Support Macros / Miscellaneous (2004.10.26)
165
+ \protectiondepth=\count104
166
+ \scratchcounter=\count105
167
+ \scratchtoks=\toks18
168
+ \scratchdimen=\dimen110
169
+ \scratchskip=\skip43
170
+ \scratchmuskip=\muskip10
171
+ \scratchbox=\box28
172
+ \scratchread=\read1
173
+ \scratchwrite=\write4
174
+ \zeropoint=\dimen111
175
+ \onepoint=\dimen112
176
+ \onebasepoint=\dimen113
177
+ \minusone=\count106
178
+ \thousandpoint=\dimen114
179
+ \onerealpoint=\dimen115
180
+ \emptytoks=\toks19
181
+ \nextbox=\box29
182
+ \nextdepth=\dimen116
183
+ \everyline=\toks20
184
+ \!!counta=\count107
185
+ \!!countb=\count108
186
+ \recursecounter=\count109
187
+ )
188
+ loading : Context Support Macros / PDF (2004.03.26)
189
+ \nofMPsegments=\count110
190
+ \nofMParguments=\count111
191
+ \MPscratchCnt=\count112
192
+ \MPscratchDim=\dimen117
193
+ \MPnumerator=\count113
194
+ \everyMPtoPDFconversion=\toks21
195
+ )
196
+ LaTeX Font Info: Try loading font information for OMS+cmr on input line 20.
197
+ (/sw/share/texmf-dist/tex/latex/base/omscmr.fd
198
+ File: omscmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions
199
+ )
200
+ LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10> not available
201
+ (Font) Font shape `OMS/cmsy/m/n' tried instead on input line 20.
202
+ [1
203
+
204
+ {/Users/andrea/.texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
205
+ (/sw/share/texmf-dist/tex/latex/listings/lstlang1.sty
206
+ File: lstlang1.sty 2004/09/05 1.3 listings language file
207
+ )
208
+ (/sw/share/texmf-dist/tex/latex/listings/lstmisc.sty
209
+ File: lstmisc.sty 2004/09/07 1.3 (Carsten Heinz)
210
+ )
211
+ LaTeX Font Info: Font shape `OT1/cmtt/bx/n' in size <8> not available
212
+ (Font) Font shape `OT1/cmtt/m/n' tried instead on input line 93.
213
+ [2] [3] [4]
214
+ Overfull \hbox (17.10802pt too wide) in paragraph at lines 260--261
215
+ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
216
+ []
217
+
218
+
219
+ Overfull \hbox (1.80768pt too wide) in paragraph at lines 261--262
220
+ [][][][][][][][][][][][][][][][][][][][][][]
221
+ []
222
+
223
+
224
+ Overfull \hbox (22.20813pt too wide) in paragraph at lines 262--263
225
+ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
226
+ []
227
+
228
+
229
+ Overfull \hbox (17.10802pt too wide) in paragraph at lines 264--265
230
+ [][][][][][][][][][][][][][][][][][][][][][][][][][][][]
231
+ []
232
+
233
+
234
+ Overfull \hbox (17.10802pt too wide) in paragraph at lines 275--276
235
+ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
236
+ []
237
+
238
+
239
+ Overfull \hbox (12.0079pt too wide) in paragraph at lines 277--279
240
+ [][][][][][][][][][][][][][][][][][][][][][][][][][][]
241
+ []
242
+
243
+
244
+ Overfull \hbox (17.10802pt too wide) in paragraph at lines 279--280
245
+ [][][][][][][][][][][][][][][][][][][][][][][][][][][][]
246
+ []
247
+
248
+ [5] [6] [7] [8] [9] [10] [11]
249
+ Overfull \hbox (12.0079pt too wide) in paragraph at lines 908--909
250
+ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
251
+ []
252
+
253
+ [12] [13] [14]
254
+ Overfull \hbox (17.10802pt too wide) in paragraph at lines 1162--1163
255
+ [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]
256
+ []
257
+
258
+
259
+ Overfull \hbox (17.10802pt too wide) in paragraph at lines 1163--1164
260
+ [][][][][][][][][][][][][][]
261
+ []
262
+
263
+
264
+ Overfull \hbox (27.30824pt too wide) in paragraph at lines 1164--1165
265
+ [][][][][][][][][][][][][][][][][][][]
266
+ []
267
+
268
+ [15] [16] (./markdown_syntax.aux) )
269
+ Here is how much of TeX's memory you used:
270
+ 4639 strings out of 94500
271
+ 63837 string characters out of 1176113
272
+ 141632 words of memory out of 1000000
273
+ 7414 multiletter control sequences out of 10000+50000
274
+ 6829 words of font info for 25 fonts, out of 500000 for 2000
275
+ 580 hyphenation exceptions out of 1000
276
+ 28i,6n,59p,786b,1470s stack positions out of 1500i,500n,5000p,200000b,5000s
277
+ PDF statistics:
278
+ 500 PDF objects out of 300000
279
+ 391 named destinations out of 131072
280
+ 17 words of extra memory for PDF output out of 65536
281
+ </sw/share/texmf-dist/fonts/type1/bluesky/cm
282
+ /cmtt8.pfb></sw/share/texmf-dist/fonts/type1/bluesky/cm/cmti10.pfb></sw/share/t
283
+ exmf-dist/fonts/type1/bluesky/cm/cmsy10.pfb></sw/share/texmf-dist/fonts/type1/b
284
+ luesky/cm/cmtt10.pfb></sw/share/texmf-dist/fonts/type1/bluesky/cm/cmr10.pfb></s
285
+ w/share/texmf-dist/fonts/type1/bluesky/cm/cmbx10.pfb></sw/share/texmf-dist/font
286
+ s/type1/bluesky/cm/cmbx12.pfb>
287
+ Output written on markdown_syntax.pdf (16 pages, 177820 bytes).
@@ -0,0 +1,920 @@
1
+ CSS: style.css
2
+ latex_use_listings: true
3
+ html_use_syntax: true
4
+
5
+ Markdown: Syntax
6
+ ================
7
+
8
+ **Note:**
9
+
10
+ This copy is translated using [Maruku][].
11
+
12
+ [Maruku]: http://maruku.rubyforge.org
13
+
14
+ [Here](http://daringfireball.net/projects/markdown/syntax) you can find
15
+ the original by `Markdown.pl`.
16
+
17
+
18
+ @ class: toc
19
+
20
+ * [Overview](#overview)
21
+ * [Philosophy](#philosophy)
22
+ * [Inline HTML](#html)
23
+ * [Automatic Escaping for Special Characters](#autoescape)
24
+ * [Block Elements](#block)
25
+ * [Paragraphs and Line Breaks](#p)
26
+ * [Headers](#header)
27
+ * [Blockquotes](#blockquote)
28
+ * [Lists](#list)
29
+ * [Code Blocks](#precode)
30
+ * [Horizontal Rules](#hr)
31
+ * [Span Elements](#span)
32
+ * [Links](#link)
33
+ * [Emphasis](#em)
34
+ * [Code](#code)
35
+ * [Images](#img)
36
+ * [Miscellaneous](#misc)
37
+ * [Backslash Escapes](#backslash)
38
+ * [Automatic Links](#autolink)
39
+
40
+
41
+
42
+
43
+ * * *
44
+
45
+ Overview {#overview}
46
+ --------
47
+
48
+
49
+ ### Philosophy {#philosophy}
50
+
51
+ Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
52
+
53
+ Readability, however, is emphasized above all else. A Markdown-formatted
54
+ document should be publishable as-is, as plain text, without looking
55
+ like it's been marked up with tags or formatting instructions. While
56
+ Markdown's syntax has been influenced by several existing text-to-HTML
57
+ filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4],
58
+ [Grutatext] [5], and [EtText] [6] -- the single biggest source of
59
+ inspiration for Markdown's syntax is the format of plain text email.
60
+
61
+ [1]: http://docutils.sourceforge.net/mirror/setext.html
62
+ [2]: http://www.aaronsw.com/2002/atx/
63
+ [3]: http://textism.com/tools/textile/
64
+ [4]: http://docutils.sourceforge.net/rst.html
65
+ [5]: http://www.triptico.com/software/grutatxt.html
66
+ [6]: http://ettext.taint.org/doc/
67
+
68
+ To this end, Markdown's syntax is comprised entirely of punctuation
69
+ characters, which punctuation characters have been carefully chosen so
70
+ as to look like what they mean. E.g., asterisks around a word actually
71
+ look like \*emphasis\*. Markdown lists look like, well, lists. Even
72
+ blockquotes look like quoted passages of text, assuming you've ever
73
+ used email.
74
+
75
+
76
+
77
+ ### Inline HTML {#html}
78
+
79
+ Markdown's syntax is intended for one purpose: to be used as a
80
+ format for *writing* for the web.
81
+
82
+ Markdown is not a replacement for HTML, or even close to it. Its
83
+ syntax is very small, corresponding only to a very small subset of
84
+ HTML tags. The idea is *not* to create a syntax that makes it easier
85
+ to insert HTML tags. In my opinion, HTML tags are already easy to
86
+ insert. The idea for Markdown is to make it easy to read, write, and
87
+ edit prose. HTML is a *publishing* format; Markdown is a *writing*
88
+ format. Thus, Markdown's formatting syntax only addresses issues that
89
+ can be conveyed in plain text.
90
+
91
+ For any markup that is not covered by Markdown's syntax, you simply
92
+ use HTML itself. There's no need to preface it or delimit it to
93
+ indicate that you're switching from Markdown to HTML; you just use
94
+ the tags.
95
+
96
+ The only restrictions are that block-level HTML elements -- e.g. `<div>`,
97
+ `<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding
98
+ content by blank lines, and the start and end tags of the block should
99
+ not be indented with tabs or spaces. Markdown is smart enough not
100
+ to add extra (unwanted) `<p>` tags around HTML block-level tags.
101
+
102
+ For example, to add an HTML table to a Markdown article:
103
+
104
+ @ lang: html
105
+
106
+ This is a regular paragraph.
107
+
108
+ <table>
109
+ <tr>
110
+ <td>Foo</td>
111
+ </tr>
112
+ </table>
113
+
114
+ This is another regular paragraph.
115
+
116
+ Note that Markdown formatting syntax is not processed within block-level
117
+ HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an
118
+ HTML block.
119
+
120
+ Span-level HTML tags -- e.g. `<span>`, `<cite>`, or `<del>` -- can be
121
+ used anywhere in a Markdown paragraph, list item, or header. If you
122
+ want, you can even use HTML tags instead of Markdown formatting; e.g. if
123
+ you'd prefer to use HTML `<a>` or `<img>` tags instead of Markdown's
124
+ link or image syntax, go right ahead.
125
+
126
+ Unlike block-level HTML tags, Markdown syntax *is* processed within
127
+ span-level tags.
128
+
129
+
130
+ ### Automatic Escaping for Special Characters {#autoescape}
131
+
132
+ In HTML, there are two characters that demand special treatment: `<`
133
+ and `&`. Left angle brackets are used to start tags; ampersands are
134
+ used to denote HTML entities. If you want to use them as literal
135
+ characters, you must escape them as entities, e.g. `&lt;`, and
136
+ `&amp;`.
137
+
138
+ Ampersands in particular are bedeviling for web writers. If you want to
139
+ write about 'AT&T', you need to write '`AT&amp;T`'. You even need to
140
+ escape ampersands within URLs. Thus, if you want to link to:
141
+
142
+ http://images.google.com/images?num=30&q=larry+bird
143
+
144
+ you need to encode the URL as:
145
+
146
+ http://images.google.com/images?num=30&amp;q=larry+bird
147
+
148
+ in your anchor tag `href` attribute. Needless to say, this is easy to
149
+ forget, and is probably the single most common source of HTML validation
150
+ errors in otherwise well-marked-up web sites.
151
+
152
+ Markdown allows you to use these characters naturally, taking care of
153
+ all the necessary escaping for you. If you use an ampersand as part of
154
+ an HTML entity, it remains unchanged; otherwise it will be translated
155
+ into `&amp;`.
156
+
157
+ So, if you want to include a copyright symbol in your article, you can write:
158
+
159
+ @ lang: html
160
+
161
+ &copy;
162
+
163
+ and Markdown will leave it alone. But if you write:
164
+
165
+ AT&T
166
+
167
+ Markdown will translate it to:
168
+
169
+ @ lang: html
170
+
171
+ AT&amp;T
172
+
173
+ Similarly, because Markdown supports [inline HTML](#html), if you use
174
+ angle brackets as delimiters for HTML tags, Markdown will treat them as
175
+ such. But if you write:
176
+
177
+ 4 < 5
178
+
179
+ Markdown will translate it to:
180
+
181
+ @ lang: html
182
+ 4 &lt; 5
183
+
184
+ However, inside Markdown code spans and blocks, angle brackets and
185
+ ampersands are *always* encoded automatically. This makes it easy to use
186
+ Markdown to write about HTML code. (As opposed to raw HTML, which is a
187
+ terrible format for writing about HTML syntax, because every single `<`
188
+ and `&` in your example code needs to be escaped.)
189
+
190
+
191
+ * * *
192
+
193
+
194
+ ## Block Elements {#block}
195
+
196
+
197
+ ### Paragraphs and Line Breaks {#p}
198
+
199
+ A paragraph is simply one or more consecutive lines of text, separated
200
+ by one or more blank lines. (A blank line is any line that looks like a
201
+ blank line -- a line containing nothing but spaces or tabs is considered
202
+ blank.) Normal paragraphs should not be intended with spaces or tabs.
203
+
204
+ The implication of the "one or more consecutive lines of text" rule is
205
+ that Markdown supports "hard-wrapped" text paragraphs. This differs
206
+ significantly from most other text-to-HTML formatters (including Movable
207
+ Type's "Convert Line Breaks" option) which translate every line break
208
+ character in a paragraph into a `<br />` tag.
209
+
210
+ When you *do* want to insert a `<br />` break tag using Markdown, you
211
+ end a line with two or more spaces, then type return.
212
+
213
+ Yes, this takes a tad more effort to create a `<br />`, but a simplistic
214
+ "every line break is a `<br />`" rule wouldn't work for Markdown.
215
+ Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l]
216
+ work best -- and look better -- when you format them with hard breaks.
217
+
218
+ [bq]: #blockquote
219
+ [l]: #list
220
+
221
+
222
+
223
+ ### Headers {#header}
224
+
225
+ Markdown supports two styles of headers, [Setext] [1] and [atx] [2].
226
+
227
+ Setext-style headers are "underlined" using equal signs (for first-level
228
+ headers) and dashes (for second-level headers). For example:
229
+
230
+ This is an H1
231
+ =============
232
+
233
+ This is an H2
234
+ -------------
235
+
236
+ Any number of underlining `=`'s or `-`'s will work.
237
+
238
+ Atx-style headers use 1-6 hash characters at the start of the line,
239
+ corresponding to header levels 1-6. For example:
240
+
241
+ # This is an H1
242
+
243
+ ## This is an H2
244
+
245
+ ###### This is an H6
246
+
247
+ Optionally, you may "close" atx-style headers. This is purely
248
+ cosmetic -- you can use this if you think it looks better. The
249
+ closing hashes don't even need to match the number of hashes
250
+ used to open the header. (The number of opening hashes
251
+ determines the header level.) :
252
+
253
+ # This is an H1 #
254
+
255
+ ## This is an H2 ##
256
+
257
+ ### This is an H3 ######
258
+
259
+
260
+ ### Blockquotes {#blockquote}
261
+
262
+ Markdown uses email-style `>` characters for blockquoting. If you're
263
+ familiar with quoting passages of text in an email message, then you
264
+ know how to create a blockquote in Markdown. It looks best if you hard
265
+ wrap the text and put a `>` before every line:
266
+
267
+ > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
268
+ > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
269
+ > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
270
+ >
271
+ > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
272
+ > id sem consectetuer libero luctus adipiscing.
273
+
274
+ Markdown allows you to be lazy and only put the `>` before the first
275
+ line of a hard-wrapped paragraph:
276
+
277
+ > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
278
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
279
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
280
+
281
+ > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
282
+ id sem consectetuer libero luctus adipiscing.
283
+
284
+ Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
285
+ adding additional levels of `>`:
286
+
287
+ > This is the first level of quoting.
288
+ >
289
+ > > This is nested blockquote.
290
+ >
291
+ > Back to the first level.
292
+
293
+ Blockquotes can contain other Markdown elements, including headers, lists,
294
+ and code blocks:
295
+
296
+ > ## This is a header.
297
+ >
298
+ > 1. This is the first list item.
299
+ > 2. This is the second list item.
300
+ >
301
+ > Here's some example code:
302
+ >
303
+ > return shell_exec("echo $input | $markdown_script");
304
+
305
+ Any decent text editor should make email-style quoting easy. For
306
+ example, with BBEdit, you can make a selection and choose Increase
307
+ Quote Level from the Text menu.
308
+
309
+
310
+ ### Lists {#list}
311
+
312
+ Markdown supports ordered (numbered) and unordered (bulleted) lists.
313
+
314
+ Unordered lists use asterisks, pluses, and hyphens -- interchangably
315
+ -- as list markers:
316
+
317
+ * Red
318
+ * Green
319
+ * Blue
320
+
321
+ is equivalent to:
322
+
323
+ + Red
324
+ + Green
325
+ + Blue
326
+
327
+ and:
328
+
329
+ - Red
330
+ - Green
331
+ - Blue
332
+
333
+ Ordered lists use numbers followed by periods:
334
+
335
+ 1. Bird
336
+ 2. McHale
337
+ 3. Parish
338
+
339
+ It's important to note that the actual numbers you use to mark the
340
+ list have no effect on the HTML output Markdown produces. The HTML
341
+ Markdown produces from the above list is:
342
+
343
+ @ lang: html
344
+
345
+ <ol>
346
+ <li>Bird</li>
347
+ <li>McHale</li>
348
+ <li>Parish</li>
349
+ </ol>
350
+
351
+ If you instead wrote the list in Markdown like this:
352
+
353
+ 1. Bird
354
+ 1. McHale
355
+ 1. Parish
356
+
357
+ or even:
358
+
359
+ 3. Bird
360
+ 1. McHale
361
+ 8. Parish
362
+
363
+ you'd get the exact same HTML output. The point is, if you want to,
364
+ you can use ordinal numbers in your ordered Markdown lists, so that
365
+ the numbers in your source match the numbers in your published HTML.
366
+ But if you want to be lazy, you don't have to.
367
+
368
+ If you do use lazy list numbering, however, you should still start the
369
+ list with the number 1. At some point in the future, Markdown may support
370
+ starting ordered lists at an arbitrary number.
371
+
372
+ List markers typically start at the left margin, but may be indented by
373
+ up to three spaces. List markers must be followed by one or more spaces
374
+ or a tab.
375
+
376
+ To make lists look nice, you can wrap items with hanging indents:
377
+
378
+ * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
379
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
380
+ viverra nec, fringilla in, laoreet vitae, risus.
381
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
382
+ Suspendisse id sem consectetuer libero luctus adipiscing.
383
+
384
+ But if you want to be lazy, you don't have to:
385
+
386
+ * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
387
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
388
+ viverra nec, fringilla in, laoreet vitae, risus.
389
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
390
+ Suspendisse id sem consectetuer libero luctus adipiscing.
391
+
392
+ If list items are separated by blank lines, Markdown will wrap the
393
+ items in `<p>` tags in the HTML output. For example, this input:
394
+
395
+ * Bird
396
+ * Magic
397
+
398
+ will turn into:
399
+
400
+ @ lang: html
401
+
402
+ <ul>
403
+ <li>Bird</li>
404
+ <li>Magic</li>
405
+ </ul>
406
+
407
+ But this:
408
+
409
+ * Bird
410
+
411
+ * Magic
412
+
413
+ will turn into:
414
+
415
+ @ lang: html
416
+
417
+ <ul>
418
+ <li><p>Bird</p></li>
419
+ <li><p>Magic</p></li>
420
+ </ul>
421
+
422
+ List items may consist of multiple paragraphs. Each subsequent
423
+ paragraph in a list item must be intended by either 4 spaces
424
+ or one tab:
425
+
426
+ 1. This is a list item with two paragraphs. Lorem ipsum dolor
427
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
428
+ mi posuere lectus.
429
+
430
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet
431
+ vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
432
+ sit amet velit.
433
+
434
+ 2. Suspendisse id sem consectetuer libero luctus adipiscing.
435
+
436
+ It looks nice if you indent every line of the subsequent
437
+ paragraphs, but here again, Markdown will allow you to be
438
+ lazy:
439
+
440
+ * This is a list item with two paragraphs.
441
+
442
+ This is the second paragraph in the list item. You're
443
+ only required to indent the first line. Lorem ipsum dolor
444
+ sit amet, consectetuer adipiscing elit.
445
+
446
+ * Another item in the same list.
447
+
448
+ To put a blockquote within a list item, the blockquote's `>`
449
+ delimiters need to be indented:
450
+
451
+ * A list item with a blockquote:
452
+
453
+ > This is a blockquote
454
+ > inside a list item.
455
+
456
+ To put a code block within a list item, the code block needs
457
+ to be indented *twice* -- 8 spaces or two tabs:
458
+
459
+ * A list item with a code block:
460
+
461
+ <code goes here>
462
+
463
+
464
+ It's worth noting that it's possible to trigger an ordered list by
465
+ accident, by writing something like this:
466
+
467
+ 1986. What a great season.
468
+
469
+ In other words, a *number-period-space* sequence at the beginning of a
470
+ line. To avoid this, you can backslash-escape the period:
471
+
472
+ 1986\\. What a great season.
473
+
474
+
475
+
476
+ ### Code Blocks {#precode}
477
+
478
+ Pre-formatted code blocks are used for writing about programming or
479
+ markup source code. Rather than forming normal paragraphs, the lines
480
+ of a code block are interpreted literally. Markdown wraps a code block
481
+ in both `<pre>` and `<code>` tags.
482
+
483
+ To produce a code block in Markdown, simply indent every line of the
484
+ block by at least 4 spaces or 1 tab. For example, given this input:
485
+
486
+ This is a normal paragraph:
487
+
488
+ This is a code block.
489
+
490
+ Markdown will generate:
491
+
492
+ @ lang: html
493
+
494
+ <p>This is a normal paragraph:</p>
495
+
496
+ <pre><code>This is a code block.
497
+ </code></pre>
498
+
499
+ One level of indentation -- 4 spaces or 1 tab -- is removed from each
500
+ line of the code block. For example, this:
501
+
502
+ Here is an example of AppleScript:
503
+
504
+ tell application "Foo"
505
+ beep
506
+ end tell
507
+
508
+ will turn into:
509
+
510
+ @ lang: html
511
+
512
+ <p>Here is an example of AppleScript:</p>
513
+
514
+ <pre><code>tell application "Foo"
515
+ beep
516
+ end tell
517
+ </code></pre>
518
+
519
+ A code block continues until it reaches a line that is not indented
520
+ (or the end of the article).
521
+
522
+ Within a code block, ampersands (`&`) and angle brackets (`<` and `>`)
523
+ are automatically converted into HTML entities. This makes it very
524
+ easy to include example HTML source code using Markdown -- just paste
525
+ it and indent it, and Markdown will handle the hassle of encoding the
526
+ ampersands and angle brackets. For example, this:
527
+
528
+ <div class="footer">
529
+ &copy; 2004 Foo Corporation
530
+ </div>
531
+
532
+ will turn into:
533
+
534
+ @ lang: html
535
+ <pre><code>&lt;div class="footer"&gt;
536
+ &amp;copy; 2004 Foo Corporation
537
+ &lt;/div&gt;
538
+ </code></pre>
539
+
540
+ Regular Markdown syntax is not processed within code blocks. E.g.,
541
+ asterisks are just literal asterisks within a code block. This means
542
+ it's also easy to use Markdown to write about Markdown's own syntax.
543
+
544
+
545
+
546
+ ### Horizontal Rules {#hr}
547
+
548
+ You can produce a horizontal rule tag (`<hr />`) by placing three or
549
+ more hyphens or asterisks on a line by themselves. If you wish, you
550
+ may use spaces between the hyphens or asterisks. Each of the following
551
+ lines will produce a horizontal rule:
552
+
553
+ * * *
554
+
555
+ ***
556
+
557
+ *****
558
+
559
+ - - -
560
+
561
+ ---------------------------------------
562
+
563
+
564
+ * * *
565
+
566
+ Span Elements {#span}
567
+ ----------------------
568
+
569
+
570
+ ### Links {#link}
571
+
572
+ Markdown supports two style of links: *inline* and *reference*.
573
+
574
+ In both styles, the link text is delimited by [square brackets].
575
+
576
+ To create an inline link, use a set of regular parentheses immediately
577
+ after the link text's closing square bracket. Inside the parentheses,
578
+ put the URL where you want the link to point, along with an *optional*
579
+ title for the link, surrounded in quotes. For example:
580
+
581
+ This is [an example](http://example.com/ "Title") inline link.
582
+
583
+ [This link](http://example.net/) has no title attribute.
584
+
585
+ Will produce:
586
+
587
+ @ lang: html
588
+ <p>This is <a href="http://example.com/" title="Title">
589
+ an example</a> inline link.</p>
590
+
591
+ <p><a href="http://example.net/">This link</a> has no
592
+ title attribute.</p>
593
+
594
+ If you're referring to a local resource on the same server, you can
595
+ use relative paths:
596
+
597
+ See my [About](/about/) page for details.
598
+
599
+ Reference-style links use a second set of square brackets, inside
600
+ which you place a label of your choosing to identify the link:
601
+
602
+ This is [an example][id] reference-style link.
603
+
604
+ You can optionally use a space to separate the sets of brackets:
605
+
606
+ This is [an example] [id] reference-style link.
607
+
608
+ Then, anywhere in the document, you define your link label like this,
609
+ on a line by itself:
610
+
611
+ [id]: http://example.com/ "Optional Title Here"
612
+
613
+ That is:
614
+
615
+ * Square brackets containing the link identifier (optionally
616
+ indented from the left margin using spaces or tabs);
617
+ * followed by a colon;
618
+ * followed by one or more spaces (or tabs);
619
+ * followed by the URL for the link;
620
+ * optionally followed by a title attribute for the link, enclosed
621
+ in double or single quotes, or enclosed in parentheses.
622
+
623
+ The following three link definitions are equivalent:
624
+
625
+ [foo]: http://example.com/ "Optional Title Here"
626
+ [foo]: http://example.com/ 'Optional Title Here'
627
+ [foo]: http://example.com/ (Optional Title Here)
628
+
629
+ **Note:** There is a known bug in Markdown 1.0.1 which prevents
630
+ single quotes from being used to delimit link titles.
631
+
632
+ The link URL may, optionally, be surrounded by angle brackets:
633
+
634
+ [id]: <http://example.com/> "Optional Title Here"
635
+
636
+ You can put the title attribute on the next line and use extra spaces
637
+ or tabs for padding, which tends to look better with longer URLs:
638
+
639
+ [id]: http://example.com/longish/path/to/resource/here
640
+ "Optional Title Here"
641
+
642
+ Link definitions are only used for creating links during Markdown
643
+ processing, and are stripped from your document in the HTML output.
644
+
645
+ Link definition names may constist of letters, numbers, spaces, and
646
+ punctuation -- but they are *not* case sensitive. E.g. these two
647
+ links:
648
+
649
+ [link text][a]
650
+ [link text][A]
651
+
652
+ are equivalent.
653
+
654
+ The *implicit link name* shortcut allows you to omit the name of the
655
+ link, in which case the link text itself is used as the name.
656
+ Just use an empty set of square brackets -- e.g., to link the word
657
+ "Google" to the google.com web site, you could simply write:
658
+
659
+ [Google][]
660
+
661
+ And then define the link:
662
+
663
+ [Google]: http://google.com/
664
+
665
+ Because link names may contain spaces, this shortcut even works for
666
+ multiple words in the link text:
667
+
668
+ Visit [Daring Fireball][] for more information.
669
+
670
+ And then define the link:
671
+
672
+ [Daring Fireball]: http://daringfireball.net/
673
+
674
+ Link definitions can be placed anywhere in your Markdown document. I
675
+ tend to put them immediately after each paragraph in which they're
676
+ used, but if you want, you can put them all at the end of your
677
+ document, sort of like footnotes.
678
+
679
+ Here's an example of reference links in action:
680
+
681
+ I get 10 times more traffic from [Google] [1] than from
682
+ [Yahoo] [2] or [MSN] [3].
683
+
684
+ [1]: http://google.com/ "Google"
685
+ [2]: http://search.yahoo.com/ "Yahoo Search"
686
+ [3]: http://search.msn.com/ "MSN Search"
687
+
688
+ Using the implicit link name shortcut, you could instead write:
689
+
690
+ I get 10 times more traffic from [Google][] than from
691
+ [Yahoo][] or [MSN][].
692
+
693
+ [google]: http://google.com/ "Google"
694
+ [yahoo]: http://search.yahoo.com/ "Yahoo Search"
695
+ [msn]: http://search.msn.com/ "MSN Search"
696
+
697
+ Both of the above examples will produce the following HTML output:
698
+
699
+ <p>I get 10 times more traffic from <a href="http://google.com/"
700
+ title="Google">Google</a> than from
701
+ <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
702
+ or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
703
+
704
+ For comparison, here is the same paragraph written using
705
+ Markdown's inline link style:
706
+
707
+ I get 10 times more traffic from [Google](http://google.com/ "Google")
708
+ than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
709
+ [MSN](http://search.msn.com/ "MSN Search").
710
+
711
+ The point of reference-style links is not that they're easier to
712
+ write. The point is that with reference-style links, your document
713
+ source is vastly more readable. Compare the above examples: using
714
+ reference-style links, the paragraph itself is only 81 characters
715
+ long; with inline-style links, it's 176 characters; and as raw HTML,
716
+ it's 234 characters. In the raw HTML, there's more markup than there
717
+ is text.
718
+
719
+ With Markdown's reference-style links, a source document much more
720
+ closely resembles the final output, as rendered in a browser. By
721
+ allowing you to move the markup-related metadata out of the paragraph,
722
+ you can add links without interrupting the narrative flow of your
723
+ prose.
724
+
725
+
726
+ ### Emphasis {#em}
727
+
728
+ Markdown treats asterisks (`*`) and underscores (`_`) as indicators of
729
+ emphasis. Text wrapped with one `*` or `_` will be wrapped with an
730
+ HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML
731
+ `<strong>` tag. E.g., this input:
732
+
733
+ *single asterisks*
734
+
735
+ _single underscores_
736
+
737
+ **double asterisks**
738
+
739
+ __double underscores__
740
+
741
+ will produce:
742
+
743
+ @ lang: html
744
+ <em>single asterisks</em>
745
+
746
+ <em>single underscores</em>
747
+
748
+ <strong>double asterisks</strong>
749
+
750
+ <strong>double underscores</strong>
751
+
752
+ You can use whichever style you prefer; the lone restriction is that
753
+ the same character must be used to open and close an emphasis span.
754
+
755
+ Emphasis can be used in the middle of a word:
756
+
757
+ un*fucking*believable
758
+
759
+ But if you surround an `*` or `_` with spaces, it'll be treated as a
760
+ literal asterisk or underscore.
761
+
762
+ To produce a literal asterisk or underscore at a position where it
763
+ would otherwise be used as an emphasis delimiter, you can backslash
764
+ escape it:
765
+
766
+ \*this text is surrounded by literal asterisks\*
767
+
768
+
769
+
770
+ ### Code {#code}
771
+
772
+ To indicate a span of code, wrap it with backtick quotes (`` ` ``).
773
+ Unlike a pre-formatted code block, a code span indicates code within a
774
+ normal paragraph. For example:
775
+
776
+ Use the `printf()` function.
777
+
778
+ will produce:
779
+
780
+ @ lang: html
781
+ <p>Use the <code>printf()</code> function.</p>
782
+
783
+ To include a literal backtick character within a code span, you can
784
+ backslash escape it:
785
+
786
+ `There is a literal backtick (\\`) here.`
787
+
788
+ Or, if you prefer, you can use multiple backticks as the opening and
789
+ closing delimiters:
790
+
791
+ ``There is a literal backtick (`) here.``
792
+
793
+ Both of the previous two examples will produce this:
794
+
795
+ @ lang: html
796
+ <p><code>There is a literal backtick (`) here.</code></p>
797
+
798
+ With a code span, ampersands and angle brackets are encoded as HTML
799
+ entities automatically, which makes it easy to include example HTML
800
+ tags. Markdown will turn this:
801
+
802
+ Please don't use any `<blink>` tags.
803
+
804
+ into:
805
+
806
+ @ lang: html
807
+ <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
808
+
809
+ You can write this:
810
+
811
+ `&#8212;` is the decimal-encoded equivalent of `&mdash;`.
812
+
813
+ to produce:
814
+
815
+ @ lang: html
816
+ <p><code>&amp;#8212;</code> is the decimal-encoded
817
+ equivalent of <code>&amp;mdash;</code>.</p>
818
+
819
+
820
+
821
+ ### Images {#img}
822
+
823
+ Admittedly, it's fairly difficult to devise a "natural" syntax for
824
+ placing images into a plain text document format.
825
+
826
+ Markdown uses an image syntax that is intended to resemble the syntax
827
+ for links, allowing for two styles: *inline* and *reference*.
828
+
829
+ Inline image syntax looks like this:
830
+
831
+ ![Alt text](/path/to/img.jpg)
832
+
833
+ ![Alt text](/path/to/img.jpg "Optional title")
834
+
835
+ That is:
836
+
837
+ * An exclamation mark: `!`;
838
+ * followed by a set of square brackets, containing the `alt`
839
+ attribute text for the image;
840
+ * followed by a set of parentheses, containing the URL or path to
841
+ the image, and an optional `title` attribute enclosed in double
842
+ or single quotes.
843
+
844
+ Reference-style image syntax looks like this:
845
+
846
+ ![Alt text][id]
847
+
848
+ Where "id" is the name of a defined image reference. Image references
849
+ are defined using syntax identical to link references:
850
+
851
+ [id]: url/to/image "Optional title attribute"
852
+
853
+ As of this writing, Markdown has no syntax for specifying the
854
+ dimensions of an image; if this is important to you, you can simply
855
+ use regular HTML `<img>` tags.
856
+
857
+
858
+ * * *
859
+
860
+
861
+ Miscellaneous {#misc}
862
+ ---------------------
863
+
864
+ ### Automatic Links {#autolink}
865
+
866
+ Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:
867
+
868
+ <http://example.com/>
869
+
870
+ Markdown will turn this into:
871
+
872
+ @ lang: html
873
+ <a href="http://example.com/">http://example.com/</a>
874
+
875
+ Automatic links for email addresses work similarly, except that
876
+ Markdown will also perform a bit of randomized decimal and hex
877
+ entity-encoding to help obscure your address from address-harvesting
878
+ spambots. For example, Markdown will turn this:
879
+
880
+ <address@example.com>
881
+
882
+ into something like this:
883
+
884
+ @ lang: html
885
+ <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
886
+ &#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
887
+ &#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
888
+ &#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
889
+
890
+ which will render in a browser as a clickable link to "address@example.com".
891
+
892
+ (This sort of entity-encoding trick will indeed fool many, if not
893
+ most, address-harvesting bots, but it definitely won't fool all of
894
+ them. It's better than nothing, but an address published in this way
895
+ will probably eventually start receiving spam.)
896
+
897
+
898
+ ### Backslash Escapes ### {#backslash}
899
+
900
+ Markdown allows you to use backslash escapes to generate literal
901
+ characters which would otherwise have special meaning in Markdown's
902
+ formatting syntax. For example, if you wanted to surround a word with
903
+ literal asterisks (instead of an HTML `<em>` tag), you can backslashes
904
+ before the asterisks, like this:
905
+
906
+ \*literal asterisks\*
907
+
908
+ Markdown provides backslash escapes for the following characters:
909
+
910
+ \ backslash
911
+ ` backtick
912
+ * asterisk
913
+ _ underscore
914
+ {} curly braces
915
+ [] square brackets
916
+ () parentheses
917
+ # hash mark
918
+ . dot
919
+ ! exclamation mark
920
+