}
mmd_export_token_tree_beamer(out, source, t->child, scratch);
+ trim_trailing_whitespace_d_string(out);
if (scratch->extensions & EXT_NO_LABELS) {
print_const("}");
}
mmd_export_token_tree_html(out, source, t->child, scratch);
+ trim_trailing_whitespace_d_string(out);
+
printf("</h%1d>", temp_short + scratch->base_header_level - 1);
scratch->padded = 0;
break;
case ESCAPED_CHARACTER:
print_const("\\");
-
+
if (t->next && t->next->type == TEXT_EMPTY && source[t->start + 1] == ' ') {
} else {
mmd_print_char_html(out, source[t->start + 1], false);
}
mmd_export_token_tree_latex(out, source, t->child, scratch);
+ trim_trailing_whitespace_d_string(out);
if (scratch->extensions & EXT_NO_LABELS) {
print_const("}");
case ESCAPED_CHARACTER:
print_const("\\textbackslash{}");
+
if (t->next && t->next->type == TEXT_EMPTY && source[t->start + 1] == ' ') {
} else {
mmd_print_char_latex(out, source[t->start + 1]);
}
+
break;
case HASH1:
case ESCAPED_CHARACTER:
print_const("\\");
+
if (t->next && t->next->type == TEXT_EMPTY && source[t->start + 1] == ' ') {
} else {
mmd_print_char_opendocument(out, source[t->start + 1]);
}
+
break;
case HTML_COMMENT_START:
case MARKER_H5:
case MARKER_H6:
temp = (char *) &source[t->start];
+
while (temp) {
switch (*temp) {
case '#':
print_const("#");
temp++;
break;
+
case ' ':
print_const(" ");
temp++;
break;
+
case '\t':
print_const("<text:tab/>");
temp++;
break;
+
default:
temp = NULL;
break;
}
}
+
break;
case MARKER_LIST_BULLET:
case TEXT_LINEBREAK:
print_const(" ");
+
case TEXT_NL:
print_const("<text:line-break/>");
break;
free(temp_char);
}
+ trim_trailing_whitespace_d_string(out);
+
print_const("</text:h>");
scratch->padded = 0;
break;
@author Fletcher T. Penney
- @bug
+ @bug
**/
The `MultiMarkdown 6` project is released under the MIT License..
-
+
GLibFacade.c and GLibFacade.h are from the MultiMarkdown v4 project:
-
+
https://github.com/fletcher/MultiMarkdown-4/
-
+
MMD 4 is released under both the MIT License and GPL.
-
-
+
+
CuTest is released under the zlib/libpng license. See CuTest.c for the
text of the license.
-
+
uthash library:
Copyright (c) 2005-2016, Troy D. Hanson
-
+
Licensed under Revised BSD license
-
+
miniz library:
Copyright 2013-2014 RAD Game Tools and Valve Software
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
-
+
Licensed under the MIT license
-
+
argtable3 library:
Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
<sheitmann@users.sourceforge.net>
All rights reserved.
-
+
Licensed under the Revised BSD License
-
-
+
+
## The MIT License ##
-
+
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
-
+
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
-
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
+
+
## Revised BSD License ##
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
names of its contributors may be used to endorse or promote
products derived from this software without specific prior
written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
*/
case '&':
print_const("&");
break;
+
case '<':
print_const("<");
break;
+
case '>':
print_const(">");
break;
+
case '"':
print_const(""");
break;
+
case '\'':
print_const("'");
break;
+
case '\n':
print_const(" ");
break;
+
case '\r':
print_const(" ");
break;
+
case '\t':
print_const("	");
break;
+
default:
print_char(*c);
break;
}
+
c++;
}
}
token * walker = t->child;
while (walker) {
- switch(walker->type) {
+ switch (walker->type) {
case BLOCK_META:
walker = walker->next;
break;
case BLOCK_H6:
level = 1 + current->type - BLOCK_H1;
break;
+
default:
level = 100;
break;
} else {
start = t->start + t->len;
}
+
break;
case BLOCK_H1:
print_const(" text=\"");
mmd_export_header_opml(out, source, t, scratch);
+ trim_trailing_whitespace_d_string(out);
print_const("\" _note=\"");
break;
@file opml.h
- @brief
+ @brief
@author Fletcher T. Penney
- @bug
+ @bug
**/
The `MultiMarkdown 6` project is released under the MIT License..
-
+
GLibFacade.c and GLibFacade.h are from the MultiMarkdown v4 project:
-
+
https://github.com/fletcher/MultiMarkdown-4/
-
+
MMD 4 is released under both the MIT License and GPL.
-
-
+
+
CuTest is released under the zlib/libpng license. See CuTest.c for the
text of the license.
-
+
uthash library:
Copyright (c) 2005-2016, Troy D. Hanson
-
+
Licensed under Revised BSD license
-
+
miniz library:
Copyright 2013-2014 RAD Game Tools and Valve Software
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
-
+
Licensed under the MIT license
-
+
argtable3 library:
Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
<sheitmann@users.sourceforge.net>
All rights reserved.
-
+
Licensed under the Revised BSD License
-
-
+
+
## The MIT License ##
-
+
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
-
+
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
-
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
+
+
## Revised BSD License ##
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
names of its contributors may be used to endorse or promote
products derived from this software without specific prior
written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
*/
default:
// Trim trailing newlines
walker = content->tail;
+
while (walker) {
switch (walker->type) {
case TEXT_NL:
}
+void trim_trailing_whitespace_d_string(DString * d) {
+ if (d) {
+ char * c = &(d->str[d->currentStringLength - 1]);
+
+ while (d->currentStringLength && char_is_whitespace(*c)) {
+ *c-- = 0;
+ d->currentStringLength--;
+ }
+ }
+}
+
+
bool table_has_caption(token * t) {
if (t->next && t->next->type == BLOCK_PARA) {
void strip_leading_whitespace(token * chain, const char * source);
+void trim_trailing_whitespace_d_string(DString * d);
+
bool table_has_caption(token * table);
char * get_fence_language_specifier(token * fence, const char * source);
\input{mmd6-beamer-begin}
\begin{frame}[fragile]
-\frametitle{0 }
+\frametitle{0}
\label{0}
\texttt{*foo*}\{*\}
\end{frame}
\begin{frame}[fragile]
-\frametitle{5 }
+\frametitle{5}
\label{5}
\begin{lstlisting}[language={*}]
\end{frame}
\begin{frame}[fragile]
-\frametitle{10 }
+\frametitle{10}
\label{10}
*foo*
\input{mmd6-beamer-begin}
\begin{frame}[fragile]
-\frametitle{MultiMarkdown is a derivative of Markdown }
+\frametitle{MultiMarkdown is a derivative of Markdown}
\label{multimarkdownisaderivativeofmarkdown}
\href{http://daringfireball.net/projects/markdown/}{Markdown}\footnote{\href{http://daringfireball.net/projects/markdown/}{http:\slash \slash daringfireball.net\slash projects\slash markdown\slash }} is a program and a
\end{frame}
\begin{frame}[fragile]
-\frametitle{The old way was complicated }
+\frametitle{The old way was complicated}
\label{theoldwaywascomplicated}
\begin{verbatim}
\end{frame}
\begin{frame}[fragile]
-\frametitle{The new way is easier }
+\frametitle{The new way is easier}
\label{thenewwayiseasier}
\begin{verbatim}
\end{frame}
\begin{frame}[fragile]
-\frametitle{Markdown is designed for people }
+\frametitle{Markdown is designed for people}
\label{markdownisdesignedforpeople}
The overriding design goal for Markdown's formatting syntax is to make it as
\end{frame}
\begin{frame}[fragile]
-\frametitle{But Markdown wasn't complete }
+\frametitle{But Markdown wasn't complete}
\label{butmarkdownwasntcomplete}
I, and others, loved the spirit and elegance of Markdown, but felt it was
\end{frame}
\begin{frame}[fragile]
-\frametitle{MultiMarkdown adds several new features }
+\frametitle{MultiMarkdown adds several new features}
\label{multimarkdownaddsseveralnewfeatures}
\begin{itemize}
\end{frame}
\begin{frame}[fragile]
-\frametitle{MMD also adds something else{\ldots} }
+\frametitle{MMD also adds something else{\ldots}}
\label{mmdalsoaddssomethingelse...}
\begin{itemize}
\end{frame}
\begin{frame}[fragile]
-\frametitle{So, one text file becomes multiple final documents }
+\frametitle{So, one text file becomes multiple final documents}
\label{soonetextfilebecomesmultiplefinaldocuments}
\begin{figure}[htbp]
\end{frame}
\begin{frame}[fragile]
-\frametitle{The goal is to separate content from formatting }
+\frametitle{The goal is to separate content from formatting}
\label{thegoalistoseparatecontentfromformatting}
By focusing on the text content of your document, you can focus on the
\end{frame}
\begin{frame}[fragile]
-\frametitle{MultiMarkdown and Mathematics }
+\frametitle{MultiMarkdown and Mathematics}
\label{multimarkdownandmathematics}
Built into MultiMarkdown is support for mathematical equations. You write
\end{frame}
\begin{frame}[fragile]
-\frametitle{Images are just as easy }
+\frametitle{Images are just as easy}
\label{imagesarejustaseasy}
\begin{verbatim}
\end{frame}
\begin{frame}[fragile]
-\frametitle{Images are just as easy }
+\frametitle{Images are just as easy}
\label{imagesarejustaseasy}
\begin{figure}[htbp]
\end{frame}
\begin{frame}[fragile]
-\frametitle{Support for a bibliography is also included }
+\frametitle{Support for a bibliography is also included}
\label{supportforabibliographyisalsoincluded}
\begin{itemize}
\end{frame}
\begin{frame}[fragile]
-\frametitle{Installation is easy }
+\frametitle{Installation is easy}
\label{installationiseasy}
\begin{itemize}
\end{frame}
\begin{frame}[fragile]
-\frametitle{How do I create a MultiMarkdown document? }
+\frametitle{How do I create a MultiMarkdown document?}
\label{howdoicreateamultimarkdowndocument}
\begin{itemize}
\end{frame}
\begin{frame}[fragile]
-\frametitle{Why should I mess with this LaTeX stuff? }
+\frametitle{Why should I mess with this LaTeX stuff?}
\label{whyshouldimesswiththislatexstuff}
MultiMarkdown's support for LaTeX is designed to automatically do the ``right''
\end{frame}
\begin{frame}[fragile]
-\frametitle{How do I create a fancy PDF? }
+\frametitle{How do I create a fancy PDF?}
\label{howdoicreateafancypdf}
If you're using LaTeX, and have the proper software installed it's easy:
\end{frame}
\begin{frame}[fragile]
-\frametitle{Where to learn more }
+\frametitle{Where to learn more}
\label{wheretolearnmore}
\begin{itemize}
\end{frame}
\begin{frame}[fragile]
-\frametitle{By the way{\ldots} }
+\frametitle{By the way{\ldots}}
\label{bytheway...}
This presentation was, of course, written in MultiMarkdown and processed by
<text:p><text:bookmark text:name="foobar"/>Table <text:sequence text:name="Table" text:formula="ooow:Table+1" style:num-format="1"> Update Fields to calculate numbers</text:sequence>:foo bar<text:bookmark-end text:name="foobar"/></text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="foobar"/>foo bar </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="foobar"/>foo bar</text:h>
-<text:h text:outline-level="3"><text:bookmark text:name="foobar"/>foo bar </text:h>
+<text:h text:outline-level="3"><text:bookmark text:name="foobar"/>foo bar</text:h>
<text:h text:outline-level="1"><text:bookmark text:name="foobar"/>foo bar</text:h>
</tbody>
</table>
-<h1 id="foobar">foo bar </h1>
+<h1 id="foobar">foo bar</h1>
-<h3 id="foobar">foo bar </h3>
+<h3 id="foobar">foo bar</h3>
<h1 id="foobar">foo bar</h1>
| foo | bar |
[foo bar]</p>
-<h1>foo bar </h1>
+<h1>foo bar</h1>
-<h3>foo bar </h3>
+<h3>foo bar</h3>
<h1>foo bar</h1>
<head><title>Abbreviations</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" foo foo f.o.o. f.o.o. f-o-o f-o-o f o o f o o fo'o fo'o 5 [>bar] [>bar] [>b.a.r.] [>b.a.r.] [>b-a-r] [>b-a-r] [>b a r] [>b a r] [>ba'r] [>ba'r] 10 foo bar foo bar foo bar [>(baz) BAZ] > foo bar 15 | foo | bar | | --- | --- | | foo | bar | [foo bar] "></outline>
-<outline text="foo bar " _note=" "><outline text="foo bar " _note=" "></outline>
+<outline text="foo bar" _note=" "><outline text="foo bar" _note=" "></outline>
</outline>
<outline text="foo bar" _note=" ![foo bar](http://foobar.net/) 20 [^foo and bar] [^note] * foo * foo * foo [>foo]: FOO [>f.o.o.]: F.O.O. [>f-o-o]: F-O-O [>f o o]: F O O [>fo'o]: FO'O [>bar]: BAR [>b.a.r.]: B.A.R. [>b-a-r]: B-A-R [>b a r]: B A R [>ba'r]: BA'R [>foo bar]: FOO BAR [^note]: foo and bar "></outline>
<outline text="Metadata">
\end{minipage}
\end{table}
-\part{foo bar }
+\part{foo bar}
\label{foobar}
-\section{foo bar }
+\section{foo bar}
\label{foobar}
\part{foo bar}
</office:meta>
<office:body>
<office:text>
-<text:h text:outline-level="1"><text:bookmark text:name="bar"/>foo </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="bar"/>foo</text:h>
<text:h text:outline-level="1"><text:bookmark text:name="bar"/>foo</text:h>
<text:h text:outline-level="1"><text:bookmark text:name="foobarbat"/>foo <text:a xlink:type="simple" xlink:href="#bat">bar</text:a></text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="bat"/>foo <text:a xlink:type="simple" xlink:href="#bar">bar</text:a> </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="bat"/>foo <text:a xlink:type="simple" xlink:href="#bar">bar</text:a></text:h>
<text:h text:outline-level="1"><text:bookmark text:name="baz"/>foo <text:a xlink:type="simple" xlink:href="#bat">bar</text:a></text:h>
<text:p text:style-name="Standard">5</text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="bar"/>foo </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="bar"/>foo</text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="foobar"/><text:span text:style-name="MMD-Italic">foo</text:span> bar </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="foobar"/><text:span text:style-name="MMD-Italic">foo</text:span> bar</text:h>
<text:h text:outline-level="1"><text:bookmark text:name="foobar"/><text:span text:style-name="MMD-Italic">foo
bar</text:span></text:h>
</head>
<body>
-<h1 id="bar">foo </h1>
+<h1 id="bar">foo</h1>
<h1 id="bar">foo</h1>
<h1 id="foobarbat">foo <a href="#bat">bar</a></h1>
-<h1 id="bat">foo <a href="#bar">bar</a> </h1>
+<h1 id="bat">foo <a href="#bar">bar</a></h1>
<h1 id="baz">foo <a href="#bat">bar</a></h1>
<h1 id="bar">foo </h1>
-<h1 id="foobar"><em>foo</em> bar </h1>
+<h1 id="foobar"><em>foo</em> bar</h1>
<h1 id="foobar"><em>foo
bar</em></h1>
<p>Title: Advanced Headers
latex config: article</p>
-<h1>foo [bar] </h1>
+<h1>foo [bar]</h1>
<h1>foo[bar]</h1>
<h1>foo [bar]</h1>
-<h1><em>foo</em> bar </h1>
+<h1><em>foo</em> bar</h1>
<h1><em>foo
bar</em></h1>
<head><title>Advanced Headers</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" "></outline>
-<outline text="foo [bar] " _note=" "></outline>
+<outline text="foo [bar]" _note=" "></outline>
<outline text="foo[bar]" _note=" "></outline>
<outline text="foo [bar][bat]" _note=" "></outline>
<outline text="foo [bar] [bat]" _note=" "></outline>
<outline text="foo [bar][bat][baz]" _note=" 5 "></outline>
<outline text="foo [bar]" _note=" "></outline>
-<outline text="*foo* bar " _note=" "></outline>
+<outline text="*foo* bar" _note=" "></outline>
<outline text="*foo bar*" _note=" [bar] [foo][bar] "></outline>
<outline text="Metadata">
<outline text="title" _note="Advanced Headers"/>
\def\mytitle{Advanced Headers}
\input{mmd6-article-begin}
-\part{foo }
+\part{foo}
\label{bar}
\part{foo}
\part{foo bar (\autoref{bat})}
\label{foobarbat}
-\part{foo bar (\autoref{bar}) }
+\part{foo bar (\autoref{bar})}
\label{bat}
\part{foo bar (\autoref{bat})}
5
-\part{foo }
+\part{foo}
\label{bar}
-\part{\emph{foo} bar }
+\part{\emph{foo} bar}
\label{foobar}
\part{\emph{foo
<office:text>
<text:p text:style-name="Standard">foo</text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="headingfoo"/>Heading <text:span text:style-name="MMD-Italic">foo</text:span> </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="headingfoo"/>Heading <text:span text:style-name="MMD-Italic">foo</text:span></text:h>
-<text:h text:outline-level="2"><text:bookmark text:name="heading"/>Heading </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="heading"/>Heading</text:h>
<text:p text:style-name="Standard">foo
bar</text:p>
<p>foo</p>
-<h1 id="headingfoo">Heading <em>foo</em> </h1>
+<h1 id="headingfoo">Heading <em>foo</em></h1>
-<h2 id="heading">Heading </h2>
+<h2 id="heading">Heading</h2>
<p>foo
bar</p>
<p>foo</p>
-<h1>Heading <em>foo</em> </h1>
+<h1>Heading <em>foo</em></h1>
-<h2>Heading </h2>
+<h2>Heading</h2>
<p>foo
bar</p>
<head><title>Basic Blocks</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" foo "></outline>
-<outline text="Heading *foo* " _note=" "><outline text="Heading " _note=" foo bar 5 foo 	bar foo 		bar "></outline>
+<outline text="Heading *foo*" _note=" "><outline text="Heading" _note=" foo bar 5 foo 	bar foo 		bar "></outline>
</outline>
<outline text="Metadata">
<outline text="title" _note="Basic Blocks"/>
foo
-\part{Heading \emph{foo} }
+\part{Heading \emph{foo}}
\label{headingfoo}
-\chapter{Heading }
+\chapter{Heading}
\label{heading}
foo
</office:meta>
<office:body>
<office:text>
-<text:h text:outline-level="1"><text:bookmark text:name="citep"/>citep </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="citep"/>citep</text:h>
<text:p text:style-name="Standard"><text:note text:id="cite1" text:note-class="endnote"><text:note-body><text:p text:style-name="Footnote">John Doe. <text:span text:style-name="MMD-Italic">A Totally Fake Book 1</text:span>. Vanity Press, 2006.</text:p></text:note-body></text:note></text:p>
<text:p text:style-name="Standard"><text:span text:style-name="Footnote_20_anchor"><text:note-ref text:note-class="endnote" text:reference-format="text" text:ref-name="cite1">1</text:note-ref></text:span><text:note text:id="cite2" text:note-class="endnote"><text:note-body><text:p text:style-name="Footnote">John Doe. <text:span text:style-name="MMD-Italic">A Totally Fake Book 2</text:span>. Vanity Press, 2006.</text:p></text:note-body></text:note></text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="citet"/>citet </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="citet"/>citet</text:h>
<text:p text:style-name="Standard"><text:span text:style-name="Footnote_20_anchor"><text:note-ref text:note-class="endnote" text:reference-format="text" text:ref-name="cite1">1</text:note-ref></text:span></text:p>
</head>
<body>
-<h1 id="citep">citep </h1>
+<h1 id="citep">citep</h1>
<p><a href="#cn:1" id="cnref:1" title="see citation" class="citation">(1)</a></p>
<p><a href="#cn:1" title="see citation" class="citation">(1)</a><a href="#cn:2" id="cnref:2" title="see citation" class="citation">(2)</a></p>
-<h1 id="citet">citet </h1>
+<h1 id="citet">citet</h1>
<p><a href="#cn:1" title="see citation" class="citation">(1)</a></p>
<p>Title: Citations
latex config: article</p>
-<h1>citep </h1>
+<h1>citep</h1>
<p>[#foo1]</p>
<p>[#foo1][#foo2]</p>
-<h1>citet </h1>
+<h1>citet</h1>
<p>[#foo1;]</p>
<head><title>Citations</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" "></outline>
-<outline text="citep " _note=" [#foo1] [#foo1][] [p. 123][#foo1] [][#foo1] [foo\]\[bar][#foo1] [#foo1][#foo2] "></outline>
-<outline text="citet " _note=" [#foo1;] [#foo1;][] [p. 123][#foo1;] [][#foo1;] [foo\]\[bar][#foo1;] [#foo1;][#foo2;] [Not Cited][#foo3] [#foo1]: John Doe. *A Totally Fake Book 1*. Vanity Press, 2006. [#foo2]: John Doe. *A Totally Fake Book 2*. Vanity Press, 2006. [#foo3]: John Doe. *A Totally Fake Book 3*. Vanity Press, 2006. "></outline>
+<outline text="citep" _note=" [#foo1] [#foo1][] [p. 123][#foo1] [][#foo1] [foo\]\[bar][#foo1] [#foo1][#foo2] "></outline>
+<outline text="citet" _note=" [#foo1;] [#foo1;][] [p. 123][#foo1;] [][#foo1;] [foo\]\[bar][#foo1;] [#foo1;][#foo2;] [Not Cited][#foo3] [#foo1]: John Doe. *A Totally Fake Book 1*. Vanity Press, 2006. [#foo2]: John Doe. *A Totally Fake Book 2*. Vanity Press, 2006. [#foo3]: John Doe. *A Totally Fake Book 3*. Vanity Press, 2006. "></outline>
<outline text="Metadata">
<outline text="title" _note="Citations"/>
<outline text="latexconfig" _note="article"/>
\def\mytitle{Citations}
\input{mmd6-article-begin}
-\part{citep }
+\part{citep}
\label{citep}
~\citep{foo1}
~\citep{foo1}~\citep{foo2}
-\part{citet }
+\part{citet}
\label{citet}
\citet{foo1}
</office:meta>
<office:body>
<office:text>
-<text:h text:outline-level="1"><text:bookmark text:name="asection"/>A Section </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="asection"/>A Section</text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="109canstartwithdigit"/>109&*&#()^ Can Start With Digit </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="109canstartwithdigit"/>109&*&#()^ Can Start With Digit</text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="stripoutcharacters"/>Strip out &%^ characters &*^ </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="stripoutcharacters"/>Strip out &%^ characters &*^</text:h>
<text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="#asection">A Section</text:a>.</text:p>
-<text:h text:outline-level="2"><text:bookmark text:name="1cross-references:specialcharacters"/>1 Cross-References: Special Characters!@#$%&*()<>^ </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="1cross-references:specialcharacters"/>1 Cross-References: Special Characters!@#$%&*()<>^</text:h>
<text:p text:style-name="Standard">5</text:p>
<text:p text:style-name="Standard">And now, link to <text:a xlink:type="simple" xlink:href="#1cross-references:specialcharacters">1 Cross-References: Special Characters!@#$%&*()<>^</text:a></text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="Заголовокпо-русски"/>Заголовок по-русски </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="Заголовокпо-русски"/>Заголовок по-русски</text:h>
<text:p text:style-name="Standard">И ссылка на <text:a xlink:type="simple" xlink:href="#Заголовокпо-русски">Заголовок по-русски</text:a>.</text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="test的multibyte"/>Test 的 Multibyte </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="test的multibyte"/>Test 的 Multibyte</text:h>
<text:p text:style-name="Standard">10</text:p>
</office:text>
</head>
<body>
-<h1 id="asection">A Section </h1>
+<h1 id="asection">A Section</h1>
-<h1 id="109canstartwithdigit">109&*&#()^ Can Start With Digit </h1>
+<h1 id="109canstartwithdigit">109&*&#()^ Can Start With Digit</h1>
-<h1 id="stripoutcharacters">Strip out &%^ characters &*^ </h1>
+<h1 id="stripoutcharacters">Strip out &%^ characters &*^</h1>
<p><a href="#asection">A Section</a>.</p>
-<h2 id="1cross-references:specialcharacters">1 Cross-References: Special Characters!@#$%&*()<>^ </h2>
+<h2 id="1cross-references:specialcharacters">1 Cross-References: Special Characters!@#$%&*()<>^</h2>
<p>5</p>
<p>And now, link to <a href="#1cross-references:specialcharacters">1 Cross-References: Special Characters!@#$%&*()<>^</a></p>
-<h1 id="Заголовокпо-русски">Заголовок по-русски </h1>
+<h1 id="Заголовокпо-русски">Заголовок по-русски</h1>
<p>И ссылка на <a href="#Заголовокпо-русски">Заголовок по-русски</a>.</p>
-<h1 id="test的multibyte">Test 的 Multibyte </h1>
+<h1 id="test的multibyte">Test 的 Multibyte</h1>
<p>10</p>
<p>Title: Cross-References
latex config: article</p>
-<h1>A Section </h1>
+<h1>A Section</h1>
-<h1>109&*&#()^ Can Start With Digit </h1>
+<h1>109&*&#()^ Can Start With Digit</h1>
-<h1>Strip out &%^ characters &*^ </h1>
+<h1>Strip out &%^ characters &*^</h1>
<p>[A Section].</p>
-<h2>1 Cross-References: Special Characters!@#$%&*()<>^ </h2>
+<h2>1 Cross-References: Special Characters!@#$%&*()<>^</h2>
<p>5</p>
<p>And now, link to [1 Cross-References: Special Characters!@#$%&*()<>^][]</p>
-<h1>Заголовок по-русски </h1>
+<h1>Заголовок по-русски</h1>
<p>И ссылка на [Заголовок по-русски].</p>
-<h1>Test 的 Multibyte </h1>
+<h1>Test 的 Multibyte</h1>
<p>10</p>
<head><title>Cross-References</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" "></outline>
-<outline text="A Section " _note=" "></outline>
-<outline text="109&*&#()^ Can Start With Digit " _note=" "></outline>
-<outline text="Strip out &%^ characters &*^ " _note=" [A Section]. "><outline text="1 Cross-References: Special Characters!@#$%&*()<>^ " _note=" 5 And now, link to [1 Cross-References: Special Characters!@#$%&*()<>^][] "></outline>
+<outline text="A Section" _note=" "></outline>
+<outline text="109&*&#()^ Can Start With Digit" _note=" "></outline>
+<outline text="Strip out &%^ characters &*^" _note=" [A Section]. "><outline text="1 Cross-References: Special Characters!@#$%&*()<>^" _note=" 5 And now, link to [1 Cross-References: Special Characters!@#$%&*()<>^][] "></outline>
</outline>
-<outline text="Заголовок по-русски " _note=" И ссылка на [Заголовок по-русски]. "></outline>
-<outline text="Test 的 Multibyte " _note=" 10 "></outline>
+<outline text="Заголовок по-русски" _note=" И ссылка на [Заголовок по-русски]. "></outline>
+<outline text="Test 的 Multibyte" _note=" 10 "></outline>
<outline text="Metadata">
<outline text="title" _note="Cross-References"/>
<outline text="latexconfig" _note="article"/>
\def\mytitle{Cross-References}
\input{mmd6-article-begin}
-\part{A Section }
+\part{A Section}
\label{asection}
-\part{109\&*\&\#()\^{} Can Start With Digit }
+\part{109\&*\&\#()\^{} Can Start With Digit}
\label{109canstartwithdigit}
-\part{Strip out \&\%\^{} characters \&*\^{} }
+\part{Strip out \&\%\^{} characters \&*\^{}}
\label{stripoutcharacters}
A Section (\autoref{asection}).
-\chapter{1 Cross-References: Special Characters!@\#\$\%\&*()<>\^{} }
+\chapter{1 Cross-References: Special Characters!@\#\$\%\&*()<>\^{}}
\label{1cross-references:specialcharacters}
5
And now, link to 1 Cross-References: Special Characters!@\#\$\%\&*()<>\^{} (\autoref{1cross-references:specialcharacters})
-\part{Заголовок по-русски }
+\part{Заголовок по-русски}
\label{Заголовокпо-русски}
И ссылка на Заголовок по-русски (\autoref{Заголовокпо-русски}).
-\part{Test 的 Multibyte }
+\part{Test 的 Multibyte}
\label{test的multibyte}
10
<h2>bar</h2>
-<h3>baz </h3>
+<h3>baz</h3>
<h4>foo ##</h4>
-<h5>bar ## </h5>
+<h5>bar ##</h5>
<h6>baz</h6>
</text:list>
-<text:h text:outline-level="2"><text:bookmark text:name="escaped"/>:Escapes </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="escaped"/>:Escapes</text:h>
<text:p text:style-name="Standard">[>MM]: MultiMarkdown</text:p>
\end{itemize}
-\chapter{:Escapes }
+\chapter{:Escapes}
\label{escaped}
[>MM]: MultiMarkdown
<text:p text:style-name="Standard">10</text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="foo2"/>foo2 </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="foo2"/>foo2</text:h>
<text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="#foo2">foo</text:a></text:p>
<div>
-<h1 id="foo2">foo2 </h1>
+<h1 id="foo2">foo2</h1>
<p><a href="#foo2">foo</a></p>
<div>
-<h1>foo2 </h1>
+<h1>foo2</h1>
<p>[foo][foo2]</p>
<head><title>HTML Blocks</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" <del>*bar1*</del> <del> *bar2* </del> foo <del> *bar3* </del> <del> *bar4* </del> <del> *bar5* </del> 5 <div>*bar1*</div> <div> *bar2* </div> foo <div> *bar3* </div> <div> *bar4* </div> <div> *bar5* </div> 10 <div> # foo1 # [foo][foo1] </div> <div> "></outline>
-<outline text="foo2 " _note=" [foo][foo2] </div> <!-- This is a *comment* --> <!-- This is a longer *comment* --> <!-- This is a comment --> 15 <!-- This is not a *comment* --> <div> <div> **foo1** </div> </div> <div> <div> **foo2** </div> </div> <div> <div> **foo3** </div> </div> <div> <div> **foo4** </div> </div> 20 <div> <div> **foo5** </div> </div> "></outline>
+<outline text="foo2" _note=" [foo][foo2] </div> <!-- This is a *comment* --> <!-- This is a longer *comment* --> <!-- This is a comment --> 15 <!-- This is not a *comment* --> <div> <div> **foo1** </div> </div> <div> <div> **foo2** </div> </div> <div> <div> **foo3** </div> </div> <div> <div> **foo4** </div> </div> 20 <div> <div> **foo5** </div> </div> "></outline>
<outline text="Metadata">
<outline text="title" _note="HTML Blocks"/>
<outline text="latexconfig" _note="article"/>
10
-\part{foo2 }
+\part{foo2}
\label{foo2}
foo (\autoref{foo2})
</office:meta>
<office:body>
<office:text>
-<text:h text:outline-level="1"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="foo"/>foo</text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="foo"/>foo</text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="foo"/>foo</text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="foo"/>foo</text:h>
<text:p text:style-name="Preformatted Text"># foo #<text:line-break/></text:p>
<text:p text:style-name="Standard"># foo #</text:p>
-<text:h text:outline-level="2"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="foo"/>foo</text:h>
<text:p text:style-name="Standard">10</text:p>
-<text:h text:outline-level="3"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="3"><text:bookmark text:name="foo"/>foo</text:h>
-<text:h text:outline-level="4"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="4"><text:bookmark text:name="foo"/>foo</text:h>
-<text:h text:outline-level="5"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="5"><text:bookmark text:name="foo"/>foo</text:h>
-<text:h text:outline-level="6"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="6"><text:bookmark text:name="foo"/>foo</text:h>
<text:p text:style-name="Standard">####### foo #######</text:p>
<text:p text:style-name="Standard">15</text:p>
-<text:h text:outline-level="6"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="6"><text:bookmark text:name="foo"/>foo</text:h>
</office:text>
</office:body>
</office:document>
</head>
<body>
-<h1 id="foo">foo </h1>
+<h1 id="foo">foo</h1>
-<h1 id="foo">foo </h1>
+<h1 id="foo">foo</h1>
-<h1 id="foo">foo </h1>
+<h1 id="foo">foo</h1>
-<h1 id="foo">foo </h1>
+<h1 id="foo">foo</h1>
<pre><code># foo #
</code></pre>
<p># foo #</p>
-<h2 id="foo">foo </h2>
+<h2 id="foo">foo</h2>
<p>10</p>
-<h3 id="foo">foo </h3>
+<h3 id="foo">foo</h3>
-<h4 id="foo">foo </h4>
+<h4 id="foo">foo</h4>
-<h5 id="foo">foo </h5>
+<h5 id="foo">foo</h5>
-<h6 id="foo">foo </h6>
+<h6 id="foo">foo</h6>
<p>####### foo #######</p>
<p>15</p>
-<h6 id="foo">foo </h6>
+<h6 id="foo">foo</h6>
</body>
</html>
<p>Title: Headers
latex config: article</p>
-<h1>foo </h1>
+<h1>foo</h1>
-<h1>foo </h1>
+<h1>foo</h1>
-<h1>foo </h1>
+<h1>foo</h1>
-<h1>foo </h1>
+<h1>foo</h1>
<pre><code># foo #
</code></pre>
<p># foo #</p>
-<h2>foo </h2>
+<h2>foo</h2>
<p>10</p>
-<h3>foo </h3>
+<h3>foo</h3>
-<h4>foo </h4>
+<h4>foo</h4>
-<h5>foo </h5>
+<h5>foo</h5>
-<h6>foo </h6>
+<h6>foo</h6>
<p>####### foo #######</p>
<p>15</p>
-<h6>foo </h6>
+<h6>foo</h6>
<head><title>Headers</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" "></outline>
-<outline text="foo " _note=" "></outline>
-<outline text="foo " _note=" "></outline>
-<outline text="foo " _note=" "></outline>
-<outline text="foo " _note=" # foo # 5 #foo# #foo # "></outline>
-<outline text="foo # bar" _note=" \# foo # "><outline text="foo " _note=" 10 "><outline text="foo " _note=" "><outline text="foo " _note=" "><outline text="foo " _note=" "><outline text="foo " _note=" ####### foo ####### 15 "></outline>
-<outline text="foo " _note=""></outline>
+<outline text="foo" _note=" "></outline>
+<outline text="foo" _note=" "></outline>
+<outline text="foo" _note=" "></outline>
+<outline text="foo" _note=" # foo # 5 #foo# #foo # "></outline>
+<outline text="foo # bar" _note=" \# foo # "><outline text="foo" _note=" 10 "><outline text="foo" _note=" "><outline text="foo" _note=" "><outline text="foo" _note=" "><outline text="foo" _note=" ####### foo ####### 15 "></outline>
+<outline text="foo" _note=""></outline>
</outline>
</outline>
</outline>
\def\mytitle{Headers}
\input{mmd6-article-begin}
-\part{foo }
+\part{foo}
\label{foo}
-\part{foo }
+\part{foo}
\label{foo}
-\part{foo }
+\part{foo}
\label{foo}
-\part{foo }
+\part{foo}
\label{foo}
\begin{verbatim}
\# foo \#
-\chapter{foo }
+\chapter{foo}
\label{foo}
10
-\section{foo }
+\section{foo}
\label{foo}
-\subsection{foo }
+\subsection{foo}
\label{foo}
-\subsubsection{foo }
+\subsubsection{foo}
\label{foo}
-\paragraph{foo }
+\paragraph{foo}
\label{foo}
\#\#\#\#\#\#\# foo \#\#\#\#\#\#\#
15
-\paragraph{foo }
+\paragraph{foo}
\label{foo}
\input{mmd6-article-footer}
identify common structures that are not supported yet – particularly useful
when developing a new output format.</text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="basicblocks"/>Basic Blocks </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="basicblocks"/>Basic Blocks</text:h>
<text:p text:style-name="Standard">paragraph</text:p>
<text:p text:style-name="Standard"><text:span text:style-name="MMD-Italic">emph</text:span> and <text:span text:style-name="MMD-Bold">strong</text:span> and <text:span text:style-name="MMD-Bold"><text:span text:style-name="MMD-Italic">both</text:span></text:span></text:p>
-<text:h text:outline-level="2"><text:bookmark text:name="escaped"/>Escapes </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="escaped"/>Escapes</text:h>
<text:list text:style-name="L2">
<text:list-item>
</text:list>
-<text:h text:outline-level="1"><text:bookmark text:name="footnotes"/>Footnotes </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="footnotes"/>Footnotes</text:h>
<text:p text:style-name="Standard">Foo.<text:note text:id="fn1" text:note-class="footnote"><text:note-body><text:p text:style-name="Footnote">This is an inline footnote</text:p></text:note-body></text:note></text:p>
<text:p text:style-name="Standard">Cite.<text:note text:id="cite2" text:note-class="endnote"><text:note-body><text:p text:style-name="Footnote">bar</text:p></text:note-body></text:note></text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="linksandimages"/>Links and Images </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="linksandimages"/>Links and Images</text:h>
<text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="http://foo.net/">link</text:a> and <text:a xlink:type="simple" xlink:href="http://bar.net" office:name="title">link</text:a></text:p>
<text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="#bar">bar</text:a></text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="math"/>Math </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="math"/>Math</text:h>
<text:p text:style-name="Standard">foo <text:span text:style-name="math">\({e}^{i\pi }+1=0\)</text:span> bar</text:p>
<text:p text:style-name="Standard"><text:span text:style-name="math">$${x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a}$$</text:span></text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="smartquotes"/>Smart Quotes </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="smartquotes"/>Smart Quotes</text:h>
<text:p text:style-name="Standard">“foo” and ‘bar’ – with — dashes…</text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="criticmarkup"/>CriticMarkup </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="criticmarkup"/>CriticMarkup</text:h>
<text:p text:style-name="Standard"><text:span text:style-name="Underline">foo</text:span></text:p>
<text:p text:style-name="Standard"><text:span text:style-name="Highlight">bar</text:span></text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="definitionlists"/>Definition Lists </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="definitionlists"/>Definition Lists</text:h>
<text:p><text:span text:style-name="MMD-Bold">foo</text:span></text:p>
<text:p><text:span text:style-name="MMD-Bold">bar</text:span></text:p>
<text:p text:style-name="Quotations">baz bat*</text:p>
-<text:h text:outline-level="1"><text:bookmark text:name="horizontalrules"/>Horizontal Rules </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="horizontalrules"/>Horizontal Rules</text:h>
<text:p text:style-name="Horizontal_20_Line"/>
-<text:h text:outline-level="1"><text:bookmark text:name="glossary"/>Glossary </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="glossary"/>Glossary</text:h>
<text:p text:style-name="Standard">term<text:note text:id="gn1" text:note-class="glossary"><text:note-body><text:p text:style-name="Footnote">A term to be defined.</text:p></text:note-body></text:note></text:p>
identify common structures that are not supported yet – particularly useful
when developing a new output format.</p>
-<h1 id="basicblocks">Basic Blocks </h1>
+<h1 id="basicblocks">Basic Blocks</h1>
<p>paragraph</p>
<li><p>[</p></li>
</ol>
-<h1 id="footnotes">Footnotes </h1>
+<h1 id="footnotes">Footnotes</h1>
<p>Foo.<a href="#fn:1" id="fnref:1" title="see footnote" class="footnote"><sup>1</sup></a></p>
<p>Cite.<a href="#cn:2" id="cnref:2" title="see citation" class="citation">(2)</a></p>
-<h1 id="linksandimages">Links and Images </h1>
+<h1 id="linksandimages">Links and Images</h1>
<p><a href="http://foo.net/">link</a> and <a href="http://bar.net" title="title" class="custom">link</a></p>
<p><a href="#bar">bar</a></p>
-<h1 id="math">Math </h1>
+<h1 id="math">Math</h1>
<p>foo <span class="math">\({e}^{i\pi }+1=0\)</span> bar</p>
<p><span class="math">\[{x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a}\]</span></p>
-<h1 id="smartquotes">Smart Quotes </h1>
+<h1 id="smartquotes">Smart Quotes</h1>
<p>“foo” and ‘bar’ – with — dashes…</p>
-<h1 id="criticmarkup">CriticMarkup </h1>
+<h1 id="criticmarkup">CriticMarkup</h1>
<p><ins>foo</ins></p>
<p><mark>bar</mark></p>
-<h1 id="definitionlists">Definition Lists </h1>
+<h1 id="definitionlists">Definition Lists</h1>
<dl>
<dt>foo</dt>
<dd>baz bat*</dd>
</dl>
-<h1 id="horizontalrules">Horizontal Rules </h1>
+<h1 id="horizontalrules">Horizontal Rules</h1>
<hr />
-<h1 id="glossary">Glossary </h1>
+<h1 id="glossary">Glossary</h1>
<p><a href="#gn:1" id="gnref:1" title="see glossary" class="glossary">term</a></p>
identify common structures that are not supported yet -- particularly useful
when developing a new output format.</p>
-<h1>Basic Blocks </h1>
+<h1>Basic Blocks</h1>
<p>paragraph</p>
<li><p>[</p></li>
</ol>
-<h1>Footnotes </h1>
+<h1>Footnotes</h1>
<p>Foo.[^This is an inline footnote]</p>
<p>Cite.<a href="bar">#foo</a></p>
-<h1>Links and Images </h1>
+<h1>Links and Images</h1>
<p><a href="http://foo.net/">link</a> and [link]</p>
<p><a href="#bar">bar</a></p>
-<h1>Math </h1>
+<h1>Math</h1>
<p>foo \({e}^{i\pi }+1=0\) bar</p>
<p>$${x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a}$$</p>
-<h1>Smart Quotes </h1>
+<h1>Smart Quotes</h1>
<p>"foo" and 'bar' -- with --- dashes...</p>
-<h1>CriticMarkup </h1>
+<h1>CriticMarkup</h1>
<p>{++foo++}</p>
<p>{==bar==}</p>
-<h1>Definition Lists </h1>
+<h1>Definition Lists</h1>
<p>foo
bar
: <em>foo bar
: baz bat</em></p>
-<h1>Horizontal Rules </h1>
+<h1>Horizontal Rules</h1>
<hr />
-<h1>Glossary </h1>
+<h1>Glossary</h1>
<p>[?term]</p>
<head><title>Integrated</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" This file is a designed as a single test that incorporates most of the *commonly* used MultiMarkdown features. This allows a single test file to identify common structures that are not supported yet -- particularly useful when developing a new output format. "></outline>
-<outline text="Basic Blocks " _note=" paragraph * list * items ``` fenced code ``` 	indented 	code > blockquote `code span` *emph* and **strong** and ***both*** _emph_ and __strong__ and ___both___ "><outline text="Escapes [escaped]" _note=" 1. \$ 2. \# 3. \[ "></outline>
+<outline text="Basic Blocks" _note=" paragraph * list * items ``` fenced code ``` 	indented 	code > blockquote `code span` *emph* and **strong** and ***both*** _emph_ and __strong__ and ___both___ "><outline text="Escapes [escaped]" _note=" 1. \$ 2. \# 3. \[ "></outline>
</outline>
-<outline text="Footnotes " _note=" Foo.[^This is an inline footnote] Bar.[^foot] [^foot]: And a reference footnote. Cite.[#Inline Citation] Cite.[#foo] [#foo]: bar "></outline>
-<outline text="Links and Images " _note=" [link](http://foo.net/) and [link] [link]: http://bar.net "title" class="custom" ![test](http://foo.bar/ "title" width="40px" height=400px) [Math] [foo][math] [bar][foo1] [bar][foo2] [foo1]: #bar [foo2]: #bar "></outline>
-<outline text="Math " _note=" foo \\({e}^{i\pi }+1=0\\) bar \\[ {x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a} \\] foo ${e}^{i\pi }+1=0$ bar foo ${e}^{i\pi }+1=0$, bar $${x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a}$$ "></outline>
-<outline text="Smart Quotes " _note=" "foo" and 'bar' -- with --- dashes... "></outline>
-<outline text="CriticMarkup " _note=" {++foo++} {--bar--} {~~foo~>bar~~} {>>foo<<} {==bar==} "></outline>
-<outline text="Definition Lists " _note=" foo bar :	*foo bar :	baz bat* "></outline>
-<outline text="Horizontal Rules " _note=" ---- "></outline>
-<outline text="Glossary " _note=" [?term] [?term]: A term to be defined. "></outline>
+<outline text="Footnotes" _note=" Foo.[^This is an inline footnote] Bar.[^foot] [^foot]: And a reference footnote. Cite.[#Inline Citation] Cite.[#foo] [#foo]: bar "></outline>
+<outline text="Links and Images" _note=" [link](http://foo.net/) and [link] [link]: http://bar.net "title" class="custom" ![test](http://foo.bar/ "title" width="40px" height=400px) [Math] [foo][math] [bar][foo1] [bar][foo2] [foo1]: #bar [foo2]: #bar "></outline>
+<outline text="Math" _note=" foo \\({e}^{i\pi }+1=0\\) bar \\[ {x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a} \\] foo ${e}^{i\pi }+1=0$ bar foo ${e}^{i\pi }+1=0$, bar $${x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a}$$ "></outline>
+<outline text="Smart Quotes" _note=" "foo" and 'bar' -- with --- dashes... "></outline>
+<outline text="CriticMarkup" _note=" {++foo++} {--bar--} {~~foo~>bar~~} {>>foo<<} {==bar==} "></outline>
+<outline text="Definition Lists" _note=" foo bar :	*foo bar :	baz bat* "></outline>
+<outline text="Horizontal Rules" _note=" ---- "></outline>
+<outline text="Glossary" _note=" [?term] [?term]: A term to be defined. "></outline>
<outline text="Abbreviations" _note=" [>MMD] [>MMD]: MultiMarkdown "></outline>
<outline text="Metadata">
<outline text="title" _note="Integrated"/>
identify common structures that are not supported yet -- particularly useful
when developing a new output format.
-\part{Basic Blocks }
+\part{Basic Blocks}
\label{basicblocks}
paragraph
\emph{emph} and \textbf{strong} and \textbf{\emph{both}}
-\chapter{Escapes }
+\chapter{Escapes}
\label{escaped}
\begin{enumerate}
\end{enumerate}
-\part{Footnotes }
+\part{Footnotes}
\label{footnotes}
Foo.\footnote{This is an inline footnote}
Cite.~\citep{foo}
-\part{Links and Images }
+\part{Links and Images}
\label{linksandimages}
\href{http://foo.net/}{link}\footnote{\href{http://foo.net/}{http:\slash \slash foo.net\slash }} and \href{http://bar.net}{link}\footnote{\href{http://bar.net}{http:\slash \slash bar.net}}
bar (\autoref{bar})
-\part{Math }
+\part{Math}
\label{math}
foo \({e}^{i\pi }+1=0\) bar
$${x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a}$$
-\part{Smart Quotes }
+\part{Smart Quotes}
\label{smartquotes}
``foo'' and `bar' -- with --- dashes{\ldots}
-\part{CriticMarkup }
+\part{CriticMarkup}
\label{criticmarkup}
\underline{foo}
\hl{bar}
-\part{Definition Lists }
+\part{Definition Lists}
\label{definitionlists}
\begin{description}
baz bat*
\end{description}
-\part{Horizontal Rules }
+\part{Horizontal Rules}
\label{horizontalrules}
\begin{center}\rule{3in}{0.4pt}\end{center}
-\part{Glossary }
+\part{Glossary}
\label{glossary}
\gls{term}
</office:meta>
<office:body>
<office:text>
-<text:h text:outline-level="2"><text:bookmark text:name="foobar"/>Foo Bar </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="foobar"/>Foo Bar</text:h>
<text:p text:style-name="Standard">Link to <text:a xlink:type="simple" xlink:href="#foobar">Foo Bar</text:a>.</text:p>
</head>
<body>
-<h2 id="foobar">Foo Bar </h2>
+<h2 id="foobar">Foo Bar</h2>
<p>Link to <a href="#foobar">Foo Bar</a>.</p>
<p>Title: Link Variations
latex config: article</p>
-<h2>Foo Bar </h2>
+<h2>Foo Bar</h2>
<p>Link to [Foo Bar].</p>
<head><title>Link Variations</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" "></outline>
-<outline text="Foo Bar " _note=" Link to [Foo Bar]. Link to [foo bar]. Link to [foobar]. Link to [Foo Bar](#foobar). Link to [](#foobar). 5 Link to [Foo][Foo Bar]. [& link](http://example.com/?bar=foo&foo=bar) ['%' Link](http://example.com/%25%20link) ['#' link](http://example.com/#foo) 10 [_ link](http://example.com/_foo) [~ link](http://example.com/~foo)"></outline>
+<outline text="Foo Bar" _note=" Link to [Foo Bar]. Link to [foo bar]. Link to [foobar]. Link to [Foo Bar](#foobar). Link to [](#foobar). 5 Link to [Foo][Foo Bar]. [& link](http://example.com/?bar=foo&foo=bar) ['%' Link](http://example.com/%25%20link) ['#' link](http://example.com/#foo) 10 [_ link](http://example.com/_foo) [~ link](http://example.com/~foo)"></outline>
<outline text="Metadata">
<outline text="title" _note="Link Variations"/>
<outline text="latexconfig" _note="article"/>
\def\mytitle{Link Variations}
\input{mmd6-article-begin}
-\chapter{Foo Bar }
+\chapter{Foo Bar}
\label{foobar}
Link to Foo Bar (\autoref{foobar}).
</office:meta>
<office:body>
<office:text>
-<text:h text:outline-level="1"><text:bookmark text:name="markdown:syntax"/>Markdown: Syntax </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="markdown:syntax"/>Markdown: Syntax</text:h>
<text:list text:style-name="L1">
<text:list-item>
-<h1 id="markdown:syntax">Markdown: Syntax </h1>
+<h1 id="markdown:syntax">Markdown: Syntax</h1>
<ul id="ProjectSubmenu">
<li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li>
-<h1>Markdown: Syntax </h1>
+<h1>Markdown: Syntax</h1>
<ul id="ProjectSubmenu">
<li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li>
<?xml version="1.0" encoding="utf-8"?>
<opml version="1.0">
<body>
-<outline text="Markdown: Syntax " _note=" <ul id="ProjectSubmenu"> <li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li> <li><a href="/projects/markdown/basics" title="Markdown Basics">Basics</a></li> <li><a class="selected" title="Markdown Syntax Documentation">Syntax</a></li> <li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li> <li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li> </ul> * [Overview](#overview) * [Philosophy](#philosophy) * [Inline HTML](#html) * [Automatic Escaping for Special Characters](#autoescape) * [Block Elements](#block) * [Paragraphs and Line Breaks](#p) * [Headers](#header) * [Blockquotes](#blockquote) * [Lists](#list) * [Code Blocks](#precode) * [Horizontal Rules](#hr) * [Span Elements](#span) * [Links](#link) * [Emphasis](#em) * [Code](#code) * [Images](#img) * [Miscellaneous](#misc) * [Backslash Escapes](#backslash) * [Automatic Links](#autolink) **Note:** This document is itself written using Markdown; you can [see the source for it by adding '.text' to the URL][src]. [src]: /projects/markdown/syntax.text * * * <h2 id="overview">Overview</h2> <h3 id="philosophy">Philosophy</h3> Markdown is intended to be as easy-to-read and easy-to-write as is feasible. Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions. While Markdown's syntax has been influenced by several existing text-to-HTML filters -- including [Setext][1], [atx][2], [Textile][3], [reStructuredText][4], [Grutatext][5], and [EtText][6] -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email. [1]: http://docutils.sourceforge.net/mirror/setext.html [2]: http://www.aaronsw.com/2002/atx/ [3]: http://textism.com/tools/textile/ [4]: http://docutils.sourceforge.net/rst.html [5]: http://www.triptico.com/software/grutatxt.html [6]: http://ettext.taint.org/doc/ To this end, Markdown's syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like \*emphasis\*. Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you've ever used email. <h3 id="html">Inline HTML</h3> Markdown's syntax is intended for one purpose: to be used as a format for *writing* for the web. Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags. The idea is *not* to create a syntax that makes it easier to insert HTML tags. In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a *publishing* format; Markdown is a *writing* format. Thus, Markdown's formatting syntax only addresses issues that can be conveyed in plain text. For any markup that is not covered by Markdown's syntax, you simply use HTML itself. There's no need to preface it or delimit it to indicate that you're switching from Markdown to HTML; you just use the tags. The only restrictions are that block-level HTML elements -- e.g. `<div>`, `<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) `<p>` tags around HTML block-level tags. For example, to add an HTML table to a Markdown article: This is a regular paragraph. <table> <tr> <td>Foo</td> </tr> </table> This is another regular paragraph. Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an HTML block. Span-level HTML tags -- e.g. `<span>`, `<cite>`, or `<del>` -- can be used anywhere in a Markdown paragraph, list item, or header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you'd prefer to use HTML `<a>` or `<img>` tags instead of Markdown's link or image syntax, go right ahead. Unlike block-level HTML tags, Markdown syntax *is* processed within span-level tags. <h3 id="autoescape">Automatic Escaping for Special Characters</h3> In HTML, there are two characters that demand special treatment: `<` and `&`. Left angle brackets are used to start tags; ampersands are used to denote HTML entities. If you want to use them as literal characters, you must escape them as entities, e.g. `&lt;`, and `&amp;`. Ampersands in particular are bedeviling for web writers. If you want to write about 'AT&T', you need to write '`AT&amp;T`'. You even need to escape ampersands within URLs. Thus, if you want to link to: http://images.google.com/images?num=30&q=larry+bird you need to encode the URL as: http://images.google.com/images?num=30&amp;q=larry+bird in your anchor tag `href` attribute. Needless to say, this is easy to forget, and is probably the single most common source of HTML validation errors in otherwise well-marked-up web sites. Markdown allows you to use these characters naturally, taking care of all the necessary escaping for you. If you use an ampersand as part of an HTML entity, it remains unchanged; otherwise it will be translated into `&amp;`. So, if you want to include a copyright symbol in your article, you can write: &copy; and Markdown will leave it alone. But if you write: AT&T Markdown will translate it to: AT&amp;T Similarly, because Markdown supports [inline HTML](#html), if you use angle brackets as delimiters for HTML tags, Markdown will treat them as such. But if you write: 4 < 5 Markdown will translate it to: 4 &lt; 5 However, inside Markdown code spans and blocks, angle brackets and ampersands are *always* encoded automatically. This makes it easy to use Markdown to write about HTML code. (As opposed to raw HTML, which is a terrible format for writing about HTML syntax, because every single `<` and `&` in your example code needs to be escaped.) * * * <h2 id="block">Block Elements</h2> <h3 id="p">Paragraphs and Line Breaks</h3> A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs. The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a `<br />` tag. When you *do* want to insert a `<br />` break tag using Markdown, you end a line with two or more spaces, then type return. Yes, this takes a tad more effort to create a `<br />`, but a simplistic "every line break is a `<br />`" rule wouldn't work for Markdown. Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] work best -- and look better -- when you format them with hard breaks. [bq]: #blockquote [l]: #list <h3 id="header">Headers</h3> Markdown supports two styles of headers, [Setext][1] and [atx][2]. Setext-style headers are "underlined" using equal signs (for first-level headers) and dashes (for second-level headers). For example: This is an H1 ============= This is an H2 ------------- Any number of underlining `=`'s or `-`'s will work. Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. For example: # This is an H1 ## This is an H2 ###### This is an H6 Optionally, you may "close" atx-style headers. This is purely cosmetic -- you can use this if you think it looks better. The closing hashes don't even need to match the number of hashes used to open the header. (The number of opening hashes determines the header level.) : # This is an H1 # ## This is an H2 ## ### This is an H3 ###### <h3 id="blockquote">Blockquotes</h3> Markdown uses email-style `>` characters for blockquoting. If you're familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a `>` before every line: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse > id sem consectetuer libero luctus adipiscing. Markdown allows you to be lazy and only put the `>` before the first line of a hard-wrapped paragraph: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of `>`: > This is the first level of quoting. > > > This is nested blockquote. > > Back to the first level. Blockquotes can contain other Markdown elements, including headers, lists, and code blocks: 	> ## This is a header. 	> 	> 1. This is the first list item. 	> 2. This is the second list item. 	> 	> Here's some example code: 	> 	> return shell_exec("echo $input | $markdown_script"); Any decent text editor should make email-style quoting easy. For example, with BBEdit, you can make a selection and choose Increase Quote Level from the Text menu. <h3 id="list">Lists</h3> Markdown supports ordered (numbered) and unordered (bulleted) lists. Unordered lists use asterisks, pluses, and hyphens -- interchangably -- as list markers: * Red * Green * Blue is equivalent to: + Red + Green + Blue and: - Red - Green - Blue Ordered lists use numbers followed by periods: 1. Bird 2. McHale 3. Parish It's important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces. The HTML Markdown produces from the above list is: <ol> <li>Bird</li> <li>McHale</li> <li>Parish</li> </ol> If you instead wrote the list in Markdown like this: 1. Bird 1. McHale 1. Parish or even: 3. Bird 1. McHale 8. Parish you'd get the exact same HTML output. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don't have to. If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future, Markdown may support starting ordered lists at an arbitrary number. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab. To make lists look nice, you can wrap items with hanging indents: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. But if you want to be lazy, you don't have to: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. If list items are separated by blank lines, Markdown will wrap the items in `<p>` tags in the HTML output. For example, this input: * Bird * Magic will turn into: <ul> <li>Bird</li> <li>Magic</li> </ul> But this: * Bird * Magic will turn into: <ul> <li><p>Bird</p></li> <li><p>Magic</p></li> </ul> List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab: 1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 2. Suspendisse id sem consectetuer libero luctus adipiscing. It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy: * This is a list item with two paragraphs. This is the second paragraph in the list item. You're only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. * Another item in the same list. To put a blockquote within a list item, the blockquote's `>` delimiters need to be indented: * A list item with a blockquote: > This is a blockquote > inside a list item. To put a code block within a list item, the code block needs to be indented *twice* -- 8 spaces or two tabs: * A list item with a code block: <code goes here> It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this: 1986. What a great season. In other words, a *number-period-space* sequence at the beginning of a line. To avoid this, you can backslash-escape the period: 1986\. What a great season. <h3 id="precode">Code Blocks</h3> Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal paragraphs, the lines of a code block are interpreted literally. Markdown wraps a code block in both `<pre>` and `<code>` tags. To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab. For example, given this input: This is a normal paragraph: This is a code block. Markdown will generate: <p>This is a normal paragraph:</p> <pre><code>This is a code block. </code></pre> One level of indentation -- 4 spaces or 1 tab -- is removed from each line of the code block. For example, this: Here is an example of AppleScript: tell application "Foo" beep end tell will turn into: <p>Here is an example of AppleScript:</p> <pre><code>tell application "Foo" beep end tell </code></pre> A code block continues until it reaches a line that is not indented (or the end of the article). Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown -- just paste it and indent it, and Markdown will handle the hassle of encoding the ampersands and angle brackets. For example, this: <div class="footer"> &copy; 2004 Foo Corporation </div> will turn into: <pre><code>&lt;div class="footer"&gt; &amp;copy; 2004 Foo Corporation &lt;/div&gt; </code></pre> Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block. This means it's also easy to use Markdown to write about Markdown's own syntax. <h3 id="hr">Horizontal Rules</h3> You can produce a horizontal rule tag (`<hr />`) by placing three or more hyphens, asterisks, or underscores on a line by themselves. If you wish, you may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule: * * * *** ***** - - - --------------------------------------- * * * <h2 id="span">Span Elements</h2> <h3 id="link">Links</h3> Markdown supports two style of links: *inline* and *reference*. In both styles, the link text is delimited by [square brackets]. To create an inline link, use a set of regular parentheses immediately after the link text's closing square bracket. Inside the parentheses, put the URL where you want the link to point, along with an *optional* title for the link, surrounded in quotes. For example: This is [an example](http://example.com/ "Title") inline link. [This link](http://example.net/) has no title attribute. Will produce: <p>This is <a href="http://example.com/" title="Title"> an example</a> inline link.</p> <p><a href="http://example.net/">This link</a> has no title attribute.</p> If you're referring to a local resource on the same server, you can use relative paths: See my [About](/about/) page for details. Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link: This is [an example][id] reference-style link. You can optionally use a space to separate the sets of brackets: This is [an example] [id] reference-style link. Then, anywhere in the document, you define your link label like this, on a line by itself: [id]: http://example.com/ "Optional Title Here" That is: * Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces); * followed by a colon; * followed by one or more spaces (or tabs); * followed by the URL for the link; * optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses. The following three link definitions are equivalent: 	[foo]: http://example.com/ "Optional Title Here" 	[foo]: http://example.com/ 'Optional Title Here' 	[foo]: http://example.com/ (Optional Title Here) **Note:** There is a known bug in Markdown.pl 1.0.1 which prevents single quotes from being used to delimit link titles. The link URL may, optionally, be surrounded by angle brackets: [id]: <http://example.com/> "Optional Title Here" You can put the title attribute on the next line and use extra spaces or tabs for padding, which tends to look better with longer URLs: [id]: http://example.com/longish/path/to/resource/here "Optional Title Here" Link definitions are only used for creating links during Markdown processing, and are stripped from your document in the HTML output. Link definition names may consist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: 	[link text][a] 	[link text][A] are equivalent. The *implicit link name* shortcut allows you to omit the name of the link, in which case the link text itself is used as the name. Just use an empty set of square brackets -- e.g., to link the word "Google" to the google.com web site, you could simply write: 	[Google][] And then define the link: 	[Google]: http://google.com/ Because link names may contain spaces, this shortcut even works for multiple words in the link text: 	Visit [Daring Fireball][] for more information. And then define the link: 	 	[Daring Fireball]: http://daringfireball.net/ Link definitions can be placed anywhere in your Markdown document. I tend to put them immediately after each paragraph in which they're used, but if you want, you can put them all at the end of your document, sort of like footnotes. Here's an example of reference links in action: I get 10 times more traffic from [Google] [1] than from [Yahoo] [2] or [MSN] [3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [3]: http://search.msn.com/ "MSN Search" Using the implicit link name shortcut, you could instead write: I get 10 times more traffic from [Google][] than from [Yahoo][] or [MSN][]. [google]: http://google.com/ "Google" [yahoo]: http://search.yahoo.com/ "Yahoo Search" [msn]: http://search.msn.com/ "MSN Search" Both of the above examples will produce the following HTML output: <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a> than from <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p> For comparison, here is the same paragraph written using Markdown's inline link style: I get 10 times more traffic from [Google](http://google.com/ "Google") than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or [MSN](http://search.msn.com/ "MSN Search"). The point of reference-style links is not that they're easier to write. The point is that with reference-style links, your document source is vastly more readable. Compare the above examples: using reference-style links, the paragraph itself is only 81 characters long; with inline-style links, it's 176 characters; and as raw HTML, it's 234 characters. In the raw HTML, there's more markup than there is text. With Markdown's reference-style links, a source document much more closely resembles the final output, as rendered in a browser. By allowing you to move the markup-related metadata out of the paragraph, you can add links without interrupting the narrative flow of your prose. <h3 id="em">Emphasis</h3> Markdown treats asterisks (`*`) and underscores (`_`) as indicators of emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML `<strong>` tag. E.g., this input: *single asterisks* _single underscores_ **double asterisks** __double underscores__ will produce: <em>single asterisks</em> <em>single underscores</em> <strong>double asterisks</strong> <strong>double underscores</strong> You can use whichever style you prefer; the lone restriction is that the same character must be used to open and close an emphasis span. Emphasis can be used in the middle of a word: un*frigging*believable But if you surround an `*` or `_` with spaces, it'll be treated as a literal asterisk or underscore. To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it: \*this text is surrounded by literal asterisks\* <h3 id="code">Code</h3> To indicate a span of code, wrap it with backtick quotes (`` ` ``). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example: Use the `printf()` function. will produce: <p>Use the <code>printf()</code> function.</p> To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters: ``There is a literal backtick (`) here.`` which will produce this: <p><code>There is a literal backtick (`) here.</code></p> The backtick delimiters surrounding a code span may include spaces -- one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span: 	A single backtick in a code span: `` ` `` 	 	A backtick-delimited string in a code span: `` `foo` `` will produce: 	<p>A single backtick in a code span: <code>`</code></p> 	 	<p>A backtick-delimited string in a code span: <code>`foo`</code></p> With a code span, ampersands and angle brackets are encoded as HTML entities automatically, which makes it easy to include example HTML tags. Markdown will turn this: Please don't use any `<blink>` tags. into: <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p> You can write this: `&#8212;` is the decimal-encoded equivalent of `&mdash;`. to produce: <p><code>&amp;#8212;</code> is the decimal-encoded equivalent of <code>&amp;mdash;</code>.</p> <h3 id="img">Images</h3> Admittedly, it's fairly difficult to devise a "natural" syntax for placing images into a plain text document format. Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: *inline* and *reference*. Inline image syntax looks like this: ![Alt text](/path/to/img.jpg) ![Alt text](/path/to/img.jpg "Optional title") That is: * An exclamation mark: `!`; * followed by a set of square brackets, containing the `alt` attribute text for the image; * followed by a set of parentheses, containing the URL or path to the image, and an optional `title` attribute enclosed in double or single quotes. Reference-style image syntax looks like this: ![Alt text][id] Where "id" is the name of a defined image reference. Image references are defined using syntax identical to link references: [id]: url/to/image "Optional title attribute" As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can simply use regular HTML `<img>` tags. * * * <h2 id="misc">Miscellaneous</h2> <h3 id="autolink">Automatic Links</h3> 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: <http://example.com/> Markdown will turn this into: <a href="http://example.com/">http://example.com/</a> Automatic links for email addresses work similarly, except that Markdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots. For example, Markdown will turn this: <address@example.com> into something like this: <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65; &#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111; &#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61; &#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a> which will render in a browser as a clickable link to "address@example.com". (This sort of entity-encoding trick will indeed fool many, if not most, address-harvesting bots, but it definitely won't fool all of them. It's better than nothing, but an address published in this way will probably eventually start receiving spam.) <h3 id="backslash">Backslash Escapes</h3> Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown's formatting syntax. For example, if you wanted to surround a word with literal asterisks (instead of an HTML `<em>` tag), you can use backslashes before the asterisks, like this: \*literal asterisks\* Markdown provides backslash escapes for the following characters: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark 	+ plus sign 	- minus sign (hyphen) . dot ! exclamation mark "></outline>
+<outline text="Markdown: Syntax" _note=" <ul id="ProjectSubmenu"> <li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li> <li><a href="/projects/markdown/basics" title="Markdown Basics">Basics</a></li> <li><a class="selected" title="Markdown Syntax Documentation">Syntax</a></li> <li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li> <li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li> </ul> * [Overview](#overview) * [Philosophy](#philosophy) * [Inline HTML](#html) * [Automatic Escaping for Special Characters](#autoescape) * [Block Elements](#block) * [Paragraphs and Line Breaks](#p) * [Headers](#header) * [Blockquotes](#blockquote) * [Lists](#list) * [Code Blocks](#precode) * [Horizontal Rules](#hr) * [Span Elements](#span) * [Links](#link) * [Emphasis](#em) * [Code](#code) * [Images](#img) * [Miscellaneous](#misc) * [Backslash Escapes](#backslash) * [Automatic Links](#autolink) **Note:** This document is itself written using Markdown; you can [see the source for it by adding '.text' to the URL][src]. [src]: /projects/markdown/syntax.text * * * <h2 id="overview">Overview</h2> <h3 id="philosophy">Philosophy</h3> Markdown is intended to be as easy-to-read and easy-to-write as is feasible. Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions. While Markdown's syntax has been influenced by several existing text-to-HTML filters -- including [Setext][1], [atx][2], [Textile][3], [reStructuredText][4], [Grutatext][5], and [EtText][6] -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email. [1]: http://docutils.sourceforge.net/mirror/setext.html [2]: http://www.aaronsw.com/2002/atx/ [3]: http://textism.com/tools/textile/ [4]: http://docutils.sourceforge.net/rst.html [5]: http://www.triptico.com/software/grutatxt.html [6]: http://ettext.taint.org/doc/ To this end, Markdown's syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like \*emphasis\*. Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you've ever used email. <h3 id="html">Inline HTML</h3> Markdown's syntax is intended for one purpose: to be used as a format for *writing* for the web. Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags. The idea is *not* to create a syntax that makes it easier to insert HTML tags. In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a *publishing* format; Markdown is a *writing* format. Thus, Markdown's formatting syntax only addresses issues that can be conveyed in plain text. For any markup that is not covered by Markdown's syntax, you simply use HTML itself. There's no need to preface it or delimit it to indicate that you're switching from Markdown to HTML; you just use the tags. The only restrictions are that block-level HTML elements -- e.g. `<div>`, `<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) `<p>` tags around HTML block-level tags. For example, to add an HTML table to a Markdown article: This is a regular paragraph. <table> <tr> <td>Foo</td> </tr> </table> This is another regular paragraph. Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an HTML block. Span-level HTML tags -- e.g. `<span>`, `<cite>`, or `<del>` -- can be used anywhere in a Markdown paragraph, list item, or header. If you want, you can even use HTML tags instead of Markdown formatting; e.g. if you'd prefer to use HTML `<a>` or `<img>` tags instead of Markdown's link or image syntax, go right ahead. Unlike block-level HTML tags, Markdown syntax *is* processed within span-level tags. <h3 id="autoescape">Automatic Escaping for Special Characters</h3> In HTML, there are two characters that demand special treatment: `<` and `&`. Left angle brackets are used to start tags; ampersands are used to denote HTML entities. If you want to use them as literal characters, you must escape them as entities, e.g. `&lt;`, and `&amp;`. Ampersands in particular are bedeviling for web writers. If you want to write about 'AT&T', you need to write '`AT&amp;T`'. You even need to escape ampersands within URLs. Thus, if you want to link to: http://images.google.com/images?num=30&q=larry+bird you need to encode the URL as: http://images.google.com/images?num=30&amp;q=larry+bird in your anchor tag `href` attribute. Needless to say, this is easy to forget, and is probably the single most common source of HTML validation errors in otherwise well-marked-up web sites. Markdown allows you to use these characters naturally, taking care of all the necessary escaping for you. If you use an ampersand as part of an HTML entity, it remains unchanged; otherwise it will be translated into `&amp;`. So, if you want to include a copyright symbol in your article, you can write: &copy; and Markdown will leave it alone. But if you write: AT&T Markdown will translate it to: AT&amp;T Similarly, because Markdown supports [inline HTML](#html), if you use angle brackets as delimiters for HTML tags, Markdown will treat them as such. But if you write: 4 < 5 Markdown will translate it to: 4 &lt; 5 However, inside Markdown code spans and blocks, angle brackets and ampersands are *always* encoded automatically. This makes it easy to use Markdown to write about HTML code. (As opposed to raw HTML, which is a terrible format for writing about HTML syntax, because every single `<` and `&` in your example code needs to be escaped.) * * * <h2 id="block">Block Elements</h2> <h3 id="p">Paragraphs and Line Breaks</h3> A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs. The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a `<br />` tag. When you *do* want to insert a `<br />` break tag using Markdown, you end a line with two or more spaces, then type return. Yes, this takes a tad more effort to create a `<br />`, but a simplistic "every line break is a `<br />`" rule wouldn't work for Markdown. Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] work best -- and look better -- when you format them with hard breaks. [bq]: #blockquote [l]: #list <h3 id="header">Headers</h3> Markdown supports two styles of headers, [Setext][1] and [atx][2]. Setext-style headers are "underlined" using equal signs (for first-level headers) and dashes (for second-level headers). For example: This is an H1 ============= This is an H2 ------------- Any number of underlining `=`'s or `-`'s will work. Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. For example: # This is an H1 ## This is an H2 ###### This is an H6 Optionally, you may "close" atx-style headers. This is purely cosmetic -- you can use this if you think it looks better. The closing hashes don't even need to match the number of hashes used to open the header. (The number of opening hashes determines the header level.) : # This is an H1 # ## This is an H2 ## ### This is an H3 ###### <h3 id="blockquote">Blockquotes</h3> Markdown uses email-style `>` characters for blockquoting. If you're familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a `>` before every line: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse > id sem consectetuer libero luctus adipiscing. Markdown allows you to be lazy and only put the `>` before the first line of a hard-wrapped paragraph: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of `>`: > This is the first level of quoting. > > > This is nested blockquote. > > Back to the first level. Blockquotes can contain other Markdown elements, including headers, lists, and code blocks: 	> ## This is a header. 	> 	> 1. This is the first list item. 	> 2. This is the second list item. 	> 	> Here's some example code: 	> 	> return shell_exec("echo $input | $markdown_script"); Any decent text editor should make email-style quoting easy. For example, with BBEdit, you can make a selection and choose Increase Quote Level from the Text menu. <h3 id="list">Lists</h3> Markdown supports ordered (numbered) and unordered (bulleted) lists. Unordered lists use asterisks, pluses, and hyphens -- interchangably -- as list markers: * Red * Green * Blue is equivalent to: + Red + Green + Blue and: - Red - Green - Blue Ordered lists use numbers followed by periods: 1. Bird 2. McHale 3. Parish It's important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces. The HTML Markdown produces from the above list is: <ol> <li>Bird</li> <li>McHale</li> <li>Parish</li> </ol> If you instead wrote the list in Markdown like this: 1. Bird 1. McHale 1. Parish or even: 3. Bird 1. McHale 8. Parish you'd get the exact same HTML output. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don't have to. If you do use lazy list numbering, however, you should still start the list with the number 1. At some point in the future, Markdown may support starting ordered lists at an arbitrary number. List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab. To make lists look nice, you can wrap items with hanging indents: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. But if you want to be lazy, you don't have to: * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. If list items are separated by blank lines, Markdown will wrap the items in `<p>` tags in the HTML output. For example, this input: * Bird * Magic will turn into: <ul> <li>Bird</li> <li>Magic</li> </ul> But this: * Bird * Magic will turn into: <ul> <li><p>Bird</p></li> <li><p>Magic</p></li> </ul> List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab: 1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 2. Suspendisse id sem consectetuer libero luctus adipiscing. It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy: * This is a list item with two paragraphs. This is the second paragraph in the list item. You're only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. * Another item in the same list. To put a blockquote within a list item, the blockquote's `>` delimiters need to be indented: * A list item with a blockquote: > This is a blockquote > inside a list item. To put a code block within a list item, the code block needs to be indented *twice* -- 8 spaces or two tabs: * A list item with a code block: <code goes here> It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this: 1986. What a great season. In other words, a *number-period-space* sequence at the beginning of a line. To avoid this, you can backslash-escape the period: 1986\. What a great season. <h3 id="precode">Code Blocks</h3> Pre-formatted code blocks are used for writing about programming or markup source code. Rather than forming normal paragraphs, the lines of a code block are interpreted literally. Markdown wraps a code block in both `<pre>` and `<code>` tags. To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab. For example, given this input: This is a normal paragraph: This is a code block. Markdown will generate: <p>This is a normal paragraph:</p> <pre><code>This is a code block. </code></pre> One level of indentation -- 4 spaces or 1 tab -- is removed from each line of the code block. For example, this: Here is an example of AppleScript: tell application "Foo" beep end tell will turn into: <p>Here is an example of AppleScript:</p> <pre><code>tell application "Foo" beep end tell </code></pre> A code block continues until it reaches a line that is not indented (or the end of the article). Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) are automatically converted into HTML entities. This makes it very easy to include example HTML source code using Markdown -- just paste it and indent it, and Markdown will handle the hassle of encoding the ampersands and angle brackets. For example, this: <div class="footer"> &copy; 2004 Foo Corporation </div> will turn into: <pre><code>&lt;div class="footer"&gt; &amp;copy; 2004 Foo Corporation &lt;/div&gt; </code></pre> Regular Markdown syntax is not processed within code blocks. E.g., asterisks are just literal asterisks within a code block. This means it's also easy to use Markdown to write about Markdown's own syntax. <h3 id="hr">Horizontal Rules</h3> You can produce a horizontal rule tag (`<hr />`) by placing three or more hyphens, asterisks, or underscores on a line by themselves. If you wish, you may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule: * * * *** ***** - - - --------------------------------------- * * * <h2 id="span">Span Elements</h2> <h3 id="link">Links</h3> Markdown supports two style of links: *inline* and *reference*. In both styles, the link text is delimited by [square brackets]. To create an inline link, use a set of regular parentheses immediately after the link text's closing square bracket. Inside the parentheses, put the URL where you want the link to point, along with an *optional* title for the link, surrounded in quotes. For example: This is [an example](http://example.com/ "Title") inline link. [This link](http://example.net/) has no title attribute. Will produce: <p>This is <a href="http://example.com/" title="Title"> an example</a> inline link.</p> <p><a href="http://example.net/">This link</a> has no title attribute.</p> If you're referring to a local resource on the same server, you can use relative paths: See my [About](/about/) page for details. Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link: This is [an example][id] reference-style link. You can optionally use a space to separate the sets of brackets: This is [an example] [id] reference-style link. Then, anywhere in the document, you define your link label like this, on a line by itself: [id]: http://example.com/ "Optional Title Here" That is: * Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces); * followed by a colon; * followed by one or more spaces (or tabs); * followed by the URL for the link; * optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses. The following three link definitions are equivalent: 	[foo]: http://example.com/ "Optional Title Here" 	[foo]: http://example.com/ 'Optional Title Here' 	[foo]: http://example.com/ (Optional Title Here) **Note:** There is a known bug in Markdown.pl 1.0.1 which prevents single quotes from being used to delimit link titles. The link URL may, optionally, be surrounded by angle brackets: [id]: <http://example.com/> "Optional Title Here" You can put the title attribute on the next line and use extra spaces or tabs for padding, which tends to look better with longer URLs: [id]: http://example.com/longish/path/to/resource/here "Optional Title Here" Link definitions are only used for creating links during Markdown processing, and are stripped from your document in the HTML output. Link definition names may consist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: 	[link text][a] 	[link text][A] are equivalent. The *implicit link name* shortcut allows you to omit the name of the link, in which case the link text itself is used as the name. Just use an empty set of square brackets -- e.g., to link the word "Google" to the google.com web site, you could simply write: 	[Google][] And then define the link: 	[Google]: http://google.com/ Because link names may contain spaces, this shortcut even works for multiple words in the link text: 	Visit [Daring Fireball][] for more information. And then define the link: 	 	[Daring Fireball]: http://daringfireball.net/ Link definitions can be placed anywhere in your Markdown document. I tend to put them immediately after each paragraph in which they're used, but if you want, you can put them all at the end of your document, sort of like footnotes. Here's an example of reference links in action: I get 10 times more traffic from [Google] [1] than from [Yahoo] [2] or [MSN] [3]. [1]: http://google.com/ "Google" [2]: http://search.yahoo.com/ "Yahoo Search" [3]: http://search.msn.com/ "MSN Search" Using the implicit link name shortcut, you could instead write: I get 10 times more traffic from [Google][] than from [Yahoo][] or [MSN][]. [google]: http://google.com/ "Google" [yahoo]: http://search.yahoo.com/ "Yahoo Search" [msn]: http://search.msn.com/ "MSN Search" Both of the above examples will produce the following HTML output: <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a> than from <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p> For comparison, here is the same paragraph written using Markdown's inline link style: I get 10 times more traffic from [Google](http://google.com/ "Google") than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or [MSN](http://search.msn.com/ "MSN Search"). The point of reference-style links is not that they're easier to write. The point is that with reference-style links, your document source is vastly more readable. Compare the above examples: using reference-style links, the paragraph itself is only 81 characters long; with inline-style links, it's 176 characters; and as raw HTML, it's 234 characters. In the raw HTML, there's more markup than there is text. With Markdown's reference-style links, a source document much more closely resembles the final output, as rendered in a browser. By allowing you to move the markup-related metadata out of the paragraph, you can add links without interrupting the narrative flow of your prose. <h3 id="em">Emphasis</h3> Markdown treats asterisks (`*`) and underscores (`_`) as indicators of emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML `<strong>` tag. E.g., this input: *single asterisks* _single underscores_ **double asterisks** __double underscores__ will produce: <em>single asterisks</em> <em>single underscores</em> <strong>double asterisks</strong> <strong>double underscores</strong> You can use whichever style you prefer; the lone restriction is that the same character must be used to open and close an emphasis span. Emphasis can be used in the middle of a word: un*frigging*believable But if you surround an `*` or `_` with spaces, it'll be treated as a literal asterisk or underscore. To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it: \*this text is surrounded by literal asterisks\* <h3 id="code">Code</h3> To indicate a span of code, wrap it with backtick quotes (`` ` ``). Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example: Use the `printf()` function. will produce: <p>Use the <code>printf()</code> function.</p> To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters: ``There is a literal backtick (`) here.`` which will produce this: <p><code>There is a literal backtick (`) here.</code></p> The backtick delimiters surrounding a code span may include spaces -- one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span: 	A single backtick in a code span: `` ` `` 	 	A backtick-delimited string in a code span: `` `foo` `` will produce: 	<p>A single backtick in a code span: <code>`</code></p> 	 	<p>A backtick-delimited string in a code span: <code>`foo`</code></p> With a code span, ampersands and angle brackets are encoded as HTML entities automatically, which makes it easy to include example HTML tags. Markdown will turn this: Please don't use any `<blink>` tags. into: <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p> You can write this: `&#8212;` is the decimal-encoded equivalent of `&mdash;`. to produce: <p><code>&amp;#8212;</code> is the decimal-encoded equivalent of <code>&amp;mdash;</code>.</p> <h3 id="img">Images</h3> Admittedly, it's fairly difficult to devise a "natural" syntax for placing images into a plain text document format. Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: *inline* and *reference*. Inline image syntax looks like this: ![Alt text](/path/to/img.jpg) ![Alt text](/path/to/img.jpg "Optional title") That is: * An exclamation mark: `!`; * followed by a set of square brackets, containing the `alt` attribute text for the image; * followed by a set of parentheses, containing the URL or path to the image, and an optional `title` attribute enclosed in double or single quotes. Reference-style image syntax looks like this: ![Alt text][id] Where "id" is the name of a defined image reference. Image references are defined using syntax identical to link references: [id]: url/to/image "Optional title attribute" As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can simply use regular HTML `<img>` tags. * * * <h2 id="misc">Miscellaneous</h2> <h3 id="autolink">Automatic Links</h3> 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: <http://example.com/> Markdown will turn this into: <a href="http://example.com/">http://example.com/</a> Automatic links for email addresses work similarly, except that Markdown will also perform a bit of randomized decimal and hex entity-encoding to help obscure your address from address-harvesting spambots. For example, Markdown will turn this: <address@example.com> into something like this: <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65; &#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111; &#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61; &#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a> which will render in a browser as a clickable link to "address@example.com". (This sort of entity-encoding trick will indeed fool many, if not most, address-harvesting bots, but it definitely won't fool all of them. It's better than nothing, but an address published in this way will probably eventually start receiving spam.) <h3 id="backslash">Backslash Escapes</h3> Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown's formatting syntax. For example, if you wanted to surround a word with literal asterisks (instead of an HTML `<em>` tag), you can use backslashes before the asterisks, like this: \*literal asterisks\* Markdown provides backslash escapes for the following characters: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark 	+ plus sign 	- minus sign (hyphen) . dot ! exclamation mark "></outline>
</body>
</opml>
-\part{Markdown: Syntax }
+\part{Markdown: Syntax}
\label{markdown:syntax}
\begin{itemize}
<office:text>
<text:p text:style-name="Standard">foo:<text:tab/>bar</text:p>
-<text:h text:outline-level="3"><text:bookmark text:name="foo"/>foo </text:h>
+<text:h text:outline-level="3"><text:bookmark text:name="foo"/>foo</text:h>
</office:text>
</office:body>
</office:document>
<p>foo: bar</p>
-<h2 id="foo">foo </h2>
+<h2 id="foo">foo</h2>
</body>
</html>
<p>foo: bar</p>
-<h1>foo </h1>
+<h1>foo</h1>
<head><title>*foo* "bar"</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" foo:	bar "></outline>
-<outline text="foo " _note=""></outline>
+<outline text="foo" _note=""></outline>
<outline text="Metadata">
<outline text="title" _note="*foo* "bar""/>
<outline text="empty" _note=""/>
foo: bar
-\chapter{foo }
+\chapter{foo}
\label{foo}
\input{mmd6-article-footer}
</text:table-of-content>
-<text:h text:outline-level="2"><text:bookmark text:name="secondlevel"/>Second Level </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="secondlevel"/>Second Level</text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="firstlevel"/>First Level </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="firstlevel"/>First Level</text:h>
-<text:h text:outline-level="2"><text:bookmark text:name="secondlevelb"/>Second Level b </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="secondlevelb"/>Second Level b</text:h>
-<text:h text:outline-level="3"><text:bookmark text:name="thirdlevel"/>Third Level </text:h>
+<text:h text:outline-level="3"><text:bookmark text:name="thirdlevel"/>Third Level</text:h>
-<text:h text:outline-level="2"><text:bookmark text:name="secondlevelc"/>Second Level c </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="secondlevelc"/>Second Level c</text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="firstlevelb"/>First Level b </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="firstlevelb"/>First Level b</text:h>
-<text:h text:outline-level="3"><text:bookmark text:name="thirdlevelb"/>Third Level b </text:h>
+<text:h text:outline-level="3"><text:bookmark text:name="thirdlevelb"/>Third Level b</text:h>
-<text:h text:outline-level="2"><text:bookmark text:name="secondleveld"/>Second level d </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="secondleveld"/>Second level d</text:h>
-<text:h text:outline-level="3"><text:bookmark text:name="thirdleveld"/>Third level d </text:h>
+<text:h text:outline-level="3"><text:bookmark text:name="thirdleveld"/>Third level d</text:h>
-<text:h text:outline-level="4"><text:bookmark text:name="fourthleveld"/>Fourth level d </text:h>
+<text:h text:outline-level="4"><text:bookmark text:name="fourthleveld"/>Fourth level d</text:h>
-<text:h text:outline-level="1"><text:bookmark text:name="firstlevele"/>First level </text:h>
+<text:h text:outline-level="1"><text:bookmark text:name="firstlevele"/>First level</text:h>
-<text:h text:outline-level="2"><text:bookmark text:name="secondlevele"/>Second level </text:h>
+<text:h text:outline-level="2"><text:bookmark text:name="secondlevele"/>Second level</text:h>
</office:text>
</office:body>
</office:document>
</ul>
</div>
-<h2 id="secondlevel">Second Level </h2>
+<h2 id="secondlevel">Second Level</h2>
-<h1 id="firstlevel">First Level </h1>
+<h1 id="firstlevel">First Level</h1>
-<h2 id="secondlevelb">Second Level b </h2>
+<h2 id="secondlevelb">Second Level b</h2>
-<h3 id="thirdlevel">Third Level </h3>
+<h3 id="thirdlevel">Third Level</h3>
-<h2 id="secondlevelc">Second Level c </h2>
+<h2 id="secondlevelc">Second Level c</h2>
-<h1 id="firstlevelb">First Level b </h1>
+<h1 id="firstlevelb">First Level b</h1>
-<h3 id="thirdlevelb">Third Level b </h3>
+<h3 id="thirdlevelb">Third Level b</h3>
-<h2 id="secondleveld">Second level d </h2>
+<h2 id="secondleveld">Second level d</h2>
-<h3 id="thirdleveld">Third level d </h3>
+<h3 id="thirdleveld">Third level d</h3>
-<h4 id="fourthleveld">Fourth level d </h4>
+<h4 id="fourthleveld">Fourth level d</h4>
-<h1 id="firstlevele">First level </h1>
+<h1 id="firstlevele">First level</h1>
-<h2 id="secondlevele">Second level </h2>
+<h2 id="secondlevele">Second level</h2>
</body>
</html>
<p>{{TOC}}</p>
-<h2>Second Level </h2>
+<h2>Second Level</h2>
-<h1>First Level </h1>
+<h1>First Level</h1>
-<h2>Second Level b </h2>
+<h2>Second Level b</h2>
-<h3>Third Level </h3>
+<h3>Third Level</h3>
-<h2>Second Level c </h2>
+<h2>Second Level c</h2>
-<h1>First Level b </h1>
+<h1>First Level b</h1>
-<h3>Third Level b </h3>
+<h3>Third Level b</h3>
-<h2>Second level d </h2>
+<h2>Second level d</h2>
-<h3>Third level d </h3>
+<h3>Third level d</h3>
-<h4>Fourth level d </h4>
+<h4>Fourth level d</h4>
-<h1>First level [First Level e] </h1>
+<h1>First level [First Level e]</h1>
-<h2>Second level [Second Level e] </h2>
+<h2>Second level [Second Level e]</h2>
<head><title>Table of Contents</title></head>
<body>
<outline text="(Untitled Preamble)" _note=" {{TOC}} "></outline>
-<outline text="Second Level " _note=" "></outline>
-<outline text="First Level " _note=" "><outline text="Second Level b " _note=" "><outline text="Third Level " _note=" "></outline>
+<outline text="Second Level" _note=" "></outline>
+<outline text="First Level" _note=" "><outline text="Second Level b" _note=" "><outline text="Third Level" _note=" "></outline>
</outline>
-<outline text="Second Level c " _note=" "></outline>
+<outline text="Second Level c" _note=" "></outline>
</outline>
-<outline text="First Level b " _note=" "><outline text="Third Level b " _note=" "></outline>
-<outline text="Second level d " _note=" "><outline text="Third level d " _note=" "><outline text="Fourth level d " _note=" "></outline>
+<outline text="First Level b" _note=" "><outline text="Third Level b" _note=" "></outline>
+<outline text="Second level d" _note=" "><outline text="Third level d" _note=" "><outline text="Fourth level d" _note=" "></outline>
</outline>
</outline>
</outline>
-<outline text="First level [First Level e] " _note=" "><outline text="Second level [Second Level e] " _note=""></outline>
+<outline text="First level [First Level e]" _note=" "><outline text="Second level [Second Level e]" _note=""></outline>
</outline>
<outline text="Metadata">
<outline text="title" _note="Table of Contents"/>
\tableofcontents
-\chapter{Second Level }
+\chapter{Second Level}
\label{secondlevel}
-\part{First Level }
+\part{First Level}
\label{firstlevel}
-\chapter{Second Level b }
+\chapter{Second Level b}
\label{secondlevelb}
-\section{Third Level }
+\section{Third Level}
\label{thirdlevel}
-\chapter{Second Level c }
+\chapter{Second Level c}
\label{secondlevelc}
-\part{First Level b }
+\part{First Level b}
\label{firstlevelb}
-\section{Third Level b }
+\section{Third Level b}
\label{thirdlevelb}
-\chapter{Second level d }
+\chapter{Second level d}
\label{secondleveld}
-\section{Third level d }
+\section{Third level d}
\label{thirdleveld}
-\subsection{Fourth level d }
+\subsection{Fourth level d}
\label{fourthleveld}
-\part{First level }
+\part{First level}
\label{firstlevele}
-\chapter{Second level }
+\chapter{Second level}
\label{secondlevele}
\input{mmd6-article-footer}
identify common structures that are not supported yet -- particularly useful
when developing a new output format.
-\part{Basic Blocks }
+\part{Basic Blocks}
\label{basicblocks}
paragraph
\emph{emph} and \textbf{strong} and \textbf{\emph{both}}
-\chapter{Escapes }
+\chapter{Escapes}
\label{escaped}
\begin{enumerate}
\end{enumerate}
-\part{Footnotes }
+\part{Footnotes}
\label{footnotes}
Foo.\footnote{This is an inline footnote}
Cite.~\citep{foo}
-\part{Links and Images }
+\part{Links and Images}
\label{linksandimages}
\href{http://foo.net/}{link}\footnote{\href{http://foo.net/}{http:\slash \slash foo.net\slash }} and \href{http://bar.net}{link}\footnote{\href{http://bar.net}{http:\slash \slash bar.net}}
bar (\autoref{bar})
-\part{Math }
+\part{Math}
\label{math}
foo \({e}^{i\pi }+1=0\) bar
$${x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a}$$
-\part{Smart Quotes }
+\part{Smart Quotes}
\label{smartquotes}
``foo'' and `bar' -- with --- dashes{\ldots}
-\part{CriticMarkup }
+\part{CriticMarkup}
\label{criticmarkup}
\underline{foo}
\hl{bar}
-\part{Definition Lists }
+\part{Definition Lists}
\label{definitionlists}
\begin{description}
baz bat*
\end{description}
-\part{Horizontal Rules }
+\part{Horizontal Rules}
\label{horizontalrules}
\begin{center}\rule{3in}{0.4pt}\end{center}
-\part{Glossary }
+\part{Glossary}
\label{glossary}
\gls{term}