Markdown-3.1.1/0000755000076500000240000000000013470647777013742 5ustar waylanstaff00000000000000Markdown-3.1.1/INSTALL.md0000644000076500000240000000041513212354326015345 0ustar waylanstaff00000000000000Installing Python-Markdown ========================== As an Admin/Root user on your system do: pip install markdown Or for more specific instructions, view the documentation in `docs/install.md` or on the website at . Markdown-3.1.1/LICENSE.md0000644000076500000240000000315513212354326015325 0ustar waylanstaff00000000000000Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Python Markdown Project nor the 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 PYTHON MARKDOWN PROJECT ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY CONTRIBUTORS TO THE PYTHON MARKDOWN PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 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. Markdown-3.1.1/MANIFEST.in0000644000076500000240000000043613225017103015447 0ustar waylanstaff00000000000000recursive-include markdown *.py recursive-include docs * recursive-include tests *.txt *.html *.py include setup.py include setup.cfg include tox.ini include makefile include LICENSE.md include README.md include INSTALL.md include MANIFEST include *-requirements.txt include mkdocs.yml Markdown-3.1.1/Markdown.egg-info/0000755000076500000240000000000013470647777017216 5ustar waylanstaff00000000000000Markdown-3.1.1/Markdown.egg-info/PKG-INFO0000644000076500000240000000440213470647776020312 0ustar waylanstaff00000000000000Metadata-Version: 2.1 Name: Markdown Version: 3.1.1 Summary: Python implementation of Markdown. Home-page: https://Python-Markdown.github.io/ Author: Manfred Stienstra, Yuri takhteyev and Waylan limberg Author-email: waylan.limberg@icloud.com Maintainer: Waylan Limberg Maintainer-email: waylan.limberg@icloud.com License: BSD License Download-URL: http://pypi.python.org/packages/source/M/Markdown/Markdown-3.1.1-py2.py3-none-any.whl Description: This is a Python implementation of John Gruber's Markdown_. It is almost completely compliant with the reference implementation, though there are a few known issues. See Features_ for information on what exactly is supported and what is not. Additional features are supported by the `Available Extensions`_. .. _Markdown: http://daringfireball.net/projects/markdown/ .. _Features: https://Python-Markdown.github.io#features .. _`Available Extensions`: https://Python-Markdown.github.io/extensions/ Support ======= You may report bugs, ask for help, and discuss various other issues on the `bug tracker`_. .. _`bug tracker`: http://github.com/Python-Markdown/markdown/issues Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Topic :: Communications :: Email :: Filters Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries Classifier: Topic :: Internet :: WWW/HTTP :: Site Management Classifier: Topic :: Software Development :: Documentation Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Text Processing :: Filters Classifier: Topic :: Text Processing :: Markup :: HTML Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.* Provides-Extra: testing Markdown-3.1.1/Markdown.egg-info/SOURCES.txt0000644000076500000240000003165313470647776021111 0ustar waylanstaff00000000000000INSTALL.md LICENSE.md MANIFEST.in README.md doc-requirements.txt makefile mkdocs.yml setup.cfg setup.py tox.ini Markdown.egg-info/PKG-INFO Markdown.egg-info/SOURCES.txt Markdown.egg-info/dependency_links.txt Markdown.egg-info/entry_points.txt Markdown.egg-info/requires.txt Markdown.egg-info/top_level.txt docs/authors.md docs/cli.md docs/contributing.md docs/favicon.ico docs/index.md docs/install.md docs/py.png docs/reference.md docs/test_tools.md docs/change_log/index.md docs/change_log/release-2.0.md docs/change_log/release-2.1.md docs/change_log/release-2.2.md docs/change_log/release-2.3.md docs/change_log/release-2.4.md docs/change_log/release-2.5.md docs/change_log/release-2.6.md docs/change_log/release-3.0.md docs/change_log/release-3.1.md docs/extensions/abbreviations.md docs/extensions/admonition.md docs/extensions/api.md docs/extensions/attr_list.md docs/extensions/code_hilite.md docs/extensions/definition_lists.md docs/extensions/extra.md docs/extensions/fenced_code_blocks.md docs/extensions/footnotes.md docs/extensions/index.md docs/extensions/legacy_attr.md docs/extensions/legacy_em.md docs/extensions/meta_data.md docs/extensions/nl2br.md docs/extensions/sane_lists.md docs/extensions/smarty.md docs/extensions/tables.md docs/extensions/toc.md docs/extensions/wikilinks.md markdown/__init__.py markdown/__main__.py markdown/__meta__.py markdown/blockparser.py markdown/blockprocessors.py markdown/core.py markdown/inlinepatterns.py markdown/pep562.py markdown/postprocessors.py markdown/preprocessors.py markdown/serializers.py markdown/test_tools.py markdown/treeprocessors.py markdown/util.py markdown/extensions/__init__.py markdown/extensions/abbr.py markdown/extensions/admonition.py markdown/extensions/attr_list.py markdown/extensions/codehilite.py markdown/extensions/def_list.py markdown/extensions/extra.py markdown/extensions/fenced_code.py markdown/extensions/footnotes.py markdown/extensions/legacy_attrs.py markdown/extensions/legacy_em.py markdown/extensions/meta.py markdown/extensions/nl2br.py markdown/extensions/sane_lists.py markdown/extensions/smarty.py markdown/extensions/tables.py markdown/extensions/toc.py markdown/extensions/wikilinks.py tests/__init__.py tests/test_apis.py tests/test_extensions.py tests/test_legacy.py tests/basic/amps-and-angle-encoding.html tests/basic/amps-and-angle-encoding.txt tests/basic/angle-links-and-img.html tests/basic/angle-links-and-img.txt tests/basic/auto-links.html tests/basic/auto-links.txt tests/basic/backlash-escapes.html tests/basic/backlash-escapes.txt tests/basic/blockquotes-with-code-blocks.html tests/basic/blockquotes-with-code-blocks.txt tests/basic/codeblock-in-list.html tests/basic/codeblock-in-list.txt tests/basic/hard-wrapped.html tests/basic/hard-wrapped.txt tests/basic/horizontal-rules.html tests/basic/horizontal-rules.txt tests/basic/inline-html-advanced.html tests/basic/inline-html-advanced.txt tests/basic/inline-html-comments.html tests/basic/inline-html-comments.txt tests/basic/inline-html-simple.html tests/basic/inline-html-simple.txt tests/basic/links-inline.html tests/basic/links-inline.txt tests/basic/links-reference.html tests/basic/links-reference.txt tests/basic/literal-quotes.html tests/basic/literal-quotes.txt tests/basic/markdown-documentation-basics.html tests/basic/markdown-documentation-basics.txt tests/basic/markdown-syntax.html tests/basic/markdown-syntax.txt tests/basic/nested-blockquotes.html tests/basic/nested-blockquotes.txt tests/basic/ordered-and-unordered-list.html tests/basic/ordered-and-unordered-list.txt tests/basic/strong-and-em-together.html tests/basic/strong-and-em-together.txt tests/basic/tabs.html tests/basic/tabs.txt tests/basic/tidyness.html tests/basic/tidyness.txt tests/extensions/admonition.html tests/extensions/admonition.txt tests/extensions/attr_list.html tests/extensions/attr_list.txt tests/extensions/codehilite.html tests/extensions/codehilite.txt tests/extensions/fenced_code.html tests/extensions/fenced_code.txt tests/extensions/github_flavored.html tests/extensions/github_flavored.txt tests/extensions/nl2br_w_attr_list.html tests/extensions/nl2br_w_attr_list.txt tests/extensions/sane_lists.html tests/extensions/sane_lists.txt tests/extensions/smarty.html tests/extensions/smarty.txt tests/extensions/toc.html tests/extensions/toc.txt tests/extensions/toc_invalid.html tests/extensions/toc_invalid.txt tests/extensions/toc_nested.html tests/extensions/toc_nested.txt tests/extensions/toc_nested2.html tests/extensions/toc_nested2.txt tests/extensions/toc_nested_list.html tests/extensions/toc_nested_list.txt tests/extensions/toc_out_of_order.html tests/extensions/toc_out_of_order.txt tests/extensions/wikilinks.html tests/extensions/wikilinks.txt tests/extensions/extra/abbr.html tests/extensions/extra/abbr.txt tests/extensions/extra/def-in-list.html tests/extensions/extra/def-in-list.txt tests/extensions/extra/extra_config.html tests/extensions/extra/extra_config.txt tests/extensions/extra/footnote.html tests/extensions/extra/footnote.txt tests/extensions/extra/footnote_many_footnotes.html tests/extensions/extra/footnote_many_footnotes.txt tests/extensions/extra/footnote_placeholder.html tests/extensions/extra/footnote_placeholder.txt tests/extensions/extra/footnote_placeholder_depth.html tests/extensions/extra/footnote_placeholder_depth.txt tests/extensions/extra/loose_def_list.html tests/extensions/extra/loose_def_list.txt tests/extensions/extra/markdown-syntax.html tests/extensions/extra/markdown-syntax.txt tests/extensions/extra/named_markers.html tests/extensions/extra/named_markers.txt tests/extensions/extra/raw-html.html tests/extensions/extra/raw-html.txt tests/extensions/extra/simple_def-lists.html tests/extensions/extra/simple_def-lists.txt tests/extensions/extra/tables.html tests/extensions/extra/tables.txt tests/extensions/extra/tables_and_attr_list.html tests/extensions/extra/tables_and_attr_list.txt tests/misc/CRLF_line_ends.html tests/misc/CRLF_line_ends.txt tests/misc/adjacent-headers.html tests/misc/adjacent-headers.txt tests/misc/ampersand.html tests/misc/ampersand.txt tests/misc/arabic.html tests/misc/arabic.txt tests/misc/autolinks_with_asterisks.html tests/misc/autolinks_with_asterisks.txt tests/misc/autolinks_with_asterisks_russian.html tests/misc/autolinks_with_asterisks_russian.txt tests/misc/backtick-escape.html tests/misc/backtick-escape.txt tests/misc/bidi.html tests/misc/bidi.txt tests/misc/blank-block-quote.html tests/misc/blank-block-quote.txt tests/misc/blank_lines_in_codeblocks.html tests/misc/blank_lines_in_codeblocks.txt tests/misc/block_html5.html tests/misc/block_html5.txt tests/misc/block_html_attr.html tests/misc/block_html_attr.txt tests/misc/block_html_simple.html tests/misc/block_html_simple.txt tests/misc/blockquote-below-paragraph.html tests/misc/blockquote-below-paragraph.txt tests/misc/blockquote-hr.html tests/misc/blockquote-hr.txt tests/misc/blockquote.html tests/misc/blockquote.txt tests/misc/bold_links.html tests/misc/bold_links.txt tests/misc/br.html tests/misc/br.txt tests/misc/bracket_re.html tests/misc/bracket_re.txt tests/misc/brackets-in-img-title.html tests/misc/brackets-in-img-title.txt tests/misc/code-first-line.html tests/misc/code-first-line.txt tests/misc/comments.html tests/misc/comments.txt tests/misc/div.html tests/misc/div.txt tests/misc/em-around-links.html tests/misc/em-around-links.txt tests/misc/em_strong.html tests/misc/em_strong.txt tests/misc/em_strong_complex.html tests/misc/em_strong_complex.txt tests/misc/email.html tests/misc/email.txt tests/misc/escaped_chars_in_js.html tests/misc/escaped_chars_in_js.txt tests/misc/escaped_links.html tests/misc/escaped_links.txt tests/misc/funky-list.html tests/misc/funky-list.txt tests/misc/h1.html tests/misc/h1.txt tests/misc/hash.html tests/misc/hash.txt tests/misc/header-in-lists.html tests/misc/header-in-lists.txt tests/misc/headers.html tests/misc/headers.txt tests/misc/hline.html tests/misc/hline.txt tests/misc/html-comments.html tests/misc/html-comments.txt tests/misc/html.html tests/misc/html.txt tests/misc/image-2.html tests/misc/image-2.txt tests/misc/image_in_links.html tests/misc/image_in_links.txt tests/misc/ins-at-start-of-paragraph.html tests/misc/ins-at-start-of-paragraph.txt tests/misc/inside_html.html tests/misc/inside_html.txt tests/misc/japanese.html tests/misc/japanese.txt tests/misc/lazy-block-quote.html tests/misc/lazy-block-quote.txt tests/misc/link-with-parenthesis.html tests/misc/link-with-parenthesis.txt tests/misc/lists.html tests/misc/lists.txt tests/misc/lists2.html tests/misc/lists2.txt tests/misc/lists3.html tests/misc/lists3.txt tests/misc/lists4.html tests/misc/lists4.txt tests/misc/lists5.html tests/misc/lists5.txt tests/misc/lists6.html tests/misc/lists6.txt tests/misc/lists7.html tests/misc/lists7.txt tests/misc/lists8.html tests/misc/lists8.txt tests/misc/markup-inside-p.html tests/misc/markup-inside-p.txt tests/misc/mismatched-tags.html tests/misc/mismatched-tags.txt tests/misc/missing-link-def.html tests/misc/missing-link-def.txt tests/misc/more_comments.html tests/misc/more_comments.txt tests/misc/multi-line-tags.html tests/misc/multi-line-tags.txt tests/misc/multi-paragraph-block-quote.html tests/misc/multi-paragraph-block-quote.txt tests/misc/multi-test.html tests/misc/multi-test.txt tests/misc/multiline-comments.html tests/misc/multiline-comments.txt tests/misc/nested-lists.html tests/misc/nested-lists.txt tests/misc/nested-patterns.html tests/misc/nested-patterns.txt tests/misc/normalize.html tests/misc/normalize.txt tests/misc/numeric-entity.html tests/misc/numeric-entity.txt tests/misc/para-with-hr.html tests/misc/para-with-hr.txt tests/misc/php.html tests/misc/php.txt tests/misc/pre.html tests/misc/pre.txt tests/misc/raw_whitespace.html tests/misc/raw_whitespace.txt tests/misc/russian.html tests/misc/russian.txt tests/misc/smart_em.html tests/misc/smart_em.txt tests/misc/some-test.html tests/misc/some-test.txt tests/misc/span.html tests/misc/span.txt tests/misc/strong-with-underscores.html tests/misc/strong-with-underscores.txt tests/misc/stronintags.html tests/misc/stronintags.txt tests/misc/tabs-in-lists.html tests/misc/tabs-in-lists.txt tests/misc/two-spaces.html tests/misc/two-spaces.txt tests/misc/uche.html tests/misc/uche.txt tests/misc/underscores.html tests/misc/underscores.txt tests/misc/url_spaces.html tests/misc/url_spaces.txt tests/pl/Tests_2004/Amps and angle encoding.html tests/pl/Tests_2004/Auto links.html tests/pl/Tests_2004/Backslash escapes.html tests/pl/Tests_2004/Blockquotes with code blocks.html tests/pl/Tests_2004/Hard-wrapped paragraphs with list-like lines.html tests/pl/Tests_2004/Horizontal rules.html tests/pl/Tests_2004/Inline HTML (Advanced).html tests/pl/Tests_2004/Inline HTML (Simple).html tests/pl/Tests_2004/Inline HTML comments.html tests/pl/Tests_2004/Links, inline style.html tests/pl/Tests_2004/Links, reference style.html tests/pl/Tests_2004/Literal quotes in titles.html tests/pl/Tests_2004/Markdown Documentation - Basics.html tests/pl/Tests_2004/Markdown Documentation - Syntax.html tests/pl/Tests_2004/Nested blockquotes.html tests/pl/Tests_2004/Ordered and unordered lists.html tests/pl/Tests_2004/Strong and em together.html tests/pl/Tests_2004/Tabs.html tests/pl/Tests_2004/Tidyness.html tests/pl/Tests_2004/Yuri-Attributes.html tests/pl/Tests_2004/Yuri-Email.html tests/pl/Tests_2004/Yuri-Footnotes.html tests/pl/Tests_2004/Yuri-Links-in-Headers.html tests/pl/Tests_2007/Amps and angle encoding.html tests/pl/Tests_2007/Auto links.html tests/pl/Tests_2007/Backslash escapes.html tests/pl/Tests_2007/Blockquotes with code blocks.html tests/pl/Tests_2007/Code Blocks.html tests/pl/Tests_2007/Code Spans.html tests/pl/Tests_2007/Hard-wrapped paragraphs with list-like lines.html tests/pl/Tests_2007/Horizontal rules.html tests/pl/Tests_2007/Images.html tests/pl/Tests_2007/Inline HTML (Advanced).html tests/pl/Tests_2007/Inline HTML (Simple).html tests/pl/Tests_2007/Inline HTML comments.html tests/pl/Tests_2007/Links, inline style.html tests/pl/Tests_2007/Links, reference style.html tests/pl/Tests_2007/Links, shortcut references.html tests/pl/Tests_2007/Literal quotes in titles.html tests/pl/Tests_2007/Markdown Documentation - Basics.html tests/pl/Tests_2007/Markdown Documentation - Syntax.html tests/pl/Tests_2007/Nested blockquotes.html tests/pl/Tests_2007/Ordered and unordered lists.html tests/pl/Tests_2007/Strong and em together.html tests/pl/Tests_2007/Tabs.html tests/pl/Tests_2007/Tidyness.html tests/test_syntax/__init__.py tests/test_syntax/blocks/__init__.py tests/test_syntax/blocks/test_code_blocks.py tests/test_syntax/blocks/test_headers.py tests/test_syntax/blocks/test_hr.py tests/test_syntax/blocks/test_paragraphs.py tests/test_syntax/extensions/__init__.py tests/test_syntax/extensions/test_fenced_code.py tests/test_syntax/extensions/test_footnotes.py tests/test_syntax/extensions/test_legacy_attrs.py tests/test_syntax/extensions/test_legacy_em.py tests/test_syntax/extensions/test_tables.py tests/test_syntax/inline/__init__.py tests/test_syntax/inline/test_emphasis.py tests/test_syntax/inline/test_entities.py tests/test_syntax/inline/test_images.py tests/test_syntax/inline/test_links.pyMarkdown-3.1.1/Markdown.egg-info/dependency_links.txt0000644000076500000240000000000113470647776023263 0ustar waylanstaff00000000000000 Markdown-3.1.1/Markdown.egg-info/entry_points.txt0000644000076500000240000000201313470647776022507 0ustar waylanstaff00000000000000[console_scripts] markdown_py = markdown.__main__:run [markdown.extensions] abbr = markdown.extensions.abbr:AbbrExtension admonition = markdown.extensions.admonition:AdmonitionExtension attr_list = markdown.extensions.attr_list:AttrListExtension codehilite = markdown.extensions.codehilite:CodeHiliteExtension def_list = markdown.extensions.def_list:DefListExtension extra = markdown.extensions.extra:ExtraExtension fenced_code = markdown.extensions.fenced_code:FencedCodeExtension footnotes = markdown.extensions.footnotes:FootnoteExtension legacy_attrs = markdown.extensions.legacy_attrs:LegacyAttrExtension legacy_em = markdown.extensions.legacy_em:LegacyEmExtension meta = markdown.extensions.meta:MetaExtension nl2br = markdown.extensions.nl2br:Nl2BrExtension sane_lists = markdown.extensions.sane_lists:SaneListExtension smarty = markdown.extensions.smarty:SmartyExtension tables = markdown.extensions.tables:TableExtension toc = markdown.extensions.toc:TocExtension wikilinks = markdown.extensions.wikilinks:WikiLinkExtension Markdown-3.1.1/Markdown.egg-info/requires.txt0000644000076500000240000000005213470647776021612 0ustar waylanstaff00000000000000setuptools>=36 [testing] coverage pyyaml Markdown-3.1.1/Markdown.egg-info/top_level.txt0000644000076500000240000000001113470647776021737 0ustar waylanstaff00000000000000markdown Markdown-3.1.1/PKG-INFO0000644000076500000240000000440213470647777015037 0ustar waylanstaff00000000000000Metadata-Version: 2.1 Name: Markdown Version: 3.1.1 Summary: Python implementation of Markdown. Home-page: https://Python-Markdown.github.io/ Author: Manfred Stienstra, Yuri takhteyev and Waylan limberg Author-email: waylan.limberg@icloud.com Maintainer: Waylan Limberg Maintainer-email: waylan.limberg@icloud.com License: BSD License Download-URL: http://pypi.python.org/packages/source/M/Markdown/Markdown-3.1.1-py2.py3-none-any.whl Description: This is a Python implementation of John Gruber's Markdown_. It is almost completely compliant with the reference implementation, though there are a few known issues. See Features_ for information on what exactly is supported and what is not. Additional features are supported by the `Available Extensions`_. .. _Markdown: http://daringfireball.net/projects/markdown/ .. _Features: https://Python-Markdown.github.io#features .. _`Available Extensions`: https://Python-Markdown.github.io/extensions/ Support ======= You may report bugs, ask for help, and discuss various other issues on the `bug tracker`_. .. _`bug tracker`: http://github.com/Python-Markdown/markdown/issues Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Topic :: Communications :: Email :: Filters Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries Classifier: Topic :: Internet :: WWW/HTTP :: Site Management Classifier: Topic :: Software Development :: Documentation Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Text Processing :: Filters Classifier: Topic :: Text Processing :: Markup :: HTML Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.* Provides-Extra: testing Markdown-3.1.1/README.md0000644000076500000240000000441413440325655015205 0ustar waylanstaff00000000000000[Python-Markdown][] =================== [![Build Status][travis-button]][travis] [![Coverage Status][codecov-button]][codecov] [![Latest Version][mdversion-button]][md-pypi] [![Python Versions][pyversion-button]][md-pypi] [![BSD License][bsdlicense-button]][bsdlicense] [![Code of Conduct][codeofconduct-button]][Code of Conduct] [travis-button]: http://img.shields.io/travis/Python-Markdown/markdown.svg [travis]: https://travis-ci.org/Python-Markdown/markdown [codecov-button]: https://codecov.io/gh/Python-Markdown/markdown/branch/master/graph/badge.svg [codecov]: https://codecov.io/gh/Python-Markdown/markdown [mdversion-button]: http://img.shields.io/pypi/v/Markdown.svg [md-pypi]: http://pypi.python.org/pypi/Markdown [pyversion-button]: http://img.shields.io/pypi/pyversions/Markdown.svg [bsdlicense-button]: http://img.shields.io/badge/license-BSD-yellow.svg [bsdlicense]: http://opensource.org/licenses/BSD-3-Clause [codeofconduct-button]: https://img.shields.io/badge/code%20of%20conduct-contributor%20covenant-green.svg?style=flat-square [Code of Conduct]: https://github.com/Python-Markdown/markdown/blob/master/CODE_OF_CONDUCT.md This is a Python implementation of John Gruber's [Markdown][]. It is almost completely compliant with the reference implementation, though there are a few known issues. See [Features][] for information on what exactly is supported and what is not. Additional features are supported by the [Available Extensions][]. [Python-Markdown]: https://Python-Markdown.github.io/ [Markdown]: http://daringfireball.net/projects/markdown/ [Features]: https://Python-Markdown.github.io#Features [Available Extensions]: https://Python-Markdown.github.io/extensions Documentation ------------- Installation and usage documentation is available in the `docs/` directory of the distribution and on the project website at . See the change log at . Support ------- You may report bugs, ask for help, and discuss various other issues on the [bug tracker][]. [bug tracker]: http://github.com/Python-Markdown/markdown/issues Code of Conduct --------------- Everyone interacting in the Python-Markdown project's codebases, issue trackers, and mailing lists is expected to follow the [Code of Conduct]. Markdown-3.1.1/doc-requirements.txt0000644000076500000240000000003213432642364017745 0ustar waylanstaff00000000000000mkdocs>=1.0 mkdocs-nature Markdown-3.1.1/docs/0000755000076500000240000000000013470647777014672 5ustar waylanstaff00000000000000Markdown-3.1.1/docs/authors.md0000644000076500000240000000434213432642364016665 0ustar waylanstaff00000000000000title: Authors Primary Authors =============== * __[Waylan Limberg](https://github.com/waylan)__ @waylan is the current maintainer of the code and has written much of the current code base, included a complete refactor of the core for version 2.0. He started out by authoring many of the available extensions and later was asked to join Yuri, where he began fixing numerous bugs, adding documentation and making general improvements to the existing code base. * __[Dmitry Shachnev](https://github.com/mitya57)__ @mitya57 joined the team after providing a number of helpful patches and has been assisting with maintenance, reviewing pull requests and ticket triage. * __[Isaac Muse](https://github.com/facelessuser)__ @facelessuser joined the team after providing a number of helpful patches and has been assisting with maintenance, reviewing pull requests and ticket triage. * __[Yuri Takteyev](http://freewisdom.org/)__ Yuri wrote most of the code found in version 1.x while procrastinating his Ph.D. Various pieces of his code still exist, most notably the basic structure. * __[Manfed Stienstra](http://www.dwerg.net/)__ Manfed wrote the original version of the script and is responsible for various parts of the existing code base. * __Artem Yunusov__ Artem, who as part of a 2008 GSoC project, refactored inline patterns, replaced the NanoDOM with ElementTree support and made various other improvements. * __David Wolever__ David refactored the extension API and made other improvements as he helped to integrate Markdown into Dr.Project. Other Contributors ================== The incomplete list of individuals below have provided patches or otherwise contributed to the project prior to the project being hosted on GitHub. See the GitHub commit log for a list of recent contributors. We would like to thank everyone who has contributed to the project in any way. * Eric Abrahamsen * Jeff Balogh * Sergej Chodarev * Chris Clark * Tiago Cogumbreiro * Kjell Magne Fauske * G. Clark Haynes * Daniel Krech * Steward Midwinter * Jack Miller * Neale Pickett * Paul Stansifer * John Szakmeister * Malcolm Tredinnick * Ben Wilson * and many others who helped by reporting bugs Markdown-3.1.1/docs/change_log/0000755000076500000240000000000013470647777016760 5ustar waylanstaff00000000000000Markdown-3.1.1/docs/change_log/index.md0000644000076500000240000002160013470646542020375 0ustar waylanstaff00000000000000title: Change Log Python-Markdown Change Log ========================= May 20, 2019: Released version 3.1.1 (a bug-fix release). * Fixed import failure in `setup.py` when the source directory is not on `sys.path` (#823). * Prefer public `packaging` module to pkg_resources' private copy of it (#825). Mar 25, 2019: Released version 3.1 ([Notes](release-3.1.md)). Sept 28, 2018: Released version 3.0.1 (a bug-fix release). * Brought back the `version` and `version_info` variables (#709). * Added support for hexadecimal HTML entities (#712). Sept 21, 2018: Released version 3.0 ([Notes](release-3.0.md)). Jan 4, 2018: Released version 2.6.11 (a bug-fix release). Added a new `BACKLINK-TITLE` option to the footnote extension so that non-English users can provide a custom title to back links (see #610). Dec 7, 2017: Released version 2.6.10 (a documentation update). Aug 17, 2017: Released version 2.6.9 (a bug-fix release). Jan 25, 2017: Released version 2.6.8 (a bug-fix release). Sept 23, 2016: Released version 2.6.7 (a bug-fix release). Mar 20, 2016: Released version 2.6.6 (a bug-fix release). Nov 24, 2015: Released version 2.6.5 (a bug-fix release). Nov 6, 2015: Released version 2.6.4 (a bug-fix release). Oct 26, 2015: Released version 2.6.3 (a bug-fix release). Apr 20, 2015: Released version 2.6.2 (a bug-fix release). Mar 8, 2015: Released version 2.6.1 (a bug-fix release). The (new) `yaml` option has been removed from the Meta-Data Extension as it was buggy (see [#390](https://github.com/Python-Markdown/markdown/issues/390)). Feb 19, 2015: Released version 2.6 ([Notes](release-2.6.md)). Nov 19, 2014: Released version 2.5.2 (a bug-fix release). Sept 26, 2014: Released version 2.5.1 (a bug-fix release). Sept 12, 2014: Released version 2.5.0 ([Notes](release-2.5.md)). Feb 16, 2014: Released version 2.4.0 ([Notes](release-2.4.md)). Mar 22, 2013: Released version 2.3.1 (a bug-fix release). Mar 14, 2013: Released version 2.3.0 ([Notes](release-2.3.md)) Nov 4, 2012: Released version 2.2.1 (a bug-fix release). Jul 5, 2012: Released version 2.2.0 ([Notes](release-2.2.md)). Jan 22, 2012: Released version 2.1.1 (a bug-fix release). Nov 24, 2011: Released version 2.1.0 ([Notes](release-2.1.md)). Oct 7, 2009: Released version 2.0.3. (a bug-fix release). Sept 28, 2009: Released version 2.0.2 (a bug-fix release). May 20, 2009: Released version 2.0.1 (a bug-fix release). Mar 30, 2009: Released version 2.0 ([Notes](release-2.0.md)). Mar 8, 2009: Release Candidate 2.0-rc-1. Feb 2009: Added support for multi-level lists to new Blockprocessors. Jan 2009: Added HTML 4 output as an option (thanks Eric Abrahamsen) Nov 2008: Added Definition List ext. Replaced old core with Blockprocessors. Broken up into multiple files. Oct 2008: Changed logging behavior to work better with other systems. Refactored tree traversing. Added `treap` implementation, then replaced with OrderedDict. Renamed various processors to better reflect what they actually do. Refactored footnote ext to match PHP Extra's output. Sept 2008: Moved `prettifyTree` to a Postprocessor, replaced WikiLink ext with WikiLinks (note the s) ext (uses bracketed links instead of CamelCase) and various bug fixes. August 18 2008: Reorganized directory structure. Added a 'docs' directory and moved all extensions into a 'markdown-extensions' package. Added additional documentation and a few bug fixes. (v2.0-beta) August 4 2008: Updated included extensions to ElementTree. Added a separate command line script. (v2.0-alpha) July 2008: Switched from home-grown NanoDOM to ElementTree and various related bugs (thanks Artem Yunusov). June 2008: Fixed issues with nested inline patterns and cleaned up testing framework (thanks Artem Yunusov). May 2008: Added a number of additional extensions to the distribution and other minor changes. Moved repository to git from svn. Mar 2008: Refactored extension API to accept either an extension name (as a string) or an instance of an extension (Thanks David Wolever). Fixed various bugs and added doc strings. Feb 2008: Various bug-fixes mostly regarding extensions. Feb 18, 2008: Version 1.7. Feb 13, 2008: A little code cleanup and better documentation and inheritance for Preprocessors/Postprocessors. Feb 9, 2008: Double-quotes no longer HTML escaped and raw HTML honors ``, `<@foo>`, and `<%foo>` for those who run markdown on template syntax. Dec 12, 2007: Updated docs. Removed encoding argument from Markdown and markdown as per list discussion. Clean up in prep for 1.7. Nov 29, 2007: Added support for images inside links. Also fixed a few bugs in the footnote extension. Nov 19, 2007: `message` now uses python's logging module. Also removed limit imposed by recursion in `_process_section()`. You can now parse as long of a document as your memory can handle. Nov 5, 2007: Moved `safe_mode` code to a `textPostprocessor` and added escaping option. Nov 3, 2007: Fixed convert method to accept empty strings. Oct 30, 2007: Fixed `BOM` removal (thanks Malcolm Tredinnick). Fixed infinite loop in bracket regular expression for inline links. Oct 11, 2007: `LineBreaks` is now an `inlinePattern`. Fixed `HR` in blockquotes. Refactored `_processSection` method (see tracker #1793419). Oct 9, 2007: Added `textPreprocessor` (from 1.6b). Oct 8, 2008: Fixed Lazy Blockquote. Fixed code block on first line. Fixed empty inline image link. Oct 7, 2007: Limit recursion on inline patterns. Added a 'safe' tag to `htmlStash`. March 18, 2007: Fixed or merged a bunch of minor bugs, including multi-line comments and markup inside links. (Tracker #s: 1683066, 1671153, 1661751, 1627935, 1544371, 1458139.) -> v. 1.6b Oct 10, 2006: Fixed a bug that caused some text to be lost after comments. Added "safe mode" (user's HTML tags are removed). Sept 6, 2006: Added exception for PHP tags when handling HTML blocks. August 7, 2006: Incorporated Sergej Chodarev's patch to fix a problem with ampersand normalization and HTML blocks. July 10, 2006: Switched to using `optparse`. Added proper support for Unicode. July 9, 2006: Fixed the `" % _escape_cdata(text)) elif tag is ProcessingInstruction: write("" % _escape_cdata(text)) elif tag is None: if text: write(_escape_cdata(text)) for e in elem: _serialize_html(write, e, format) else: namespace_uri = None if isinstance(tag, QName): # QNAME objects store their data as a string: `{uri}tag` if tag.text[:1] == "{": namespace_uri, tag = tag.text[1:].split("}", 1) else: raise ValueError('QName objects must define a tag.') write("<" + tag) items = elem.items() if items: items = sorted(items) # lexical order for k, v in items: if isinstance(k, QName): # Assume a text only QName k = k.text if isinstance(v, QName): # Assume a text only QName v = v.text else: v = _escape_attrib_html(v) if k == v and format == 'html': # handle boolean attributes write(" %s" % v) else: write(' %s="%s"' % (k, v)) if namespace_uri: write(' xmlns="%s"' % (_escape_attrib(namespace_uri))) if format == "xhtml" and tag.lower() in HTML_EMPTY: write(" />") else: write(">") if text: if tag.lower() in ["script", "style"]: write(text) else: write(_escape_cdata(text)) for e in elem: _serialize_html(write, e, format) if tag.lower() not in HTML_EMPTY: write("") if elem.tail: write(_escape_cdata(elem.tail)) def _write_html(root, format="html"): assert root is not None data = [] write = data.append _serialize_html(write, root, format) return "".join(data) # -------------------------------------------------------------------- # public functions def to_html_string(element): return _write_html(ElementTree(element).getroot(), format="html") def to_xhtml_string(element): return _write_html(ElementTree(element).getroot(), format="xhtml") Markdown-3.1.1/markdown/test_tools.py0000644000076500000240000001601013330711640020303 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from __future__ import absolute_import import os import io import unittest import textwrap from . import markdown try: import tidylib except ImportError: tidylib = None __all__ = ['TestCase', 'LegacyTestCase', 'Kwargs'] class TestCase(unittest.TestCase): """ A unittest.TestCase subclass with helpers for testing Markdown output. Define `default_kwargs` as a dict of keywords to pass to Markdown for each test. The defaults can be overridden on individual tests. The `assertMarkdownRenders` method accepts the source text, the expected output, and any keywords to pass to Markdown. The `default_kwargs` are used except where overridden by `kwargs`. The ouput and expected ouput are passed to `TestCase.assertMultiLineEqual`. An AssertionError is raised with a diff if the actual output does not equal the expected output. The `dedent` method is available to dedent triple-quoted strings if necessary. In all other respects, behaves as unittest.TestCase. """ default_kwargs = {} def assertMarkdownRenders(self, source, expected, **kwargs): """ Test that source Markdown text renders to expected output with given keywords. """ kws = self.default_kwargs.copy() kws.update(kwargs) output = markdown(source, **kws) self.assertMultiLineEqual(output, expected) def dedent(self, text): """ Dedent text. """ # TODO: If/when actual output ends with a newline, then use: # return textwrap.dedent(text.strip('/n')) return textwrap.dedent(text).strip() ######################### # Legacy Test Framework # ######################### class Kwargs(dict): """ A dict like class for holding keyword arguments. """ pass def _normalize_whitespace(text): """ Normalize whitespace for a string of html using tidylib. """ output, errors = tidylib.tidy_fragment(text, options={ 'drop_empty_paras': 0, 'fix_backslash': 0, 'fix_bad_comments': 0, 'fix_uri': 0, 'join_styles': 0, 'lower_literals': 0, 'merge_divs': 0, 'output_xhtml': 1, 'quote_ampersand': 0, 'newline': 'LF' }) return output class LegacyTestMeta(type): def __new__(cls, name, bases, dct): def generate_test(infile, outfile, normalize, kwargs): def test(self): with io.open(infile, encoding="utf-8") as f: input = f.read() with io.open(outfile, encoding="utf-8") as f: # Normalize line endings # (on Windows, git may have altered line endings). expected = f.read().replace("\r\n", "\n") output = markdown(input, **kwargs) if tidylib and normalize: expected = _normalize_whitespace(expected) output = _normalize_whitespace(output) elif normalize: self.skipTest('Tidylib not available.') self.assertMultiLineEqual(output, expected) return test location = dct.get('location', '') exclude = dct.get('exclude', []) normalize = dct.get('normalize', False) input_ext = dct.get('input_ext', '.txt') output_ext = dct.get('output_ext', '.html') kwargs = dct.get('default_kwargs', Kwargs()) if os.path.isdir(location): for file in os.listdir(location): infile = os.path.join(location, file) if os.path.isfile(infile): tname, ext = os.path.splitext(file) if ext == input_ext: outfile = os.path.join(location, tname + output_ext) tname = tname.replace(' ', '_').replace('-', '_') kws = kwargs.copy() if tname in dct: kws.update(dct[tname]) test_name = 'test_%s' % tname if tname not in exclude: dct[test_name] = generate_test(infile, outfile, normalize, kws) else: dct[test_name] = unittest.skip('Excluded')(lambda: None) return type.__new__(cls, name, bases, dct) # Define LegacyTestCase class with metaclass in Py2 & Py3 compatible way. # See https://stackoverflow.com/a/38668373/866026 # TODO: If/when py2 support is dropped change to: # class LegacyTestCase(unittest.Testcase, metaclass=LegacyTestMeta) class LegacyTestCase(LegacyTestMeta('LegacyTestCase', (unittest.TestCase,), {'__slots__': ()})): """ A `unittest.TestCase` subclass for running Markdown's legacy file-based tests. A subclass should define various properties which point to a directory of text-based test files and define various behaviors/defaults for those tests. The following properties are supported: location: A path to the directory fo test files. An absolute path is preferred. exclude: A list of tests to exclude. Each test name should comprise the filename without an extension. normalize: A boolean value indicating if the HTML should be normalized. Default: `False`. input_ext: A string containing the file extension of input files. Default: `.txt`. ouput_ext: A string containing the file extension of expected output files. Default: `html`. default_kwargs: A `Kwargs` instance which stores the default set of keyword arguments for all test files in the directory. In addition, properties can be defined for each individual set of test files within the directory. The property should be given the name of the file wihtout the file extension. Any spaces and dashes in the filename should be replaced with underscores. The value of the property should be a `Kwargs` instance which contains the keyword arguments that should be passed to `Markdown` for that test file. The keyword arguments will "update" the `default_kwargs`. When the class instance is created, it will walk the given directory and create a separate unitttest for each set of test files using the naming scheme: `test_filename`. One unittest will be run for each set of input and output files. """ pass Markdown-3.1.1/markdown/treeprocessors.py0000644000076500000240000003615613432642364021214 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from __future__ import unicode_literals from __future__ import absolute_import from . import util from . import inlinepatterns def build_treeprocessors(md, **kwargs): """ Build the default treeprocessors for Markdown. """ treeprocessors = util.Registry() treeprocessors.register(InlineProcessor(md), 'inline', 20) treeprocessors.register(PrettifyTreeprocessor(md), 'prettify', 10) return treeprocessors def isString(s): """ Check if it's string """ if not isinstance(s, util.AtomicString): return isinstance(s, util.string_type) return False class Treeprocessor(util.Processor): """ Treeprocessors are run on the ElementTree object before serialization. Each Treeprocessor implements a "run" method that takes a pointer to an ElementTree, modifies it as necessary and returns an ElementTree object. Treeprocessors must extend markdown.Treeprocessor. """ def run(self, root): """ Subclasses of Treeprocessor should implement a `run` method, which takes a root ElementTree. This method can return another ElementTree object, and the existing root ElementTree will be replaced, or it can modify the current tree and return None. """ pass # pragma: no cover class InlineProcessor(Treeprocessor): """ A Treeprocessor that traverses a tree, applying inline patterns. """ def __init__(self, md): self.__placeholder_prefix = util.INLINE_PLACEHOLDER_PREFIX self.__placeholder_suffix = util.ETX self.__placeholder_length = 4 + len(self.__placeholder_prefix) \ + len(self.__placeholder_suffix) self.__placeholder_re = util.INLINE_PLACEHOLDER_RE self.md = md self.inlinePatterns = md.inlinePatterns self.ancestors = [] @property @util.deprecated("Use 'md' instead.") def markdown(self): # TODO: remove this later return self.md def __makePlaceholder(self, type): """ Generate a placeholder """ id = "%04d" % len(self.stashed_nodes) hash = util.INLINE_PLACEHOLDER % id return hash, id def __findPlaceholder(self, data, index): """ Extract id from data string, start from index Keyword arguments: * data: string * index: index, from which we start search Returns: placeholder id and string index, after the found placeholder. """ m = self.__placeholder_re.search(data, index) if m: return m.group(1), m.end() else: return None, index + 1 def __stashNode(self, node, type): """ Add node to stash """ placeholder, id = self.__makePlaceholder(type) self.stashed_nodes[id] = node return placeholder def __handleInline(self, data, patternIndex=0): """ Process string with inline patterns and replace it with placeholders Keyword arguments: * data: A line of Markdown text * patternIndex: The index of the inlinePattern to start with Returns: String with placeholders. """ if not isinstance(data, util.AtomicString): startIndex = 0 while patternIndex < len(self.inlinePatterns): data, matched, startIndex = self.__applyPattern( self.inlinePatterns[patternIndex], data, patternIndex, startIndex ) if not matched: patternIndex += 1 return data def __processElementText(self, node, subnode, isText=True): """ Process placeholders in Element.text or Element.tail of Elements popped from self.stashed_nodes. Keywords arguments: * node: parent node * subnode: processing node * isText: bool variable, True - it's text, False - it's tail Returns: None """ if isText: text = subnode.text subnode.text = None else: text = subnode.tail subnode.tail = None childResult = self.__processPlaceholders(text, subnode, isText) if not isText and node is not subnode: pos = list(node).index(subnode) + 1 else: pos = 0 childResult.reverse() for newChild in childResult: node.insert(pos, newChild[0]) def __processPlaceholders(self, data, parent, isText=True): """ Process string with placeholders and generate ElementTree tree. Keyword arguments: * data: string with placeholders instead of ElementTree elements. * parent: Element, which contains processing inline data Returns: list with ElementTree elements with applied inline patterns. """ def linkText(text): if text: if result: if result[-1][0].tail: result[-1][0].tail += text else: result[-1][0].tail = text elif not isText: if parent.tail: parent.tail += text else: parent.tail = text else: if parent.text: parent.text += text else: parent.text = text result = [] strartIndex = 0 while data: index = data.find(self.__placeholder_prefix, strartIndex) if index != -1: id, phEndIndex = self.__findPlaceholder(data, index) if id in self.stashed_nodes: node = self.stashed_nodes.get(id) if index > 0: text = data[strartIndex:index] linkText(text) if not isString(node): # it's Element for child in [node] + list(node): if child.tail: if child.tail.strip(): self.__processElementText( node, child, False ) if child.text: if child.text.strip(): self.__processElementText(child, child) else: # it's just a string linkText(node) strartIndex = phEndIndex continue strartIndex = phEndIndex result.append((node, self.ancestors[:])) else: # wrong placeholder end = index + len(self.__placeholder_prefix) linkText(data[strartIndex:end]) strartIndex = end else: text = data[strartIndex:] if isinstance(data, util.AtomicString): # We don't want to loose the AtomicString text = util.AtomicString(text) linkText(text) data = "" return result def __applyPattern(self, pattern, data, patternIndex, startIndex=0): """ Check if the line fits the pattern, create the necessary elements, add it to stashed_nodes. Keyword arguments: * data: the text to be processed * pattern: the pattern to be checked * patternIndex: index of current pattern * startIndex: string index, from which we start searching Returns: String with placeholders instead of ElementTree elements. """ new_style = isinstance(pattern, inlinepatterns.InlineProcessor) for exclude in pattern.ANCESTOR_EXCLUDES: if exclude.lower() in self.ancestors: return data, False, 0 if new_style: match = None # Since handleMatch may reject our first match, # we iterate over the buffer looking for matches # until we can't find any more. for match in pattern.getCompiledRegExp().finditer(data, startIndex): node, start, end = pattern.handleMatch(match, data) if start is None or end is None: startIndex += match.end(0) match = None continue break else: # pragma: no cover match = pattern.getCompiledRegExp().match(data[startIndex:]) leftData = data[:startIndex] if not match: return data, False, 0 if not new_style: # pragma: no cover node = pattern.handleMatch(match) start = match.start(0) end = match.end(0) if node is None: return data, True, end if not isString(node): if not isinstance(node.text, util.AtomicString): # We need to process current node too for child in [node] + list(node): if not isString(node): if child.text: self.ancestors.append(child.tag.lower()) child.text = self.__handleInline( child.text, patternIndex + 1 ) self.ancestors.pop() if child.tail: child.tail = self.__handleInline( child.tail, patternIndex ) placeholder = self.__stashNode(node, pattern.type()) if new_style: return "%s%s%s" % (data[:start], placeholder, data[end:]), True, 0 else: # pragma: no cover return "%s%s%s%s" % (leftData, match.group(1), placeholder, match.groups()[-1]), True, 0 def __build_ancestors(self, parent, parents): """Build the ancestor list.""" ancestors = [] while parent is not None: if parent is not None: ancestors.append(parent.tag.lower()) parent = self.parent_map.get(parent) ancestors.reverse() parents.extend(ancestors) def run(self, tree, ancestors=None): """Apply inline patterns to a parsed Markdown tree. Iterate over ElementTree, find elements with inline tag, apply inline patterns and append newly created Elements to tree. If you don't want to process your data with inline paterns, instead of normal string, use subclass AtomicString: node.text = markdown.AtomicString("This will not be processed.") Arguments: * tree: ElementTree object, representing Markdown tree. * ancestors: List of parent tag names that precede the tree node (if needed). Returns: ElementTree object with applied inline patterns. """ self.stashed_nodes = {} # Ensure a valid parent list, but copy passed in lists # to ensure we don't have the user accidentally change it on us. tree_parents = [] if ancestors is None else ancestors[:] self.parent_map = dict((c, p) for p in tree.iter() for c in p) stack = [(tree, tree_parents)] while stack: currElement, parents = stack.pop() self.ancestors = parents self.__build_ancestors(currElement, self.ancestors) insertQueue = [] for child in currElement: if child.text and not isinstance( child.text, util.AtomicString ): self.ancestors.append(child.tag.lower()) text = child.text child.text = None lst = self.__processPlaceholders( self.__handleInline(text), child ) for l in lst: self.parent_map[l[0]] = child stack += lst insertQueue.append((child, lst)) self.ancestors.pop() if child.tail: tail = self.__handleInline(child.tail) dumby = util.etree.Element('d') child.tail = None tailResult = self.__processPlaceholders(tail, dumby, False) if dumby.tail: child.tail = dumby.tail pos = list(currElement).index(child) + 1 tailResult.reverse() for newChild in tailResult: self.parent_map[newChild[0]] = currElement currElement.insert(pos, newChild[0]) if len(child): self.parent_map[child] = currElement stack.append((child, self.ancestors[:])) for element, lst in insertQueue: for i, obj in enumerate(lst): newChild = obj[0] element.insert(i, newChild) return tree class PrettifyTreeprocessor(Treeprocessor): """ Add linebreaks to the html document. """ def _prettifyETree(self, elem): """ Recursively add linebreaks to ElementTree children. """ i = "\n" if self.md.is_block_level(elem.tag) and elem.tag not in ['code', 'pre']: if (not elem.text or not elem.text.strip()) \ and len(elem) and self.md.is_block_level(elem[0].tag): elem.text = i for e in elem: if self.md.is_block_level(e.tag): self._prettifyETree(e) if not elem.tail or not elem.tail.strip(): elem.tail = i if not elem.tail or not elem.tail.strip(): elem.tail = i def run(self, root): """ Add linebreaks to ElementTree root object. """ self._prettifyETree(root) # Do
's separately as they are often in the middle of # inline content and missed by _prettifyETree. brs = root.iter('br') for br in brs: if not br.tail or not br.tail.strip(): br.tail = '\n' else: br.tail = '\n%s' % br.tail # Clean up extra empty lines at end of code blocks. pres = root.iter('pre') for pre in pres: if len(pre) and pre[0].tag == 'code': pre[0].text = util.AtomicString(pre[0].text.rstrip() + '\n') Markdown-3.1.1/markdown/util.py0000644000076500000240000003657213432642364017111 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from __future__ import unicode_literals import re import sys from collections import namedtuple from functools import wraps import warnings """ Python 3 Stuff ============================================================================= """ PY3 = sys.version_info[0] == 3 PY37 = (3, 7) <= sys.version_info if PY3: # pragma: no cover string_type = str text_type = str int2str = chr iterrange = range else: # pragma: no cover string_type = basestring # noqa text_type = unicode # noqa int2str = unichr # noqa iterrange = xrange # noqa """ Constants you might want to modify ----------------------------------------------------------------------------- """ BLOCK_LEVEL_ELEMENTS = [ # Elements which are invalid to wrap in a `

` tag. # See http://w3c.github.io/html/grouping-content.html#the-p-element 'address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul', # Other elements which Markdown should not be mucking up the contents of. 'canvas', 'dd', 'dt', 'group', 'iframe', 'li', 'math', 'noscript', 'output', 'progress', 'script', 'style', 'tbody', 'td', 'th', 'thead', 'tr', 'video' ] # Placeholders STX = '\u0002' # Use STX ("Start of text") for start-of-placeholder ETX = '\u0003' # Use ETX ("End of text") for end-of-placeholder INLINE_PLACEHOLDER_PREFIX = STX+"klzzwxh:" INLINE_PLACEHOLDER = INLINE_PLACEHOLDER_PREFIX + "%s" + ETX INLINE_PLACEHOLDER_RE = re.compile(INLINE_PLACEHOLDER % r'([0-9]+)') AMP_SUBSTITUTE = STX+"amp"+ETX HTML_PLACEHOLDER = STX + "wzxhzdk:%s" + ETX HTML_PLACEHOLDER_RE = re.compile(HTML_PLACEHOLDER % r'([0-9]+)') TAG_PLACEHOLDER = STX + "hzzhzkh:%s" + ETX """ Constants you probably do not need to change ----------------------------------------------------------------------------- """ RTL_BIDI_RANGES = ( ('\u0590', '\u07FF'), # Hebrew (0590-05FF), Arabic (0600-06FF), # Syriac (0700-074F), Arabic supplement (0750-077F), # Thaana (0780-07BF), Nko (07C0-07FF). ('\u2D30', '\u2D7F') # Tifinagh ) # Extensions should use "markdown.util.etree" instead of "etree" (or do `from # markdown.util import etree`). Do not import it by yourself. try: # pragma: no cover # Is the C implementation of ElementTree available? import xml.etree.cElementTree as etree from xml.etree.ElementTree import Comment # Serializers (including ours) test with non-c Comment etree.test_comment = Comment if etree.VERSION < "1.0.5": raise RuntimeError("cElementTree version 1.0.5 or higher is required.") except (ImportError, RuntimeError): # pragma: no cover # Use the Python implementation of ElementTree? import xml.etree.ElementTree as etree if etree.VERSION < "1.1": raise RuntimeError("ElementTree version 1.1 or higher is required") """ AUXILIARY GLOBAL FUNCTIONS ============================================================================= """ def deprecated(message, stacklevel=2): """ Raise a DeprecationWarning when wrapped function/method is called. Borrowed from https://stackoverflow.com/a/48632082/866026 """ def deprecated_decorator(func): @wraps(func) def deprecated_func(*args, **kwargs): warnings.warn( "'{}' is deprecated. {}".format(func.__name__, message), category=DeprecationWarning, stacklevel=stacklevel ) return func(*args, **kwargs) return deprecated_func return deprecated_decorator @deprecated("Use 'Markdown.is_block_level' instead.") def isBlockLevel(tag): """Check if the tag is a block level HTML tag.""" if isinstance(tag, string_type): return tag.lower().rstrip('/') in BLOCK_LEVEL_ELEMENTS # Some ElementTree tags are not strings, so return False. return False def parseBoolValue(value, fail_on_errors=True, preserve_none=False): """Parses a string representing bool value. If parsing was successful, returns True or False. If preserve_none=True, returns True, False, or None. If parsing was not successful, raises ValueError, or, if fail_on_errors=False, returns None.""" if not isinstance(value, string_type): if preserve_none and value is None: return value return bool(value) elif preserve_none and value.lower() == 'none': return None elif value.lower() in ('true', 'yes', 'y', 'on', '1'): return True elif value.lower() in ('false', 'no', 'n', 'off', '0', 'none'): return False elif fail_on_errors: raise ValueError('Cannot parse bool value: %r' % value) def code_escape(text): """Escape code.""" if "&" in text: text = text.replace("&", "&") if "<" in text: text = text.replace("<", "<") if ">" in text: text = text.replace(">", ">") return text """ MISC AUXILIARY CLASSES ============================================================================= """ class AtomicString(text_type): """A string which should not be further processed.""" pass class Processor(object): def __init__(self, md=None): self.md = md @property @deprecated("Use 'md' instead.") def markdown(self): # TODO: remove this later return self.md class HtmlStash(object): """ This class is used for stashing HTML objects that we extract in the beginning and replace with place-holders. """ def __init__(self): """ Create a HtmlStash. """ self.html_counter = 0 # for counting inline html segments self.rawHtmlBlocks = [] self.tag_counter = 0 self.tag_data = [] # list of dictionaries in the order tags appear def store(self, html): """ Saves an HTML segment for later reinsertion. Returns a placeholder string that needs to be inserted into the document. Keyword arguments: * html: an html segment Returns : a placeholder string """ self.rawHtmlBlocks.append(html) placeholder = self.get_placeholder(self.html_counter) self.html_counter += 1 return placeholder def reset(self): self.html_counter = 0 self.rawHtmlBlocks = [] def get_placeholder(self, key): return HTML_PLACEHOLDER % key def store_tag(self, tag, attrs, left_index, right_index): """Store tag data and return a placeholder.""" self.tag_data.append({'tag': tag, 'attrs': attrs, 'left_index': left_index, 'right_index': right_index}) placeholder = TAG_PLACEHOLDER % str(self.tag_counter) self.tag_counter += 1 # equal to the tag's index in self.tag_data return placeholder # Used internally by `Registry` for each item in its sorted list. # Provides an easier to read API when editing the code later. # For example, `item.name` is more clear than `item[0]`. _PriorityItem = namedtuple('PriorityItem', ['name', 'priority']) class Registry(object): """ A priority sorted registry. A `Registry` instance provides two public methods to alter the data of the registry: `register` and `deregister`. Use `register` to add items and `deregister` to remove items. See each method for specifics. When registering an item, a "name" and a "priority" must be provided. All items are automatically sorted by "priority" from highest to lowest. The "name" is used to remove ("deregister") and get items. A `Registry` instance it like a list (which maintains order) when reading data. You may iterate over the items, get an item and get a count (length) of all items. You may also check that the registry contains an item. When getting an item you may use either the index of the item or the string-based "name". For example: registry = Registry() registry.register(SomeItem(), 'itemname', 20) # Get the item by index item = registry[0] # Get the item by name item = registry['itemname'] When checking that the registry contains an item, you may use either the string-based "name", or a reference to the actual item. For example: someitem = SomeItem() registry.register(someitem, 'itemname', 20) # Contains the name assert 'itemname' in registry # Contains the item instance assert someitem in registry The method `get_index_for_name` is also available to obtain the index of an item using that item's assigned "name". """ def __init__(self): self._data = {} self._priority = [] self._is_sorted = False def __contains__(self, item): if isinstance(item, string_type): # Check if an item exists by this name. return item in self._data.keys() # Check if this instance exists. return item in self._data.values() def __iter__(self): self._sort() return iter([self._data[k] for k, p in self._priority]) def __getitem__(self, key): self._sort() if isinstance(key, slice): data = Registry() for k, p in self._priority[key]: data.register(self._data[k], k, p) return data if isinstance(key, int): return self._data[self._priority[key].name] return self._data[key] def __len__(self): return len(self._priority) def __repr__(self): return '<{0}({1})>'.format(self.__class__.__name__, list(self)) def get_index_for_name(self, name): """ Return the index of the given name. """ if name in self: self._sort() return self._priority.index( [x for x in self._priority if x.name == name][0] ) raise ValueError('No item named "{0}" exists.'.format(name)) def register(self, item, name, priority): """ Add an item to the registry with the given name and priority. Parameters: * `item`: The item being registered. * `name`: A string used to reference the item. * `priority`: An integer or float used to sort against all items. If an item is registered with a "name" which already exists, the existing item is replaced with the new item. Tread carefully as the old item is lost with no way to recover it. The new item will be sorted according to its priority and will **not** retain the position of the old item. """ if name in self: # Remove existing item of same name first self.deregister(name) self._is_sorted = False self._data[name] = item self._priority.append(_PriorityItem(name, priority)) def deregister(self, name, strict=True): """ Remove an item from the registry. Set `strict=False` to fail silently. """ try: index = self.get_index_for_name(name) del self._priority[index] del self._data[name] except ValueError: if strict: raise def _sort(self): """ Sort the registry by priority from highest to lowest. This method is called internally and should never be explicitly called. """ if not self._is_sorted: self._priority.sort(key=lambda item: item.priority, reverse=True) self._is_sorted = True # Deprecated Methods which provide a smooth transition from OrderedDict def __setitem__(self, key, value): """ Register item with priorty 5 less than lowest existing priority. """ if isinstance(key, string_type): warnings.warn( 'Using setitem to register a processor or pattern is deprecated. ' 'Use the `register` method instead.', DeprecationWarning, stacklevel=2, ) if key in self: # Key already exists, replace without altering priority self._data[key] = value return if len(self) == 0: # This is the first item. Set priority to 50. priority = 50 else: self._sort() priority = self._priority[-1].priority - 5 self.register(value, key, priority) else: raise TypeError def __delitem__(self, key): """ Deregister an item by name. """ if key in self: self.deregister(key) warnings.warn( 'Using del to remove a processor or pattern is deprecated. ' 'Use the `deregister` method instead.', DeprecationWarning, stacklevel=2, ) else: raise TypeError def add(self, key, value, location): """ Register a key by location. """ if len(self) == 0: # This is the first item. Set priority to 50. priority = 50 elif location == '_begin': self._sort() # Set priority 5 greater than highest existing priority priority = self._priority[0].priority + 5 elif location == '_end': self._sort() # Set priority 5 less than lowest existing priority priority = self._priority[-1].priority - 5 elif location.startswith('<') or location.startswith('>'): # Set priority halfway between existing priorities. i = self.get_index_for_name(location[1:]) if location.startswith('<'): after = self._priority[i].priority if i > 0: before = self._priority[i-1].priority else: # Location is first item` before = after + 10 else: # location.startswith('>') before = self._priority[i].priority if i < len(self) - 1: after = self._priority[i+1].priority else: # location is last item after = before - 10 priority = before - ((before - after) / 2) else: raise ValueError('Not a valid location: "%s". Location key ' 'must start with a ">" or "<".' % location) self.register(value, key, priority) warnings.warn( 'Using the add method to register a processor or pattern is deprecated. ' 'Use the `register` method instead.', DeprecationWarning, stacklevel=2, ) Markdown-3.1.1/mkdocs.yml0000644000076500000240000000415413432642364015732 0ustar waylanstaff00000000000000site_name: Python-Markdown site_url: https://Python-Markdown.github.io/ repo_url: https://github.com/Python-Markdown/markdown site_author: "The Python-Markdown Project" copyright: "Copyright © 2010-2017" use_directory_urls: true theme: name: nature icon: py.png release: !!python/name:markdown.__version__ issue_tracker: https://github.com/Python-Markdown/markdown/issues nav: - Python-Markdown: index.md - Installation: install.md - Library Reference: reference.md - Command Line: cli.md - Extensions: extensions/index.md - Officially Supported Extensions: - Abbreviations: extensions/abbreviations.md - Admonition: extensions/admonition.md - Attribute Lists: extensions/attr_list.md - CodeHilite: extensions/code_hilite.md - Definition Lists: extensions/definition_lists.md - Extra: extensions/extra.md - Fenced Code Blocks: extensions/fenced_code_blocks.md - Footnotes: extensions/footnotes.md - Legacy Attributes: extensions/legacy_attr.md - Legacy Emphasis: extensions/legacy_em.md - Meta-Data: extensions/meta_data.md - New Line to Break: extensions/nl2br.md - Sane Lists: extensions/sane_lists.md - SmartyPants: extensions/smarty.md - Table of Contents: extensions/toc.md - Tables: extensions/tables.md - WikiLinks: extensions/wikilinks.md - Extension API: extensions/api.md - Test Tools: test_tools.md - Contributing to Python-Markdown: contributing.md - Change Log: change_log/index.md - Release Notes for v.3.1: change_log/release-3.1.md - Release Notes for v.3.0: change_log/release-3.0.md - Release Notes for v.2.6: change_log/release-2.6.md - Release Notes for v.2.5: change_log/release-2.5.md - Release Notes for v.2.4: change_log/release-2.4.md - Release Notes for v.2.3: change_log/release-2.3.md - Release Notes for v.2.2: change_log/release-2.2.md - Release Notes for v.2.1: change_log/release-2.1.md - Release Notes for v.2.0: change_log/release-2.0.md - Authors: authors.md markdown_extensions: - extra - admonition - smarty - codehilite - toc: permalink: true Markdown-3.1.1/setup.cfg0000644000076500000240000000015113470647777015560 0ustar waylanstaff00000000000000[bdist_wheel] universal = 1 [metadata] license_file = LICENSE.md [egg_info] tag_build = tag_date = 0 Markdown-3.1.1/setup.py0000755000076500000240000001316213470641027015440 0ustar waylanstaff00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ import os import sys from setuptools import setup def get_version(): """Get version and version_info from markdown/__meta__.py file.""" module_path = os.path.join(os.path.dirname('__file__'), 'markdown', '__meta__.py') if sys.version_info[0] == 2: import imp meta = imp.load_source('__meta__', module_path) return meta.__version__, meta.__version_info__ import importlib.util spec = importlib.util.spec_from_file_location('__meta__', module_path) meta = importlib.util.module_from_spec(spec) spec.loader.exec_module(meta) return meta.__version__, meta.__version_info__ __version__, __version_info__ = get_version() # Get development Status for classifiers dev_status_map = { 'dev': '2 - Pre-Alpha', 'alpha': '3 - Alpha', 'beta': '4 - Beta', 'rc': '4 - Beta', 'final': '5 - Production/Stable' } DEVSTATUS = dev_status_map[__version_info__[3]] # The command line script name. Currently set to "markdown_py" so as not to # conflict with the perl implimentation (which uses "markdown"). SCRIPT_NAME = 'markdown_py' long_description = ''' This is a Python implementation of John Gruber's Markdown_. It is almost completely compliant with the reference implementation, though there are a few known issues. See Features_ for information on what exactly is supported and what is not. Additional features are supported by the `Available Extensions`_. .. _Markdown: http://daringfireball.net/projects/markdown/ .. _Features: https://Python-Markdown.github.io#features .. _`Available Extensions`: https://Python-Markdown.github.io/extensions/ Support ======= You may report bugs, ask for help, and discuss various other issues on the `bug tracker`_. .. _`bug tracker`: http://github.com/Python-Markdown/markdown/issues ''' setup( name='Markdown', version=__version__, url='https://Python-Markdown.github.io/', download_url='http://pypi.python.org/packages/source/M/Markdown/Markdown-%s-py2.py3-none-any.whl' % __version__, description='Python implementation of Markdown.', long_description=long_description, author='Manfred Stienstra, Yuri takhteyev and Waylan limberg', author_email='waylan.limberg@icloud.com', maintainer='Waylan Limberg', maintainer_email='waylan.limberg@icloud.com', license='BSD License', packages=['markdown', 'markdown.extensions'], python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*', install_requires=['setuptools >= 36'], extras_require={ 'testing': [ 'coverage', 'pyyaml', ], }, entry_points={ 'console_scripts': [ '%s = markdown.__main__:run' % SCRIPT_NAME, ], # Register the built in extensions 'markdown.extensions': [ 'abbr = markdown.extensions.abbr:AbbrExtension', 'admonition = markdown.extensions.admonition:AdmonitionExtension', 'attr_list = markdown.extensions.attr_list:AttrListExtension', 'codehilite = markdown.extensions.codehilite:CodeHiliteExtension', 'def_list = markdown.extensions.def_list:DefListExtension', 'extra = markdown.extensions.extra:ExtraExtension', 'fenced_code = markdown.extensions.fenced_code:FencedCodeExtension', 'footnotes = markdown.extensions.footnotes:FootnoteExtension', 'meta = markdown.extensions.meta:MetaExtension', 'nl2br = markdown.extensions.nl2br:Nl2BrExtension', 'sane_lists = markdown.extensions.sane_lists:SaneListExtension', 'smarty = markdown.extensions.smarty:SmartyExtension', 'tables = markdown.extensions.tables:TableExtension', 'toc = markdown.extensions.toc:TocExtension', 'wikilinks = markdown.extensions.wikilinks:WikiLinkExtension', 'legacy_attrs = markdown.extensions.legacy_attrs:LegacyAttrExtension', 'legacy_em = markdown.extensions.legacy_em:LegacyEmExtension', ] }, classifiers=[ 'Development Status :: %s' % DEVSTATUS, 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Topic :: Communications :: Email :: Filters', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries', 'Topic :: Internet :: WWW/HTTP :: Site Management', 'Topic :: Software Development :: Documentation', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Text Processing :: Filters', 'Topic :: Text Processing :: Markup :: HTML' ] ) Markdown-3.1.1/tests/0000755000076500000240000000000013470647777015104 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/__init__.py0000644000076500000240000000137113330711640017167 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ Markdown-3.1.1/tests/basic/0000755000076500000240000000000013470647777016165 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/basic/amps-and-angle-encoding.html0000644000076500000240000000076313212354257023407 0ustar waylanstaff00000000000000

AT&T has an ampersand in their name.

AT&T is another way to write it.

This & that.

4 < 5.

6 > 5.

Here's a link with an ampersand in the URL.

Here's a link with an amersand in the link text: AT&T.

Here's an inline link.

Here's an inline link.

Markdown-3.1.1/tests/basic/amps-and-angle-encoding.txt0000644000076500000240000000057513212354257023263 0ustar waylanstaff00000000000000AT&T has an ampersand in their name. AT&T is another way to write it. This & that. 4 < 5. 6 > 5. Here's a [link] [1] with an ampersand in the URL. Here's a link with an amersand in the link text: [AT&T] [2]. Here's an inline [link](/script?foo=1&bar=2). Here's an inline [link](). [1]: http://example.com/?foo=1&bar=2 [2]: http://att.com/ "AT&T"Markdown-3.1.1/tests/basic/angle-links-and-img.html0000644000076500000240000000030313212354257022543 0ustar waylanstaff00000000000000

link image link image

Markdown-3.1.1/tests/basic/angle-links-and-img.txt0000644000076500000240000000021113212354257022414 0ustar waylanstaff00000000000000[link]( "title") ![image]() [link]() ![image]() Markdown-3.1.1/tests/basic/auto-links.html0000644000076500000240000000124613212354257021122 0ustar waylanstaff00000000000000

Link: http://example.com/.

Https link: https://example.com

Ftp link: ftp://example.com

With an ampersand: http://example.com/?foo=1&bar=2

Blockquoted: http://example.com/

Auto-links should not occur here: <http://example.com/>

or here: <http://example.com/>
Markdown-3.1.1/tests/basic/auto-links.txt0000644000076500000240000000051213212354257020770 0ustar waylanstaff00000000000000Link: . Https link: Ftp link: With an ampersand: * In a list? * * It should. > Blockquoted: Auto-links should not occur here: `` or here: Markdown-3.1.1/tests/basic/backlash-escapes.html0000644000076500000240000000236213212354257022225 0ustar waylanstaff00000000000000

These should all get escaped:

Backslash: \

Backtick: `

Asterisk: *

Underscore: _

Left brace: {

Right brace: }

Left bracket: [

Right bracket: ]

Left paren: (

Right paren: )

Greater-than: >

Hash: #

Period: .

Bang: !

Plus: +

Minus: -

These should not, because they occur within a code block:

Backslash: \\

Backtick: \`

Asterisk: \*

Underscore: \_

Left brace: \{

Right brace: \}

Left bracket: \[

Right bracket: \]

Left paren: \(

Right paren: \)

Greater-than: \>

Hash: \#

Period: \.

Bang: \!

Plus: \+

Minus: \-

Nor should these, which occur in code spans:

Backslash: \\

Backtick: \`

Asterisk: \*

Underscore: \_

Left brace: \{

Right brace: \}

Left bracket: \[

Right bracket: \]

Left paren: \(

Right paren: \)

Greater-than: \>

Hash: \#

Period: \.

Bang: \!

Plus: \+

Minus: \-

Markdown-3.1.1/tests/basic/backlash-escapes.txt0000644000076500000240000000157113212354257022101 0ustar waylanstaff00000000000000These should all get escaped: Backslash: \\ Backtick: \` Asterisk: \* Underscore: \_ Left brace: \{ Right brace: \} Left bracket: \[ Right bracket: \] Left paren: \( Right paren: \) Greater-than: \> Hash: \# Period: \. Bang: \! Plus: \+ Minus: \- These should not, because they occur within a code block: Backslash: \\ Backtick: \` Asterisk: \* Underscore: \_ Left brace: \{ Right brace: \} Left bracket: \[ Right bracket: \] Left paren: \( Right paren: \) Greater-than: \> Hash: \# Period: \. Bang: \! Plus: \+ Minus: \- Nor should these, which occur in code spans: Backslash: `\\` Backtick: `` \` `` Asterisk: `\*` Underscore: `\_` Left brace: `\{` Right brace: `\}` Left bracket: `\[` Right bracket: `\]` Left paren: `\(` Right paren: `\)` Greater-than: `\>` Hash: `\#` Period: `\.` Bang: `\!` Plus: `\+` Minus: `\-` Markdown-3.1.1/tests/basic/blockquotes-with-code-blocks.html0000644000076500000240000000026013212354257024516 0ustar waylanstaff00000000000000

Example:

sub status {
    print "working";
}

Or:

sub status {
    return "working";
}
Markdown-3.1.1/tests/basic/blockquotes-with-code-blocks.txt0000644000076500000240000000020713212354257024372 0ustar waylanstaff00000000000000> Example: > > sub status { > print "working"; > } > > Or: > > sub status { > return "working"; > } Markdown-3.1.1/tests/basic/codeblock-in-list.html0000644000076500000240000000026513212354257022336 0ustar waylanstaff00000000000000
  • A list item with a code block

    Some *code*
    
  • Another list item

    More code
    
    And more code
    
Markdown-3.1.1/tests/basic/codeblock-in-list.txt0000644000076500000240000000016513212354257022210 0ustar waylanstaff00000000000000* A list item with a code block Some *code* * Another list item More code And more code Markdown-3.1.1/tests/basic/hard-wrapped.html0000644000076500000240000000032113212354257021403 0ustar waylanstaff00000000000000

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.

Here's one with a bullet. * criminey.

Markdown-3.1.1/tests/basic/hard-wrapped.txt0000644000076500000240000000030513212354257021260 0ustar waylanstaff00000000000000In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item. Here's one with a bullet. * criminey. Markdown-3.1.1/tests/basic/horizontal-rules.html0000644000076500000240000000062013212354257022350 0ustar waylanstaff00000000000000

Dashes:





---




- - -

Asterisks:





***




* * *

Underscores:





___




_ _ _
Markdown-3.1.1/tests/basic/horizontal-rules.txt0000644000076500000240000000041613212354257022226 0ustar waylanstaff00000000000000Dashes: --- --- --- --- --- - - - - - - - - - - - - - - - Asterisks: *** *** *** *** *** * * * * * * * * * * * * * * * Underscores: ___ ___ ___ ___ ___ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Markdown-3.1.1/tests/basic/inline-html-advanced.html0000644000076500000240000000022113457143376023020 0ustar waylanstaff00000000000000

Simple block on one line:

foo

And nested without indentation:

foo
bar
Markdown-3.1.1/tests/basic/inline-html-advanced.txt0000644000076500000240000000020613457143376022676 0ustar waylanstaff00000000000000Simple block on one line:
foo
And nested without indentation:
foo
bar
Markdown-3.1.1/tests/basic/inline-html-comments.html0000644000076500000240000000027113457143376023105 0ustar waylanstaff00000000000000

Paragraph one.

Paragraph two.

The end.

Markdown-3.1.1/tests/basic/inline-html-comments.txt0000644000076500000240000000024413457143376022760 0ustar waylanstaff00000000000000Paragraph one. Paragraph two. The end. Markdown-3.1.1/tests/basic/inline-html-simple.html0000644000076500000240000000155213457143376022554 0ustar waylanstaff00000000000000

Here's a simple block:

foo

This should be a code block, though:

<div>
    foo
</div>

As should this:

<div>foo</div>

Now, nested:

foo

This should just be an HTML comment:

Multiline:

Code block:

<!-- Comment -->

Just plain comment, with trailing spaces on the line:

Code:

<hr />

Hr's:










weird stuff>

> <> <

Markdown-3.1.1/tests/basic/inline-html-simple.txt0000644000076500000240000000116513457143376022427 0ustar waylanstaff00000000000000Here's a simple block:
foo
This should be a code block, though:
foo
As should this:
foo
Now, nested:
foo
This should just be an HTML comment: Multiline: Code block: Just plain comment, with trailing spaces on the line: Code:
Hr's:








> <> <Markdown-3.1.1/tests/basic/links-inline.html0000644000076500000240000000042413212354257021425 0ustar waylanstaff00000000000000

Just a URL.

URL and title.

URL and title.

URL and title.

Empty.

Markdown-3.1.1/tests/basic/links-inline.txt0000644000076500000240000000025613212354257021303 0ustar waylanstaff00000000000000Just a [URL](/url/). [URL and title](/url/ "title"). [URL and title](/url/ "title preceded by two spaces"). [URL and title](/url/ "title preceded by a tab"). [Empty](). Markdown-3.1.1/tests/basic/links-reference.html0000644000076500000240000000202713212354257022106 0ustar waylanstaff00000000000000

Foo bar.

Foo bar.

Foo bar.

With embedded [brackets].

Indented once.

Indented twice.

Indented thrice.

Indented [four][] times.

[four]: /url

With angle brackets.

And without.

With line breaks

and line breaks with one space.

and [line
breaks[] with two spaces.

short ref

short ref

a ref

Markdown-3.1.1/tests/basic/links-reference.txt0000644000076500000240000000134413212354257021762 0ustar waylanstaff00000000000000Foo [bar] [1]. Foo [bar][1]. Foo [bar] [1]. [1]: /url/ "Title" With [embedded [brackets]] [b]. Indented [once][]. Indented [twice][]. Indented [thrice][]. Indented [four][] times. [once]: /url [twice]: /url [thrice]: /url [four]: /url [b]: /url/ With [angle brackets][]. And [without][]. [angle brackets]: "Angle Brackets" [without]: http://example.com/ "Without angle brackets." With [line breaks][] and [line breaks][] with one space. and [line breaks[] with two spaces. [line breaks]: http://example.com "Yes this works" [short ref] [short ref] [short ref]: http://example.com "No more hanging empty bracket!" [a ref] [a ref]: http://example.com "Title on next line." Markdown-3.1.1/tests/basic/literal-quotes.html0000644000076500000240000000024113212354257022000 0ustar waylanstaff00000000000000

Foo bar.

Foo bar.

Markdown-3.1.1/tests/basic/literal-quotes.txt0000644000076500000240000000015413212354257021656 0ustar waylanstaff00000000000000Foo [bar][]. Foo [bar](/url/ "Title with "quotes" inside"). [bar]: /url/ "Title with "quotes" inside" Markdown-3.1.1/tests/basic/markdown-documentation-basics.html0000644000076500000240000002214113226455362024770 0ustar waylanstaff00000000000000

Markdown: Basics

Getting the Gist of Markdown's Formatting Syntax

This page offers a brief overview of what it's like to use Markdown. The syntax page provides complete, detailed documentation for every feature, but Markdown should be very easy to pick up simply by looking at a few examples of it in action. The examples on this page are written in a before/after style, showing example syntax and the HTML output produced by Markdown.

It's also helpful to simply try Markdown out; the Dingus is a web application that allows you type your own Markdown-formatted text and translate it to XHTML.

Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.

Paragraphs, Headers, Blockquotes

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 spaces or tabs is considered blank.) Normal paragraphs should not be intended with spaces or tabs.

Markdown offers two styles of headers: Setext and atx. Setext-style headers for <h1> and <h2> are created by "underlining" with equal signs (=) and hyphens (-), respectively. To create an atx-style header, you put 1-6 hash marks (#) at the beginning of the line -- the number of hashes equals the resulting HTML header level.

Blockquotes are indicated using email-style '>' angle brackets.

Markdown:

A First Level Header
====================

A Second Level Header
---------------------

Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.

The quick brown fox jumped over the lazy
dog's back.

### Header 3

> This is a blockquote.
> 
> This is the second paragraph in the blockquote.
>
> ## This is an H2 in a blockquote

Output:

<h1>A First Level Header</h1>

<h2>A Second Level Header</h2>

<p>Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.</p>

<p>The quick brown fox jumped over the lazy
dog's back.</p>

<h3>Header 3</h3>

<blockquote>
    <p>This is a blockquote.</p>

    <p>This is the second paragraph in the blockquote.</p>

    <h2>This is an H2 in a blockquote</h2>
</blockquote>

Phrase Emphasis

Markdown uses asterisks and underscores to indicate spans of emphasis.

Markdown:

Some of these words *are emphasized*.
Some of these words _are emphasized also_.

Use two asterisks for **strong emphasis**.
Or, if you prefer, __use two underscores instead__.

Output:

<p>Some of these words <em>are emphasized</em>.
Some of these words <em>are emphasized also</em>.</p>

<p>Use two asterisks for <strong>strong emphasis</strong>.
Or, if you prefer, <strong>use two underscores instead</strong>.</p>

Lists

Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, +, and -) as list markers. These three markers are interchangeable; this:

*   Candy.
*   Gum.
*   Booze.

this:

+   Candy.
+   Gum.
+   Booze.

and this:

-   Candy.
-   Gum.
-   Booze.

all produce the same output:

<ul>
<li>Candy.</li>
<li>Gum.</li>
<li>Booze.</li>
</ul>

Ordered (numbered) lists use regular numbers, followed by periods, as list markers:

1.  Red
2.  Green
3.  Blue

Output:

<ol>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ol>

If you put blank lines between items, you'll get <p> tags for the list item text. You can create multi-paragraph list items by indenting the paragraphs by 4 spaces or 1 tab:

*   A list item.

    With multiple paragraphs.

*   Another item in the list.

Output:

<ul>
<li><p>A list item.</p>
<p>With multiple paragraphs.</p></li>
<li><p>Another item in the list.</p></li>
</ul>

Links

Markdown supports two styles for creating links: inline and reference. With both styles, you use square brackets to delimit the text you want to turn into a link.

Inline-style links use parentheses immediately after the link text. For example:

This is an [example link](http://example.com/).

Output:

<p>This is an <a href="http://example.com/">
example link</a>.</p>

Optionally, you may include a title attribute in the parentheses:

This is an [example link](http://example.com/ "With a Title").

Output:

<p>This is an <a href="http://example.com/" title="With a Title">
example link</a>.</p>

Reference-style links allow you to refer to your links by names, which you define elsewhere in your document:

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"

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>

The title attribute is optional. Link names may contain letters, numbers and spaces, but are not case sensitive:

I start my morning with a cup of coffee and
[The New York Times][NY Times].

[ny times]: http://www.nytimes.com/

Output:

<p>I start my morning with a cup of coffee and
<a href="http://www.nytimes.com/">The New York Times</a>.</p>

Images

Image syntax is very much like link syntax.

Inline (titles are optional):

![alt text](/path/to/img.jpg "Title")

Reference-style:

![alt text][id]

[id]: /path/to/img.jpg "Title"

Both of the above examples produce the same output:

<img src="/path/to/img.jpg" alt="alt text" title="Title" />

Code

In a regular paragraph, you can create code span by wrapping text in backtick quotes. Any ampersands (&) and angle brackets (< or >) will automatically be translated into HTML entities. This makes it easy to use Markdown to write about HTML example code:

I strongly recommend against using any `<blink>` tags.

I wish SmartyPants used named entities like `&mdash;`
instead of decimal-encoded entites like `&#8212;`.

Output:

<p>I strongly recommend against using any
<code>&lt;blink&gt;</code> tags.</p>

<p>I wish SmartyPants used named entities like
<code>&amp;mdash;</code> instead of decimal-encoded
entites like <code>&amp;#8212;</code>.</p>

To specify an entire block of pre-formatted code, indent every line of the block by 4 spaces or 1 tab. Just like with code spans, &, <, and > characters will be escaped automatically.

Markdown:

If you want your page to validate under XHTML 1.0 Strict,
you've got to put paragraph tags in your blockquotes:

    <blockquote>
        <p>For example.</p>
    </blockquote>

Output:

<p>If you want your page to validate under XHTML 1.0 Strict,
you've got to put paragraph tags in your blockquotes:</p>

<pre><code>&lt;blockquote&gt;
    &lt;p&gt;For example.&lt;/p&gt;
&lt;/blockquote&gt;
</code></pre>
Markdown-3.1.1/tests/basic/markdown-documentation-basics.txt0000644000076500000240000001760113226455362024650 0ustar waylanstaff00000000000000Markdown: Basics ================ Getting the Gist of Markdown's Formatting Syntax ------------------------------------------------ This page offers a brief overview of what it's like to use Markdown. The [syntax page] [s] provides complete, detailed documentation for every feature, but Markdown should be very easy to pick up simply by looking at a few examples of it in action. The examples on this page are written in a before/after style, showing example syntax and the HTML output produced by Markdown. It's also helpful to simply try Markdown out; the [Dingus] [d] is a web application that allows you type your own Markdown-formatted text and translate it to XHTML. **Note:** This document is itself written using Markdown; you can [see the source for it by adding '.text' to the URL] [src]. [s]: /projects/markdown/syntax "Markdown Syntax" [d]: /projects/markdown/dingus "Markdown Dingus" [src]: /projects/markdown/basics.text ## Paragraphs, Headers, Blockquotes ## 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 spaces or tabs is considered blank.) Normal paragraphs should not be intended with spaces or tabs. Markdown offers two styles of headers: *Setext* and *atx*. Setext-style headers for `

` and `

` are created by "underlining" with equal signs (`=`) and hyphens (`-`), respectively. To create an atx-style header, you put 1-6 hash marks (`#`) at the beginning of the line -- the number of hashes equals the resulting HTML header level. Blockquotes are indicated using email-style '`>`' angle brackets. Markdown: A First Level Header ==================== A Second Level Header --------------------- Now is the time for all good men to come to the aid of their country. This is just a regular paragraph. The quick brown fox jumped over the lazy dog's back. ### Header 3 > This is a blockquote. > > This is the second paragraph in the blockquote. > > ## This is an H2 in a blockquote Output:

A First Level Header

A Second Level Header

Now is the time for all good men to come to the aid of their country. This is just a regular paragraph.

The quick brown fox jumped over the lazy dog's back.

Header 3

This is a blockquote.

This is the second paragraph in the blockquote.

This is an H2 in a blockquote

### Phrase Emphasis ### Markdown uses asterisks and underscores to indicate spans of emphasis. Markdown: Some of these words *are emphasized*. Some of these words _are emphasized also_. Use two asterisks for **strong emphasis**. Or, if you prefer, __use two underscores instead__. Output:

Some of these words are emphasized. Some of these words are emphasized also.

Use two asterisks for strong emphasis. Or, if you prefer, use two underscores instead.

## Lists ## Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, `+`, and `-`) as list markers. These three markers are interchangeable; this: * Candy. * Gum. * Booze. this: + Candy. + Gum. + Booze. and this: - Candy. - Gum. - Booze. all produce the same output:
  • Candy.
  • Gum.
  • Booze.
Ordered (numbered) lists use regular numbers, followed by periods, as list markers: 1. Red 2. Green 3. Blue Output:
  1. Red
  2. Green
  3. Blue
If you put blank lines between items, you'll get `

` tags for the list item text. You can create multi-paragraph list items by indenting the paragraphs by 4 spaces or 1 tab: * A list item. With multiple paragraphs. * Another item in the list. Output:

  • A list item.

    With multiple paragraphs.

  • Another item in the list.

### Links ### Markdown supports two styles for creating links: *inline* and *reference*. With both styles, you use square brackets to delimit the text you want to turn into a link. Inline-style links use parentheses immediately after the link text. For example: This is an [example link](http://example.com/). Output:

This is an example link.

Optionally, you may include a title attribute in the parentheses: This is an [example link](http://example.com/ "With a Title"). Output:

This is an example link.

Reference-style links allow you to refer to your links by names, which you define elsewhere in your document: 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" Output:

I get 10 times more traffic from Google than from Yahoo or MSN.

The title attribute is optional. Link names may contain letters, numbers and spaces, but are *not* case sensitive: I start my morning with a cup of coffee and [The New York Times][NY Times]. [ny times]: http://www.nytimes.com/ Output:

I start my morning with a cup of coffee and The New York Times.

### Images ### Image syntax is very much like link syntax. Inline (titles are optional): ![alt text](/path/to/img.jpg "Title") Reference-style: ![alt text][id] [id]: /path/to/img.jpg "Title" Both of the above examples produce the same output: alt text ### Code ### In a regular paragraph, you can create code span by wrapping text in backtick quotes. Any ampersands (`&`) and angle brackets (`<` or `>`) will automatically be translated into HTML entities. This makes it easy to use Markdown to write about HTML example code: I strongly recommend against using any `` tags. I wish SmartyPants used named entities like `—` instead of decimal-encoded entites like `—`. Output:

I strongly recommend against using any <blink> tags.

I wish SmartyPants used named entities like &mdash; instead of decimal-encoded entites like &#8212;.

To specify an entire block of pre-formatted code, indent every line of the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, and `>` characters will be escaped automatically. Markdown: If you want your page to validate under XHTML 1.0 Strict, you've got to put paragraph tags in your blockquotes:

For example.

Output:

If you want your page to validate under XHTML 1.0 Strict, you've got to put paragraph tags in your blockquotes:

<blockquote>
        <p>For example.</p>
    </blockquote>
    
Markdown-3.1.1/tests/basic/markdown-syntax.html0000644000076500000240000007554713226455362022225 0ustar waylanstaff00000000000000

Markdown: Syntax

Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


Overview

Philosophy

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, atx, Textile, reStructuredText, Grutatext, and EtText -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email.

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.

Inline HTML

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.

Automatic Escaping for Special Characters

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, 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.)


Block Elements

Paragraphs and Line Breaks

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 intended 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 and multi-paragraph list items work best -- and look better -- when you format them with hard breaks.

Markdown supports two styles of headers, Setext and atx.

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 ######

Blockquotes

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.

Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists.

Unordered lists use asterisks, pluses, and hyphens -- interchangeably -- 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 intended 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.

Code Blocks

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.

Horizontal Rules

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:

* * *

***

*****

- - -

---------------------------------------

_ _ _

Span Elements

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.

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 constist 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.

Emphasis

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*fucking*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\*

Code

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>

Images

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.


Miscellaneous

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.)

Backslash Escapes

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 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
Markdown-3.1.1/tests/basic/markdown-syntax.txt0000644000076500000240000006545013226455362022070 0ustar waylanstaff00000000000000Markdown: Syntax ================ * [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 * * *

Overview

Philosophy

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.

Inline HTML

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. `
`, ``, `
`, `

`, 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) `

` tags around HTML block-level tags. For example, to add an HTML table to a Markdown article: This is a regular paragraph.

Foo
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. ``, ``, or `` -- 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 `` or `` 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.

Automatic Escaping for Special Characters

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. `<`, and `&`. Ampersands in particular are bedeviling for web writers. If you want to write about 'AT&T', you need to write '`AT&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&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 `&`. So, if you want to include a copyright symbol in your article, you can write: © and Markdown will leave it alone. But if you write: AT&T Markdown will translate it to: AT&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 < 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.) * * *

Block Elements

Paragraphs and Line Breaks

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 intended 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 `
` tag. When you *do* want to insert a `
` 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 `
`, but a simplistic "every line break is a `
`" 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 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 ######

Blockquotes

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.

Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists. Unordered lists use asterisks, pluses, and hyphens -- interchangeably -- 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:
  1. Bird
  2. McHale
  3. Parish
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 `

` tags in the HTML output. For example, this input: * Bird * Magic will turn into:

  • Bird
  • Magic
But this: * Bird * Magic will turn into:
  • Bird

  • Magic

List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be intended 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: 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.

Code Blocks

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 `
` and `` 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:

    

This is a normal paragraph:

This is a code block.
    
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:

Here is an example of AppleScript:

tell application "Foo"
        beep
    end tell
    
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: will turn into:
<div class="footer">
        &copy; 2004 Foo Corporation
    </div>
    
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.

Horizontal Rules

You can produce a horizontal rule tag (`
`) 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: * * * *** ***** - - - --------------------------------------- _ _ _ * * *

Span Elements

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:

This is an example inline link.

This link has no title attribute.

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. The link URL may, optionally, be surrounded by angle brackets: [id]: "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 constist 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:

I get 10 times more traffic from Google than from Yahoo or MSN.

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.

Emphasis

Markdown treats asterisks (`*`) and underscores (`_`) as indicators of emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML `` tag. E.g., this input: *single asterisks* _single underscores_ **double asterisks** __double underscores__ will produce: single asterisks single underscores double asterisks double underscores 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*fucking*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\*

Code

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:

Use the printf() function.

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:

There is a literal backtick (`) here.

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:

A single backtick in a code span: `

A backtick-delimited string in a code span: `foo`

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 `` tags. into:

Please don't use any <blink> tags.

You can write this: `—` is the decimal-encoded equivalent of `—`. to produce:

&#8212; is the decimal-encoded equivalent of &mdash;.

Images

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 `` tags. * * *

Miscellaneous

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: Markdown will turn this into: http://example.com/ 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: into something like this: address@exa mple.com 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.)

Backslash Escapes

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 `` tag), you can 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 Markdown-3.1.1/tests/basic/nested-blockquotes.html0000644000076500000240000000012613212354257022643 0ustar waylanstaff00000000000000

foo

bar

foo

Markdown-3.1.1/tests/basic/nested-blockquotes.txt0000644000076500000240000000003013212354257022510 0ustar waylanstaff00000000000000> foo > > > bar > > foo Markdown-3.1.1/tests/basic/ordered-and-unordered-list.html0000644000076500000240000000307213212354257024155 0ustar waylanstaff00000000000000

Unordered

Asterisks tight:

  • asterisk 1
  • asterisk 2
  • asterisk 3

Asterisks loose:

  • asterisk 1

  • asterisk 2

  • asterisk 3


Pluses tight:

  • Plus 1
  • Plus 2
  • Plus 3

Pluses loose:

  • Plus 1

  • Plus 2

  • Plus 3


Minuses tight:

  • Minus 1
  • Minus 2
  • Minus 3

Minuses loose:

  • Minus 1

  • Minus 2

  • Minus 3

Ordered

Tight:

  1. First
  2. Second
  3. Third

and:

  1. One
  2. Two
  3. Three

Loose using tabs:

  1. First

  2. Second

  3. Third

and using spaces:

  1. One

  2. Two

  3. Three

Multiple paragraphs:

  1. Item 1, graf one.

    Item 2. graf two. The quick brown fox jumped over the lazy dog's back.

  2. Item 2.

  3. Item 3.

Nested

  • Tab
    • Tab
      • Tab

Here's another:

  1. First
  2. Second:
    • Fee
    • Fie
    • Foe
  3. Third

Same thing but with paragraphs:

  1. First

  2. Second:

    • Fee
    • Fie
    • Foe
  3. Third

Markdown-3.1.1/tests/basic/ordered-and-unordered-list.txt0000644000076500000240000000151113212354257024024 0ustar waylanstaff00000000000000## Unordered Asterisks tight: * asterisk 1 * asterisk 2 * asterisk 3 Asterisks loose: * asterisk 1 * asterisk 2 * asterisk 3 * * * Pluses tight: + Plus 1 + Plus 2 + Plus 3 Pluses loose: + Plus 1 + Plus 2 + Plus 3 * * * Minuses tight: - Minus 1 - Minus 2 - Minus 3 Minuses loose: - Minus 1 - Minus 2 - Minus 3 ## Ordered Tight: 1. First 2. Second 3. Third and: 1. One 2. Two 3. Three Loose using tabs: 1. First 2. Second 3. Third and using spaces: 1. One 2. Two 3. Three Multiple paragraphs: 1. Item 1, graf one. Item 2. graf two. The quick brown fox jumped over the lazy dog's back. 2. Item 2. 3. Item 3. ## Nested * Tab * Tab * Tab Here's another: 1. First 2. Second: * Fee * Fie * Foe 3. Third Same thing but with paragraphs: 1. First 2. Second: * Fee * Fie * Foe 3. Third Markdown-3.1.1/tests/basic/strong-and-em-together.html0000644000076500000240000000032313212354257023321 0ustar waylanstaff00000000000000

This is strong and em.

So is this word.

This is strong and em.

So is this word.

Markdown-3.1.1/tests/basic/strong-and-em-together.txt0000644000076500000240000000015313212354257023175 0ustar waylanstaff00000000000000***This is strong and em.*** So is ***this*** word. ___This is strong and em.___ So is ___this___ word. Markdown-3.1.1/tests/basic/tabs.html0000644000076500000240000000067413212354257017771 0ustar waylanstaff00000000000000
  • this is a list item indented with tabs

  • this is a list item indented with spaces

Code:

this code block is indented by one tab

And:

    this code block is indented by two tabs

And:

+   this is an example list item
    indented with tabs

+   this is an example list item
    indented with spaces
Markdown-3.1.1/tests/basic/tabs.txt0000644000076500000240000000046713212354257017644 0ustar waylanstaff00000000000000+ this is a list item indented with tabs + this is a list item indented with spaces Code: this code block is indented by one tab And: this code block is indented by two tabs And: + this is an example list item indented with tabs + this is an example list item indented with spaces Markdown-3.1.1/tests/basic/tidyness.html0000644000076500000240000000020413212354257020667 0ustar waylanstaff00000000000000

A list within a blockquote:

  • asterisk 1
  • asterisk 2
  • asterisk 3
Markdown-3.1.1/tests/basic/tidyness.txt0000644000076500000240000000011613212354257020544 0ustar waylanstaff00000000000000> A list within a blockquote: > > * asterisk 1 > * asterisk 2 > * asterisk 3 Markdown-3.1.1/tests/extensions/0000755000076500000240000000000013470647777017303 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/extensions/admonition.html0000644000076500000240000000255513330711640022311 0ustar waylanstaff00000000000000

Some text

Note

A normal paragraph here

  1. first
  2. second

Some important quote

another paragraph in the quote

int main() {
    // insert some code
}

More text and stuff.

Did you know?

You can customize the title of the admonition

Not part of an Admonition!

And now...

For something completely different.

You can also use a custom CSS class name.

And now...

For something completely different.

Several class names can be separated by space chars.

Note

The default title is the capitalized first class name.

An explicitly empty string prevents the title from being rendered.

No body:

Note

Extra whitespace after the title should not alter output:

Note

Markdown-3.1.1/tests/extensions/admonition.txt0000644000076500000240000000153413330711640022160 0ustar waylanstaff00000000000000Some text !!! note A normal paragraph here 1. first 2. second > Some important quote > another paragraph in the quote int main() { // insert some code } More text and stuff. !!! Note "Did you know?" You can customize the title of the admonition Not part of an Admonition! !!! mycustomcssclass "And now..." For something completely different. You can also use a custom CSS class name. !!! class1 class2 class3 "And now..." For something completely different. Several class names can be separated by space chars. !!! note anotherclass The default title is the capitalized first class name. !!! tip "" An explicitly empty string prevents the title from being rendered. No body: !!! note Extra whitespace after the title should not alter output: !!! note Markdown-3.1.1/tests/extensions/attr_list.html0000644000076500000240000000416313226455362022164 0ustar waylanstaff00000000000000

This is a sextext header

A paragraph with some text. Line two of the paragraph.

This is another

Test some inline text. A link And a nested link

This is a hash Header

And now some random attributes.

No closing hash header

Now test overrides

# A code block which contains attr_list syntax
# This should be ignored.
{: #someid .someclass }

No colon for compatibility with Headerid ext

Also a codespan: {: .someclass}.

Bad Syntax

  • Item1
  • Item2
    • Item2-1
  • Item3
    • Item3-1
  • Item4
    • Item4-1
  • Item5

And ordered lists too

  1. Item1
  2. Item2
    1. Item2-1
  3. Item3
    1. Item3-1
  4. Item4
    1. Item4-1
  5. Item5

Definition lists

DT1
DT2
Some dd
dd
DT3
Some dd

Bad attributes

Key without value

Value without key

No key or value

Weirdness

More weirdness

This should not cause a crash

Attr_lists do not contain newlines{ foo=bar key=value }

Markdown-3.1.1/tests/extensions/attr_list.txt0000644000076500000240000000327513226455362022042 0ustar waylanstaff00000000000000This is a sextext header {: #setext} ==================================== A paragraph with some text. Line two of the paragraph. {: #par1 .myclass } This is another {: #sextext2 .someclass} ---------------------------------------- Test some _inline_{: .inline} text. A [link](http://example.com){: .linkkyclass title="A title."} And a __nested [link][]{: .linky2}__{: .nest} [link]: http://example.com "Some title" ### This is a hash Header ### {: #hash} And now some random attributes. {:foo bar='b az' baz="blah blah" title="I wasn't kidding!" } ### No closing hash header {: #hash2} Now test overrides {: #overrideme .andme id=overridden class='foo bar' .addme } # A code block which contains attr_list syntax # This should be ignored. {: #someid .someclass } ### No colon for compatibility with Headerid ext { #hash3 } Also a codespan: `{: .someclass}`{: .foo}. {: #the_end} ### Bad Syntax { {: #hash5 } * Item1 {: .item } * Item2 {: .item } * Item2-1 {: .subitem } * _Item3_{: .emph } {: .item } * _Item3-1_{: .emph } {: .subitem } * Item4 * Item4-1 * Item5 # And ordered lists *too*{.inline} 1. Item1 {: .item } 2. Item2 {: .item } 1. Item2-1 {: .subitem } 3. _Item3_{: .emph } {: .item } 1. _Item3-1_{: .emph } {: .subitem } 4. Item4 1. Item4-1 5. Item5 # Definition *lists* {.block} DT1 {.term} DT2 {.term} : Some dd {.def} : *dd*{.inline} *DT3*{.inline} : Some dd # Bad attributes Key without *value*{ foo= } Value without *key*{ =bar } No *key or value*{ = } *Weirdness*{ == } *More weirdness*{ === } This should not cause a *crash*{ foo=a=b } Attr_lists do not contain *newlines*{ foo=bar key=value } Markdown-3.1.1/tests/extensions/codehilite.html0000644000076500000240000000250013212354257022255 0ustar waylanstaff00000000000000

Some text

1
2
3
4
5
6
def __init__ (self, pattern) :
    self.pattern = pattern
    self.compiled_re = re.compile("^(.*)%s(.*)$" % pattern, re.DOTALL)

def getCompiledRegExp (self) :
    return self.compiled_re

More text

Markdown-3.1.1/tests/extensions/codehilite.txt0000644000076500000240000000036413212354257022136 0ustar waylanstaff00000000000000 Some text #!python def __init__ (self, pattern) : self.pattern = pattern self.compiled_re = re.compile("^(.*)%s(.*)$" % pattern, re.DOTALL) def getCompiledRegExp (self) : return self.compiled_re More textMarkdown-3.1.1/tests/extensions/extra/0000755000076500000240000000000013470647777020426 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/extensions/extra/abbr.html0000644000076500000240000000042313212354257022177 0ustar waylanstaff00000000000000

An ABBR: "REF". ref and REFERENCE should be ignored.

The HTML specification is maintained by the W3C.

Markdown-3.1.1/tests/extensions/extra/abbr.txt0000644000076500000240000000040713212354257022054 0ustar waylanstaff00000000000000An ABBR: "REF". ref and REFERENCE should be ignored. *[REF]: Reference *[ABBR]: This gets overriden by the next one. *[ABBR]: Abbreviation The HTML specification is maintained by the W3C. *[HTML]: Hyper Text Markup Language *[W3C]: World Wide Web Consortium Markdown-3.1.1/tests/extensions/extra/def-in-list.html0000644000076500000240000000050013212354257023400 0ustar waylanstaff00000000000000

: a paragraph that starts with a colon

  • A List item
  • A def term
    A def item
    a second
  • Another def term

    a loose item

    a second

  • : a list item that starts with a colon

Markdown-3.1.1/tests/extensions/extra/def-in-list.txt0000644000076500000240000000031613212354257023260 0ustar waylanstaff00000000000000: a paragraph that starts with a colon * A List item * A def term : A def item : a second * Another def term : a loose item : a second * : a list item that starts with a colon Markdown-3.1.1/tests/extensions/extra/extra_config.html0000644000076500000240000000044413432642364023747 0ustar waylanstaff00000000000000

  1. A Footnote. 

Some text with a footnote1.

Markdown-3.1.1/tests/extensions/extra/extra_config.txt0000644000076500000240000000010513212354257023611 0ustar waylanstaff00000000000000~~~placemarker~~~ Some text with a footnote[^1]. [^1]: A Footnote. Markdown-3.1.1/tests/extensions/extra/footnote.html0000644000076500000240000000763013432642364023140 0ustar waylanstaff00000000000000

This is the body with a footnote1 or two2 or more3 4 5.

Also a reference that does not exist[^6].

Duplicate6 footnotes6 test6.

Duplicate7 footnotes7 test7.

Single after duplicates8.

Test emphasis at end of footnote9

Complex footnote content10


  1. Footnote that ends with a list:

    • item 1
    • item 2

  2. This footnote is a blockquote.

  3. A simple oneliner. 

  4. A footnote with multiple paragraphs.

    Paragraph two. 

  5. First line of first paragraph. Second line of first paragraph is not intended. Nor is third... 

  6. emphasis works

    emphasis still works 

    1. The top couple half figure, contrary sides and hands across with bottom couple,

      Half figure back on your own sides, and turn partner to places,

      Swing partners with right hands into straight line long-ways, as in a reel, and

      Set,

      Hey and return to places,

      The other three couples do the same.

    2. Top and bottom couples meet and set,

      Then each gentleman leas the opposite lady to the couple on his left, and set,

      Aach four right and left,

      Swing side couples to places, and turn partners all eight,

      The other two couple o the same.

Markdown-3.1.1/tests/extensions/extra/footnote.txt0000644000076500000240000000242513212354257023005 0ustar waylanstaff00000000000000This is the body with a footnote[^1] or two[^2] or more[^3] [^4] [^5]. Also a reference that does not exist[^6]. Duplicate[^a] footnotes[^a] test[^a]. Duplicate[^b] footnotes[^b] test[^b]. Single after duplicates[^c]. Test emphasis at end of footnote[^d] Complex footnote content[^e] [^1]: Footnote that ends with a list: * item 1 * item 2 [^2]: > This footnote is a blockquote. [^3]: A simple oneliner. [^4]: A footnote with multiple paragraphs. Paragraph two. [^5]: First line of first paragraph. Second line of first paragraph is not intended. Nor is third... [^a]: 1 [^b]: 2 [^c]: 3 [^d]: _emphasis works_ _emphasis still works_ [^e]: 1. The top couple half figure, contrary sides and hands across with bottom couple, Half figure back on your own sides, and turn partner to places, Swing partners with right hands into straight line long-ways, as in a reel, and Set, Hey and return to places, The other three couples do the same. 2. Top and bottom couples meet and set, Then each gentleman leas the opposite lady to the couple on his left, and set, Aach four right and left, Swing side couples to places, and turn partners all eight, The other two couple o the same. Markdown-3.1.1/tests/extensions/extra/footnote_many_footnotes.html0000644000076500000240000106770513432642364026276 0ustar waylanstaff00000000000000

Something1

Something2

Something3

Something4

Something5

Something6

Something7

Something8

Something9

Something10

Something11

Something12

Something13

Something14

Something15

Something16

Something17

Something18

Something19

Something20

Something21

Something22

Something23

Something24

Something25

Something26

Something27

Something28

Something29

Something30

Something31

Something32

Something33

Something34

Something35

Something36

Something37

Something38

Something39

Something40

Something41

Something42

Something43

Something44

Something45

Something46

Something47

Something48

Something49

Something50

Something51

Something52

Something53

Something54

Something55

Something56

Something57

Something58

Something59

Something60

Something61

Something62

Something63

Something64

Something65

Something66

Something67

Something68

Something69

Something70

Something71

Something72

Something73

Something74

Something75

Something76

Something77

Something78

Something79

Something80

Something81

Something82

Something83

Something84

Something85

Something86

Something87

Something88

Something89

Something90

Something91

Something92

Something93

Something94

Something95

Something96

Something97

Something98

Something99

Something100

Something101

Something102

Something103

Something104

Something105

Something106

Something107

Something108

Something109

Something110

Something111

Something112

Something113

Something114

Something115

Something116

Something117

Something118

Something119

Something120

Something121

Something122

Something123

Something124

Something125

Something126

Something127

Something128

Something129

Something130

Something131

Something132

Something133

Something134

Something135

Something136

Something137

Something138

Something139

Something140

Something141

Something142

Something143

Something144

Something145

Something146

Something147

Something148

Something149

Something150

Something151

Something152

Something153

Something154

Something155

Something156

Something157

Something158

Something159

Something160

Something161

Something162

Something163

Something164

Something165

Something166

Something167

Something168

Something169

Something170

Something171

Something172

Something173

Something174

Something175

Something176

Something177

Something178

Something179

Something180

Something181

Something182

Something183

Something184

Something185

Something186

Something187

Something188

Something189

Something190

Something191

Something192

Something193

Something194

Something195

Something196

Something197

Something198

Something199

Something200

Something201

Something202

Something203

Something204

Something205

Something206

Something207

Something208

Something209

Something210

Something211

Something212

Something213

Something214

Something215

Something216

Something217

Something218

Something219

Something220

Something221

Something222

Something223

Something224

Something225

Something226

Something227

Something228

Something229

Something230

Something231

Something232

Something233

Something234

Something235

Something236

Something237

Something238

Something239

Something240

Something241

Something242

Something243

Something244

Something245

Something246

Something247

Something248

Something249

Something250

Something251

Something252

Something253

Something254

Something255

Something256

Something257

Something258

Something259

Something260

Something261

Something262

Something263

Something264

Something265

Something266

Something267

Something268

Something269

Something270

Something271

Something272

Something273

Something274

Something275

Something276

Something277

Something278

Something279

Something280

Something281

Something282

Something283

Something284

Something285

Something286

Something287

Something288

Something289

Something290

Something291

Something292

Something293

Something294

Something295

Something296

Something297

Something298

Something299

Something300

Something301

Something302

Something303

Something304

Something305

Something306

Something307

Something308

Something309

Something310

Something311

Something312

Something313

Something314

Something315

Something316

Something317

Something318

Something319

Something320

Something321

Something322

Something323

Something324

Something325

Something326

Something327

Something328

Something329

Something330

Something331

Something332

Something333

Something334

Something335

Something336

Something337

Something338

Something339

Something340

Something341

Something342

Something343

Something344

Something345

Something346

Something347

Something348

Something349

Something350

Something351

Something352

Something353

Something354

Something355

Something356

Something357

Something358

Something359

Something360

Something361

Something362

Something363

Something364

Something365

Something366

Something367

Something368

Something369

Something370

Something371

Something372

Something373

Something374

Something375

Something376

Something377

Something378

Something379

Something380

Something381

Something382

Something383

Something384

Something385

Something386

Something387

Something388

Something389

Something390

Something391

Something392

Something393

Something394

Something395

Something396

Something397

Something398

Something399

Something400

Something401

Something402

Something403

Something404

Something405

Something406

Something407

Something408

Something409

Something410

Something411

Something412

Something413

Something414

Something415

Something416

Something417

Something418

Something419

Something420

Something421

Something422

Something423

Something424

Something425

Something426

Something427

Something428

Something429

Something430

Something431

Something432

Something433

Something434

Something435

Something436

Something437

Something438

Something439

Something440

Something441

Something442

Something443

Something444

Something445

Something446

Something447

Something448

Something449

Something450

Something451

Something452

Something453

Something454

Something455

Something456

Something457

Something458

Something459

Something460

Something461

Something462

Something463

Something464

Something465

Something466

Something467

Something468

Something469

Something470

Something471

Something472

Something473

Something474

Something475

Something476

Something477

Something478

Something479

Something480

Something481

Something482

Something483

Something484

Something485

Something486

Something487

Something488

Something489

Something490

Something491

Something492

Something493

Something494

Something495

Something496

Something497

Something498

Something499

Something500

Something501

Something502

Something503

Something504

Something505

Something506

Something507

Something508

Something509

Something510

Something511

Something512

Something513

Something514

Something515

Something516

Something517

Something518

Something519

Something520

Something521

Something522

Something523

Something524

Something525

Something526

Something527

Something528

Something529

Something530

Something531

Something532

Something533

Something534

Something535

Something536

Something537

Something538

Something539

Something540

Something541

Something542

Something543

Something544

Something545

Something546

Something547

Something548

Something549

Something550

Something551

Something552

Something553

Something554

Something555

Something556

Something557

Something558

Something559

Something560

Something561

Something562

Something563

Something564

Something565

Something566

Something567

Something568

Something569

Something570

Something571

Something572

Something573

Something574

Something575

Something576

Something577

Something578

Something579

Something580

Something581

Something582

Something583

Something584

Something585

Something586

Something587

Something588

Something589

Something590

Something591

Something592

Something593

Something594

Something595

Something596

Something597

Something598

Something599

Something600

Something601

Something602

Something603

Something604

Something605

Something606

Something607

Something608

Something609

Something610

Something611

Something612

Something613

Something614

Something615

Something616

Something617

Something618

Something619

Something620

Something621

Something622

Something623

Something624

Something625

Something626

Something627

Something628

Something629

Something630

Something631

Something632

Something633

Something634

Something635

Something636

Something637

Something638

Something639

Something640

Something641

Something642

Something643

Something644

Something645

Something646

Something647

Something648

Something649

Something650

Something651

Something652

Something653

Something654

Something655

Something656

Something657

Something658

Something659

Something660

Something661

Something662

Something663

Something664

Something665

Something666

Something667

Something668

Something669

Something670

Something671

Something672

Something673

Something674

Something675

Something676

Something677

Something678

Something679

Something680

Something681

Something682

Something683

Something684

Something685

Something686

Something687

Something688

Something689

Something690

Something691

Something692

Something693

Something694

Something695

Something696

Something697

Something698

Something699

Something700

Something701

Something702

Something703

Something704

Something705

Something706

Something707

Something708

Something709

Something710

Something711

Something712

Something713

Something714

Something715

Something716

Something717

Something718

Something719

Something720

Something721

Something722

Something723

Something724

Something725

Something726

Something727

Something728

Something729

Something730

Something731

Something732

Something733

Something734

Something735

Something736

Something737

Something738

Something739

Something740

Something741

Something742

Something743

Something744

Something745

Something746

Something747

Something748

Something749

Something750

Something751

Something752

Something753

Something754

Something755

Something756

Something757

Something758

Something759

Something760

Something761

Something762

Something763

Something764

Something765

Something766

Something767

Something768

Something769

Something770

Something771

Something772

Something773

Something774

Something775

Something776

Something777

Something778

Something779

Something780

Something781

Something782

Something783

Something784

Something785

Something786

Something787

Something788

Something789

Something790

Something791

Something792

Something793

Something794

Something795

Something796

Something797

Something798

Something799

Something800

Something801

Something802

Something803

Something804

Something805

Something806

Something807

Something808

Something809

Something810

Something811

Something812

Something813

Something814

Something815

Something816

Something817

Something818

Something819

Something820

Something821

Something822

Something823

Something824

Something825

Something826

Something827

Something828

Something829

Something830

Something831

Something832

Something833

Something834

Something835

Something836

Something837

Something838

Something839

Something840

Something841

Something842

Something843

Something844

Something845

Something846

Something847

Something848

Something849

Something850

Something851

Something852

Something853

Something854

Something855

Something856

Something857

Something858

Something859

Something860

Something861

Something862

Something863

Something864

Something865

Something866

Something867

Something868

Something869

Something870

Something871

Something872

Something873

Something874

Something875

Something876

Something877

Something878

Something879

Something880

Something881

Something882

Something883

Something884

Something885

Something886

Something887

Something888

Something889

Something890

Something891

Something892

Something893

Something894

Something895

Something896

Something897

Something898

Something899

Something900

Something901

Something902

Something903

Something904

Something905

Something906

Something907

Something908

Something909

Something910

Something911

Something912

Something913

Something914

Something915

Something916

Something917

Something918

Something919

Something920

Something921

Something922

Something923

Something924

Something925

Something926

Something927

Something928

Something929

Something930

Something931

Something932

Something933

Something934

Something935

Something936

Something937

Something938

Something939

Something940

Something941

Something942

Something943

Something944

Something945

Something946

Something947

Something948

Something949

Something950

Something951

Something952

Something953

Something954

Something955

Something956

Something957

Something958

Something959

Something960

Something961

Something962

Something963

Something964

Something965

Something966

Something967

Something968

Something969

Something970

Something971

Something972

Something973

Something974

Something975

Something976

Something977

Something978

Something979

Something980

Something981

Something982

Something983

Something984

Something985

Something986

Something987

Something988

Something989

Something990

Something991

Something992

Something993

Something994

Something995

Something996

Something997

Something998

Something999

Something1000

Something1001

Something1002

Something1003

Something1004

Something1005

Something1006

Something1007

Something1008

Something1009

Something1010

Something1011

Something1012

Something1013

Something1014

Something1015

Something1016

Something1017

Something1018

Something1019

Something1020

Something1021

Something1022

Something1023

Something1024

Something1025

Something1026

Something1027

Something1028

Something1029

Something1030

Something1031

Something1032

Something1033

Something1034

Something1035

Something1036

Something1037

Something1038

Something1039

Something1040

Something1041

Something1042

Something1043

Something1044

Something1045

Something1046

Something1047

Something1048

Something1049

Something1050

Something1051

Something1052

Something1053

Something1054

Something1055

Something1056

Something1057

Something1058

Something1059

Something1060

Something1061

Something1062

Something1063

Something1064

Something1065

Something1066

Something1067

Something1068

Something1069

Something1070

Something1071

Something1072

Something1073

Something1074

Something1075

Something1076

Something1077

Something1078

Something1079

Something1080

Something1081

Something1082

Something1083

Something1084

Something1085

Something1086

Something1087

Something1088

Something1089

Something1090

Something1091

Something1092

Something1093

Something1094

Something1095

Something1096

Something1097

Something1098

Something1099

Something1100

Something1101

Something1102

Something1103

Something1104

Something1105

Something1106

Something1107

Something1108

Something1109

Something1110

Something1111

Something1112

Something1113

Something1114

Something1115

Something1116

Something1117

Something1118

Something1119

Something1120

Something1121

Something1122

Something1123

Something1124

Something1125

Something1126

Something1127

Something1128

Something1129

Something1130

Something1131

Something1132

Something1133

Something1134

Something1135

Something1136

Something1137

Something1138

Something1139

Something1140

Something1141

Something1142

Something1143

Something1144

Something1145

Something1146

Something1147

Something1148

Something1149

Something1150

Something1151

Something1152

Something1153

Something1154

Something1155

Something1156

Something1157

Something1158

Something1159

Something1160

Something1161

Something1162

Something1163

Something1164

Something1165

Something1166

Something1167

Something1168

Something1169

Something1170

Something1171

Something1172

Something1173

Something1174

Something1175

Something1176

Something1177

Something1178

Something1179

Something1180

Something1181

Something1182

Something1183

Something1184

Something1185

Something1186

Something1187

Something1188

Something1189

Something1190

Something1191

Something1192

Something1193

Something1194

Something1195

Something1196

Something1197

Something1198

Something1199


  1. Another thing 

  2. Another thing 

  3. Another thing 

  4. Another thing 

  5. Another thing 

  6. Another thing 

  7. Another thing 

  8. Another thing 

  9. Another thing 

  10. Another thing 

  11. Another thing 

  12. Another thing 

  13. Another thing 

  14. Another thing 

  15. Another thing 

  16. Another thing 

  17. Another thing 

  18. Another thing 

  19. Another thing 

  20. Another thing 

  21. Another thing 

  22. Another thing 

  23. Another thing 

  24. Another thing 

  25. Another thing 

  26. Another thing 

  27. Another thing 

  28. Another thing 

  29. Another thing 

  30. Another thing 

  31. Another thing 

  32. Another thing 

  33. Another thing 

  34. Another thing 

  35. Another thing 

  36. Another thing 

  37. Another thing 

  38. Another thing 

  39. Another thing 

  40. Another thing 

  41. Another thing 

  42. Another thing 

  43. Another thing 

  44. Another thing 

  45. Another thing 

  46. Another thing 

  47. Another thing 

  48. Another thing 

  49. Another thing 

  50. Another thing 

  51. Another thing 

  52. Another thing 

  53. Another thing 

  54. Another thing 

  55. Another thing 

  56. Another thing 

  57. Another thing 

  58. Another thing 

  59. Another thing 

  60. Another thing 

  61. Another thing 

  62. Another thing 

  63. Another thing 

  64. Another thing 

  65. Another thing 

  66. Another thing 

  67. Another thing 

  68. Another thing 

  69. Another thing 

  70. Another thing 

  71. Another thing 

  72. Another thing 

  73. Another thing 

  74. Another thing 

  75. Another thing 

  76. Another thing 

  77. Another thing 

  78. Another thing 

  79. Another thing 

  80. Another thing 

  81. Another thing 

  82. Another thing 

  83. Another thing 

  84. Another thing 

  85. Another thing 

  86. Another thing 

  87. Another thing 

  88. Another thing 

  89. Another thing 

  90. Another thing 

  91. Another thing 

  92. Another thing 

  93. Another thing 

  94. Another thing 

  95. Another thing 

  96. Another thing 

  97. Another thing 

  98. Another thing 

  99. Another thing 

  100. Another thing 

  101. Another thing 

  102. Another thing 

  103. Another thing 

  104. Another thing 

  105. Another thing 

  106. Another thing 

  107. Another thing 

  108. Another thing 

  109. Another thing 

  110. Another thing 

  111. Another thing 

  112. Another thing 

  113. Another thing 

  114. Another thing 

  115. Another thing 

  116. Another thing 

  117. Another thing 

  118. Another thing 

  119. Another thing 

  120. Another thing 

  121. Another thing 

  122. Another thing 

  123. Another thing 

  124. Another thing 

  125. Another thing 

  126. Another thing 

  127. Another thing 

  128. Another thing 

  129. Another thing 

  130. Another thing 

  131. Another thing 

  132. Another thing 

  133. Another thing 

  134. Another thing 

  135. Another thing 

  136. Another thing 

  137. Another thing 

  138. Another thing 

  139. Another thing 

  140. Another thing 

  141. Another thing 

  142. Another thing 

  143. Another thing 

  144. Another thing 

  145. Another thing 

  146. Another thing 

  147. Another thing 

  148. Another thing 

  149. Another thing 

  150. Another thing 

  151. Another thing 

  152. Another thing 

  153. Another thing 

  154. Another thing 

  155. Another thing 

  156. Another thing 

  157. Another thing 

  158. Another thing 

  159. Another thing 

  160. Another thing 

  161. Another thing 

  162. Another thing 

  163. Another thing 

  164. Another thing 

  165. Another thing 

  166. Another thing 

  167. Another thing 

  168. Another thing 

  169. Another thing 

  170. Another thing 

  171. Another thing 

  172. Another thing 

  173. Another thing 

  174. Another thing 

  175. Another thing 

  176. Another thing 

  177. Another thing 

  178. Another thing 

  179. Another thing 

  180. Another thing 

  181. Another thing 

  182. Another thing 

  183. Another thing 

  184. Another thing 

  185. Another thing 

  186. Another thing 

  187. Another thing 

  188. Another thing 

  189. Another thing 

  190. Another thing 

  191. Another thing 

  192. Another thing 

  193. Another thing 

  194. Another thing 

  195. Another thing 

  196. Another thing 

  197. Another thing 

  198. Another thing 

  199. Another thing 

  200. Another thing 

  201. Another thing 

  202. Another thing 

  203. Another thing 

  204. Another thing 

  205. Another thing 

  206. Another thing 

  207. Another thing 

  208. Another thing 

  209. Another thing 

  210. Another thing 

  211. Another thing 

  212. Another thing 

  213. Another thing 

  214. Another thing 

  215. Another thing 

  216. Another thing 

  217. Another thing 

  218. Another thing 

  219. Another thing 

  220. Another thing 

  221. Another thing 

  222. Another thing 

  223. Another thing 

  224. Another thing 

  225. Another thing 

  226. Another thing 

  227. Another thing 

  228. Another thing 

  229. Another thing 

  230. Another thing 

  231. Another thing 

  232. Another thing 

  233. Another thing 

  234. Another thing 

  235. Another thing 

  236. Another thing 

  237. Another thing 

  238. Another thing 

  239. Another thing 

  240. Another thing 

  241. Another thing 

  242. Another thing 

  243. Another thing 

  244. Another thing 

  245. Another thing 

  246. Another thing 

  247. Another thing 

  248. Another thing 

  249. Another thing 

  250. Another thing 

  251. Another thing 

  252. Another thing 

  253. Another thing 

  254. Another thing 

  255. Another thing 

  256. Another thing 

  257. Another thing 

  258. Another thing 

  259. Another thing 

  260. Another thing 

  261. Another thing 

  262. Another thing 

  263. Another thing 

  264. Another thing 

  265. Another thing 

  266. Another thing 

  267. Another thing 

  268. Another thing 

  269. Another thing 

  270. Another thing 

  271. Another thing 

  272. Another thing 

  273. Another thing 

  274. Another thing 

  275. Another thing 

  276. Another thing 

  277. Another thing 

  278. Another thing 

  279. Another thing 

  280. Another thing 

  281. Another thing 

  282. Another thing 

  283. Another thing 

  284. Another thing 

  285. Another thing 

  286. Another thing 

  287. Another thing 

  288. Another thing 

  289. Another thing 

  290. Another thing 

  291. Another thing 

  292. Another thing 

  293. Another thing 

  294. Another thing 

  295. Another thing 

  296. Another thing 

  297. Another thing 

  298. Another thing 

  299. Another thing 

  300. Another thing 

  301. Another thing 

  302. Another thing 

  303. Another thing 

  304. Another thing 

  305. Another thing 

  306. Another thing 

  307. Another thing 

  308. Another thing 

  309. Another thing 

  310. Another thing 

  311. Another thing 

  312. Another thing 

  313. Another thing 

  314. Another thing 

  315. Another thing 

  316. Another thing 

  317. Another thing 

  318. Another thing 

  319. Another thing 

  320. Another thing 

  321. Another thing 

  322. Another thing 

  323. Another thing 

  324. Another thing 

  325. Another thing 

  326. Another thing 

  327. Another thing 

  328. Another thing 

  329. Another thing 

  330. Another thing 

  331. Another thing 

  332. Another thing 

  333. Another thing 

  334. Another thing 

  335. Another thing 

  336. Another thing 

  337. Another thing 

  338. Another thing 

  339. Another thing 

  340. Another thing 

  341. Another thing 

  342. Another thing 

  343. Another thing 

  344. Another thing 

  345. Another thing 

  346. Another thing 

  347. Another thing 

  348. Another thing 

  349. Another thing 

  350. Another thing 

  351. Another thing 

  352. Another thing 

  353. Another thing 

  354. Another thing 

  355. Another thing 

  356. Another thing 

  357. Another thing 

  358. Another thing 

  359. Another thing 

  360. Another thing 

  361. Another thing 

  362. Another thing 

  363. Another thing 

  364. Another thing 

  365. Another thing 

  366. Another thing 

  367. Another thing 

  368. Another thing 

  369. Another thing 

  370. Another thing 

  371. Another thing 

  372. Another thing 

  373. Another thing 

  374. Another thing 

  375. Another thing 

  376. Another thing 

  377. Another thing 

  378. Another thing 

  379. Another thing 

  380. Another thing 

  381. Another thing 

  382. Another thing 

  383. Another thing 

  384. Another thing 

  385. Another thing 

  386. Another thing 

  387. Another thing 

  388. Another thing 

  389. Another thing 

  390. Another thing 

  391. Another thing 

  392. Another thing 

  393. Another thing 

  394. Another thing 

  395. Another thing 

  396. Another thing 

  397. Another thing 

  398. Another thing 

  399. Another thing 

  400. Another thing 

  401. Another thing 

  402. Another thing 

  403. Another thing 

  404. Another thing 

  405. Another thing 

  406. Another thing 

  407. Another thing 

  408. Another thing 

  409. Another thing 

  410. Another thing 

  411. Another thing 

  412. Another thing 

  413. Another thing 

  414. Another thing 

  415. Another thing 

  416. Another thing 

  417. Another thing 

  418. Another thing 

  419. Another thing 

  420. Another thing 

  421. Another thing 

  422. Another thing 

  423. Another thing 

  424. Another thing 

  425. Another thing 

  426. Another thing 

  427. Another thing 

  428. Another thing 

  429. Another thing 

  430. Another thing 

  431. Another thing 

  432. Another thing 

  433. Another thing 

  434. Another thing 

  435. Another thing 

  436. Another thing 

  437. Another thing 

  438. Another thing 

  439. Another thing 

  440. Another thing 

  441. Another thing 

  442. Another thing 

  443. Another thing 

  444. Another thing 

  445. Another thing 

  446. Another thing 

  447. Another thing 

  448. Another thing 

  449. Another thing 

  450. Another thing 

  451. Another thing 

  452. Another thing 

  453. Another thing 

  454. Another thing 

  455. Another thing 

  456. Another thing 

  457. Another thing 

  458. Another thing 

  459. Another thing 

  460. Another thing 

  461. Another thing 

  462. Another thing 

  463. Another thing 

  464. Another thing 

  465. Another thing 

  466. Another thing 

  467. Another thing 

  468. Another thing 

  469. Another thing 

  470. Another thing 

  471. Another thing 

  472. Another thing 

  473. Another thing 

  474. Another thing 

  475. Another thing 

  476. Another thing 

  477. Another thing 

  478. Another thing 

  479. Another thing 

  480. Another thing 

  481. Another thing 

  482. Another thing 

  483. Another thing 

  484. Another thing 

  485. Another thing 

  486. Another thing 

  487. Another thing 

  488. Another thing 

  489. Another thing 

  490. Another thing 

  491. Another thing 

  492. Another thing 

  493. Another thing 

  494. Another thing 

  495. Another thing 

  496. Another thing 

  497. Another thing 

  498. Another thing 

  499. Another thing 

  500. Another thing 

  501. Another thing 

  502. Another thing 

  503. Another thing 

  504. Another thing 

  505. Another thing 

  506. Another thing 

  507. Another thing 

  508. Another thing 

  509. Another thing 

  510. Another thing 

  511. Another thing 

  512. Another thing 

  513. Another thing 

  514. Another thing 

  515. Another thing 

  516. Another thing 

  517. Another thing 

  518. Another thing 

  519. Another thing 

  520. Another thing 

  521. Another thing 

  522. Another thing 

  523. Another thing 

  524. Another thing 

  525. Another thing 

  526. Another thing 

  527. Another thing 

  528. Another thing 

  529. Another thing 

  530. Another thing 

  531. Another thing 

  532. Another thing 

  533. Another thing 

  534. Another thing 

  535. Another thing 

  536. Another thing 

  537. Another thing 

  538. Another thing 

  539. Another thing 

  540. Another thing 

  541. Another thing 

  542. Another thing 

  543. Another thing 

  544. Another thing 

  545. Another thing 

  546. Another thing 

  547. Another thing 

  548. Another thing 

  549. Another thing 

  550. Another thing 

  551. Another thing 

  552. Another thing 

  553. Another thing 

  554. Another thing 

  555. Another thing 

  556. Another thing 

  557. Another thing 

  558. Another thing 

  559. Another thing 

  560. Another thing 

  561. Another thing 

  562. Another thing 

  563. Another thing 

  564. Another thing 

  565. Another thing 

  566. Another thing 

  567. Another thing 

  568. Another thing 

  569. Another thing 

  570. Another thing 

  571. Another thing 

  572. Another thing 

  573. Another thing 

  574. Another thing 

  575. Another thing 

  576. Another thing 

  577. Another thing 

  578. Another thing 

  579. Another thing 

  580. Another thing 

  581. Another thing 

  582. Another thing 

  583. Another thing 

  584. Another thing 

  585. Another thing 

  586. Another thing 

  587. Another thing 

  588. Another thing 

  589. Another thing 

  590. Another thing 

  591. Another thing 

  592. Another thing 

  593. Another thing 

  594. Another thing 

  595. Another thing 

  596. Another thing 

  597. Another thing 

  598. Another thing 

  599. Another thing 

  600. Another thing 

  601. Another thing 

  602. Another thing 

  603. Another thing 

  604. Another thing 

  605. Another thing 

  606. Another thing 

  607. Another thing 

  608. Another thing 

  609. Another thing 

  610. Another thing 

  611. Another thing 

  612. Another thing 

  613. Another thing 

  614. Another thing 

  615. Another thing 

  616. Another thing 

  617. Another thing 

  618. Another thing 

  619. Another thing 

  620. Another thing 

  621. Another thing 

  622. Another thing 

  623. Another thing 

  624. Another thing 

  625. Another thing 

  626. Another thing 

  627. Another thing 

  628. Another thing 

  629. Another thing 

  630. Another thing 

  631. Another thing 

  632. Another thing 

  633. Another thing 

  634. Another thing 

  635. Another thing 

  636. Another thing 

  637. Another thing 

  638. Another thing 

  639. Another thing 

  640. Another thing 

  641. Another thing 

  642. Another thing 

  643. Another thing 

  644. Another thing 

  645. Another thing 

  646. Another thing 

  647. Another thing 

  648. Another thing 

  649. Another thing 

  650. Another thing 

  651. Another thing 

  652. Another thing 

  653. Another thing 

  654. Another thing 

  655. Another thing 

  656. Another thing 

  657. Another thing 

  658. Another thing 

  659. Another thing 

  660. Another thing 

  661. Another thing 

  662. Another thing 

  663. Another thing 

  664. Another thing 

  665. Another thing 

  666. Another thing 

  667. Another thing 

  668. Another thing 

  669. Another thing 

  670. Another thing 

  671. Another thing 

  672. Another thing 

  673. Another thing 

  674. Another thing 

  675. Another thing 

  676. Another thing 

  677. Another thing 

  678. Another thing 

  679. Another thing 

  680. Another thing 

  681. Another thing 

  682. Another thing 

  683. Another thing 

  684. Another thing 

  685. Another thing 

  686. Another thing 

  687. Another thing 

  688. Another thing 

  689. Another thing 

  690. Another thing 

  691. Another thing 

  692. Another thing 

  693. Another thing 

  694. Another thing 

  695. Another thing 

  696. Another thing 

  697. Another thing 

  698. Another thing 

  699. Another thing 

  700. Another thing 

  701. Another thing 

  702. Another thing 

  703. Another thing 

  704. Another thing 

  705. Another thing 

  706. Another thing 

  707. Another thing 

  708. Another thing 

  709. Another thing 

  710. Another thing 

  711. Another thing 

  712. Another thing 

  713. Another thing 

  714. Another thing 

  715. Another thing 

  716. Another thing 

  717. Another thing 

  718. Another thing 

  719. Another thing 

  720. Another thing 

  721. Another thing 

  722. Another thing 

  723. Another thing 

  724. Another thing 

  725. Another thing 

  726. Another thing 

  727. Another thing 

  728. Another thing 

  729. Another thing 

  730. Another thing 

  731. Another thing 

  732. Another thing 

  733. Another thing 

  734. Another thing 

  735. Another thing 

  736. Another thing 

  737. Another thing 

  738. Another thing 

  739. Another thing 

  740. Another thing 

  741. Another thing 

  742. Another thing 

  743. Another thing 

  744. Another thing 

  745. Another thing 

  746. Another thing 

  747. Another thing 

  748. Another thing 

  749. Another thing 

  750. Another thing 

  751. Another thing 

  752. Another thing 

  753. Another thing 

  754. Another thing 

  755. Another thing 

  756. Another thing 

  757. Another thing 

  758. Another thing 

  759. Another thing 

  760. Another thing 

  761. Another thing 

  762. Another thing 

  763. Another thing 

  764. Another thing 

  765. Another thing 

  766. Another thing 

  767. Another thing 

  768. Another thing 

  769. Another thing 

  770. Another thing 

  771. Another thing 

  772. Another thing 

  773. Another thing 

  774. Another thing 

  775. Another thing 

  776. Another thing 

  777. Another thing 

  778. Another thing 

  779. Another thing 

  780. Another thing 

  781. Another thing 

  782. Another thing 

  783. Another thing 

  784. Another thing 

  785. Another thing 

  786. Another thing 

  787. Another thing 

  788. Another thing 

  789. Another thing 

  790. Another thing 

  791. Another thing 

  792. Another thing 

  793. Another thing 

  794. Another thing 

  795. Another thing 

  796. Another thing 

  797. Another thing 

  798. Another thing 

  799. Another thing 

  800. Another thing 

  801. Another thing 

  802. Another thing 

  803. Another thing 

  804. Another thing 

  805. Another thing 

  806. Another thing 

  807. Another thing 

  808. Another thing 

  809. Another thing 

  810. Another thing 

  811. Another thing 

  812. Another thing 

  813. Another thing 

  814. Another thing 

  815. Another thing 

  816. Another thing 

  817. Another thing 

  818. Another thing 

  819. Another thing 

  820. Another thing 

  821. Another thing 

  822. Another thing 

  823. Another thing 

  824. Another thing 

  825. Another thing 

  826. Another thing 

  827. Another thing 

  828. Another thing 

  829. Another thing 

  830. Another thing 

  831. Another thing 

  832. Another thing 

  833. Another thing 

  834. Another thing 

  835. Another thing 

  836. Another thing 

  837. Another thing 

  838. Another thing 

  839. Another thing 

  840. Another thing 

  841. Another thing 

  842. Another thing 

  843. Another thing 

  844. Another thing 

  845. Another thing 

  846. Another thing 

  847. Another thing 

  848. Another thing 

  849. Another thing 

  850. Another thing 

  851. Another thing 

  852. Another thing 

  853. Another thing 

  854. Another thing 

  855. Another thing 

  856. Another thing 

  857. Another thing 

  858. Another thing 

  859. Another thing 

  860. Another thing 

  861. Another thing 

  862. Another thing 

  863. Another thing 

  864. Another thing 

  865. Another thing 

  866. Another thing 

  867. Another thing 

  868. Another thing 

  869. Another thing 

  870. Another thing 

  871. Another thing 

  872. Another thing 

  873. Another thing 

  874. Another thing 

  875. Another thing 

  876. Another thing 

  877. Another thing 

  878. Another thing 

  879. Another thing 

  880. Another thing 

  881. Another thing 

  882. Another thing 

  883. Another thing 

  884. Another thing 

  885. Another thing 

  886. Another thing 

  887. Another thing 

  888. Another thing 

  889. Another thing 

  890. Another thing 

  891. Another thing 

  892. Another thing 

  893. Another thing 

  894. Another thing 

  895. Another thing 

  896. Another thing 

  897. Another thing 

  898. Another thing 

  899. Another thing 

  900. Another thing 

  901. Another thing 

  902. Another thing 

  903. Another thing 

  904. Another thing 

  905. Another thing 

  906. Another thing 

  907. Another thing 

  908. Another thing 

  909. Another thing 

  910. Another thing 

  911. Another thing 

  912. Another thing 

  913. Another thing 

  914. Another thing 

  915. Another thing 

  916. Another thing 

  917. Another thing 

  918. Another thing 

  919. Another thing 

  920. Another thing 

  921. Another thing 

  922. Another thing 

  923. Another thing 

  924. Another thing 

  925. Another thing 

  926. Another thing 

  927. Another thing 

  928. Another thing 

  929. Another thing 

  930. Another thing 

  931. Another thing 

  932. Another thing 

  933. Another thing 

  934. Another thing 

  935. Another thing 

  936. Another thing 

  937. Another thing 

  938. Another thing 

  939. Another thing 

  940. Another thing 

  941. Another thing 

  942. Another thing 

  943. Another thing 

  944. Another thing 

  945. Another thing 

  946. Another thing 

  947. Another thing 

  948. Another thing 

  949. Another thing 

  950. Another thing 

  951. Another thing 

  952. Another thing 

  953. Another thing 

  954. Another thing 

  955. Another thing 

  956. Another thing 

  957. Another thing 

  958. Another thing 

  959. Another thing 

  960. Another thing 

  961. Another thing 

  962. Another thing 

  963. Another thing 

  964. Another thing 

  965. Another thing 

  966. Another thing 

  967. Another thing 

  968. Another thing 

  969. Another thing 

  970. Another thing 

  971. Another thing 

  972. Another thing 

  973. Another thing 

  974. Another thing 

  975. Another thing 

  976. Another thing 

  977. Another thing 

  978. Another thing 

  979. Another thing 

  980. Another thing 

  981. Another thing 

  982. Another thing 

  983. Another thing 

  984. Another thing 

  985. Another thing 

  986. Another thing 

  987. Another thing 

  988. Another thing 

  989. Another thing 

  990. Another thing 

  991. Another thing 

  992. Another thing 

  993. Another thing 

  994. Another thing 

  995. Another thing 

  996. Another thing 

  997. Another thing 

  998. Another thing 

  999. Another thing 

  1000. Another thing 

  1001. Another thing 

  1002. Another thing 

  1003. Another thing 

  1004. Another thing 

  1005. Another thing 

  1006. Another thing 

  1007. Another thing 

  1008. Another thing 

  1009. Another thing 

  1010. Another thing 

  1011. Another thing 

  1012. Another thing 

  1013. Another thing 

  1014. Another thing 

  1015. Another thing 

  1016. Another thing 

  1017. Another thing 

  1018. Another thing 

  1019. Another thing 

  1020. Another thing 

  1021. Another thing 

  1022. Another thing 

  1023. Another thing 

  1024. Another thing 

  1025. Another thing 

  1026. Another thing 

  1027. Another thing 

  1028. Another thing 

  1029. Another thing 

  1030. Another thing 

  1031. Another thing 

  1032. Another thing 

  1033. Another thing 

  1034. Another thing 

  1035. Another thing 

  1036. Another thing 

  1037. Another thing 

  1038. Another thing 

  1039. Another thing 

  1040. Another thing 

  1041. Another thing 

  1042. Another thing 

  1043. Another thing 

  1044. Another thing 

  1045. Another thing 

  1046. Another thing 

  1047. Another thing 

  1048. Another thing 

  1049. Another thing 

  1050. Another thing 

  1051. Another thing 

  1052. Another thing 

  1053. Another thing 

  1054. Another thing 

  1055. Another thing 

  1056. Another thing 

  1057. Another thing 

  1058. Another thing 

  1059. Another thing 

  1060. Another thing 

  1061. Another thing 

  1062. Another thing 

  1063. Another thing 

  1064. Another thing 

  1065. Another thing 

  1066. Another thing 

  1067. Another thing 

  1068. Another thing 

  1069. Another thing 

  1070. Another thing 

  1071. Another thing 

  1072. Another thing 

  1073. Another thing 

  1074. Another thing 

  1075. Another thing 

  1076. Another thing 

  1077. Another thing 

  1078. Another thing 

  1079. Another thing 

  1080. Another thing 

  1081. Another thing 

  1082. Another thing 

  1083. Another thing 

  1084. Another thing 

  1085. Another thing 

  1086. Another thing 

  1087. Another thing 

  1088. Another thing 

  1089. Another thing 

  1090. Another thing 

  1091. Another thing 

  1092. Another thing 

  1093. Another thing 

  1094. Another thing 

  1095. Another thing 

  1096. Another thing 

  1097. Another thing 

  1098. Another thing 

  1099. Another thing 

  1100. Another thing 

  1101. Another thing 

  1102. Another thing 

  1103. Another thing 

  1104. Another thing 

  1105. Another thing 

  1106. Another thing 

  1107. Another thing 

  1108. Another thing 

  1109. Another thing 

  1110. Another thing 

  1111. Another thing 

  1112. Another thing 

  1113. Another thing 

  1114. Another thing 

  1115. Another thing 

  1116. Another thing 

  1117. Another thing 

  1118. Another thing 

  1119. Another thing 

  1120. Another thing 

  1121. Another thing 

  1122. Another thing 

  1123. Another thing 

  1124. Another thing 

  1125. Another thing 

  1126. Another thing 

  1127. Another thing 

  1128. Another thing 

  1129. Another thing 

  1130. Another thing 

  1131. Another thing 

  1132. Another thing 

  1133. Another thing 

  1134. Another thing 

  1135. Another thing 

  1136. Another thing 

  1137. Another thing 

  1138. Another thing 

  1139. Another thing 

  1140. Another thing 

  1141. Another thing 

  1142. Another thing 

  1143. Another thing 

  1144. Another thing 

  1145. Another thing 

  1146. Another thing 

  1147. Another thing 

  1148. Another thing 

  1149. Another thing 

  1150. Another thing 

  1151. Another thing 

  1152. Another thing 

  1153. Another thing 

  1154. Another thing 

  1155. Another thing 

  1156. Another thing 

  1157. Another thing 

  1158. Another thing 

  1159. Another thing 

  1160. Another thing 

  1161. Another thing 

  1162. Another thing 

  1163. Another thing 

  1164. Another thing 

  1165. Another thing 

  1166. Another thing 

  1167. Another thing 

  1168. Another thing 

  1169. Another thing 

  1170. Another thing 

  1171. Another thing 

  1172. Another thing 

  1173. Another thing 

  1174. Another thing 

  1175. Another thing 

  1176. Another thing 

  1177. Another thing 

  1178. Another thing 

  1179. Another thing 

  1180. Another thing 

  1181. Another thing 

  1182. Another thing 

  1183. Another thing 

  1184. Another thing 

  1185. Another thing 

  1186. Another thing 

  1187. Another thing 

  1188. Another thing 

  1189. Another thing 

  1190. Another thing 

  1191. Another thing 

  1192. Another thing 

  1193. Another thing 

  1194. Another thing 

  1195. Another thing 

  1196. Another thing 

  1197. Another thing 

  1198. Another thing 

  1199. Another thing 

Markdown-3.1.1/tests/extensions/extra/footnote_many_footnotes.txt0000644000076500000240000013602013212354257026130 0ustar waylanstaff00000000000000Something[^1] Something[^2] Something[^3] Something[^4] Something[^5] Something[^6] Something[^7] Something[^8] Something[^9] Something[^10] Something[^11] Something[^12] Something[^13] Something[^14] Something[^15] Something[^16] Something[^17] Something[^18] Something[^19] Something[^20] Something[^21] Something[^22] Something[^23] Something[^24] Something[^25] Something[^26] Something[^27] Something[^28] Something[^29] Something[^30] Something[^31] Something[^32] Something[^33] Something[^34] Something[^35] Something[^36] Something[^37] Something[^38] Something[^39] Something[^40] Something[^41] Something[^42] Something[^43] Something[^44] Something[^45] Something[^46] Something[^47] Something[^48] Something[^49] Something[^50] Something[^51] Something[^52] Something[^53] Something[^54] Something[^55] Something[^56] Something[^57] Something[^58] Something[^59] Something[^60] Something[^61] Something[^62] Something[^63] Something[^64] Something[^65] Something[^66] Something[^67] Something[^68] Something[^69] Something[^70] Something[^71] Something[^72] Something[^73] Something[^74] Something[^75] Something[^76] Something[^77] Something[^78] Something[^79] Something[^80] Something[^81] Something[^82] Something[^83] Something[^84] Something[^85] Something[^86] Something[^87] Something[^88] Something[^89] Something[^90] Something[^91] Something[^92] Something[^93] Something[^94] Something[^95] Something[^96] Something[^97] Something[^98] Something[^99] Something[^100] Something[^101] Something[^102] Something[^103] Something[^104] Something[^105] Something[^106] Something[^107] Something[^108] Something[^109] Something[^110] Something[^111] Something[^112] Something[^113] Something[^114] Something[^115] Something[^116] Something[^117] Something[^118] Something[^119] Something[^120] Something[^121] Something[^122] Something[^123] Something[^124] Something[^125] Something[^126] Something[^127] Something[^128] Something[^129] Something[^130] Something[^131] Something[^132] Something[^133] Something[^134] Something[^135] Something[^136] Something[^137] Something[^138] Something[^139] Something[^140] Something[^141] Something[^142] Something[^143] Something[^144] Something[^145] Something[^146] Something[^147] Something[^148] Something[^149] Something[^150] Something[^151] Something[^152] Something[^153] Something[^154] Something[^155] Something[^156] Something[^157] Something[^158] Something[^159] Something[^160] Something[^161] Something[^162] Something[^163] Something[^164] Something[^165] Something[^166] Something[^167] Something[^168] Something[^169] Something[^170] Something[^171] Something[^172] Something[^173] Something[^174] Something[^175] Something[^176] Something[^177] Something[^178] Something[^179] Something[^180] Something[^181] Something[^182] Something[^183] Something[^184] Something[^185] Something[^186] Something[^187] Something[^188] Something[^189] Something[^190] Something[^191] Something[^192] Something[^193] Something[^194] Something[^195] Something[^196] Something[^197] Something[^198] Something[^199] Something[^200] Something[^201] Something[^202] Something[^203] Something[^204] Something[^205] Something[^206] Something[^207] Something[^208] Something[^209] Something[^210] Something[^211] Something[^212] Something[^213] Something[^214] Something[^215] Something[^216] Something[^217] Something[^218] Something[^219] Something[^220] Something[^221] Something[^222] Something[^223] Something[^224] Something[^225] Something[^226] Something[^227] Something[^228] Something[^229] Something[^230] Something[^231] Something[^232] Something[^233] Something[^234] Something[^235] Something[^236] Something[^237] Something[^238] Something[^239] Something[^240] Something[^241] Something[^242] Something[^243] Something[^244] Something[^245] Something[^246] Something[^247] Something[^248] Something[^249] Something[^250] Something[^251] Something[^252] Something[^253] Something[^254] Something[^255] Something[^256] Something[^257] Something[^258] Something[^259] Something[^260] Something[^261] Something[^262] Something[^263] Something[^264] Something[^265] Something[^266] Something[^267] Something[^268] Something[^269] Something[^270] Something[^271] Something[^272] Something[^273] Something[^274] Something[^275] Something[^276] Something[^277] Something[^278] Something[^279] Something[^280] Something[^281] Something[^282] Something[^283] Something[^284] Something[^285] Something[^286] Something[^287] Something[^288] Something[^289] Something[^290] Something[^291] Something[^292] Something[^293] Something[^294] Something[^295] Something[^296] Something[^297] Something[^298] Something[^299] Something[^300] Something[^301] Something[^302] Something[^303] Something[^304] Something[^305] Something[^306] Something[^307] Something[^308] Something[^309] Something[^310] Something[^311] Something[^312] Something[^313] Something[^314] Something[^315] Something[^316] Something[^317] Something[^318] Something[^319] Something[^320] Something[^321] Something[^322] Something[^323] Something[^324] Something[^325] Something[^326] Something[^327] Something[^328] Something[^329] Something[^330] Something[^331] Something[^332] Something[^333] Something[^334] Something[^335] Something[^336] Something[^337] Something[^338] Something[^339] Something[^340] Something[^341] Something[^342] Something[^343] Something[^344] Something[^345] Something[^346] Something[^347] Something[^348] Something[^349] Something[^350] Something[^351] Something[^352] Something[^353] Something[^354] Something[^355] Something[^356] Something[^357] Something[^358] Something[^359] Something[^360] Something[^361] Something[^362] Something[^363] Something[^364] Something[^365] Something[^366] Something[^367] Something[^368] Something[^369] Something[^370] Something[^371] Something[^372] Something[^373] Something[^374] Something[^375] Something[^376] Something[^377] Something[^378] Something[^379] Something[^380] Something[^381] Something[^382] Something[^383] Something[^384] Something[^385] Something[^386] Something[^387] Something[^388] Something[^389] Something[^390] Something[^391] Something[^392] Something[^393] Something[^394] Something[^395] Something[^396] Something[^397] Something[^398] Something[^399] Something[^400] Something[^401] Something[^402] Something[^403] Something[^404] Something[^405] Something[^406] Something[^407] Something[^408] Something[^409] Something[^410] Something[^411] Something[^412] Something[^413] Something[^414] Something[^415] Something[^416] Something[^417] Something[^418] Something[^419] Something[^420] Something[^421] Something[^422] Something[^423] Something[^424] Something[^425] Something[^426] Something[^427] Something[^428] Something[^429] Something[^430] Something[^431] Something[^432] Something[^433] Something[^434] Something[^435] Something[^436] Something[^437] Something[^438] Something[^439] Something[^440] Something[^441] Something[^442] Something[^443] Something[^444] Something[^445] Something[^446] Something[^447] Something[^448] Something[^449] Something[^450] Something[^451] Something[^452] Something[^453] Something[^454] Something[^455] Something[^456] Something[^457] Something[^458] Something[^459] Something[^460] Something[^461] Something[^462] Something[^463] Something[^464] Something[^465] Something[^466] Something[^467] Something[^468] Something[^469] Something[^470] Something[^471] Something[^472] Something[^473] Something[^474] Something[^475] Something[^476] Something[^477] Something[^478] Something[^479] Something[^480] Something[^481] Something[^482] Something[^483] Something[^484] Something[^485] Something[^486] Something[^487] Something[^488] Something[^489] Something[^490] Something[^491] Something[^492] Something[^493] Something[^494] Something[^495] Something[^496] Something[^497] Something[^498] Something[^499] Something[^500] Something[^501] Something[^502] Something[^503] Something[^504] Something[^505] Something[^506] Something[^507] Something[^508] Something[^509] Something[^510] Something[^511] Something[^512] Something[^513] Something[^514] Something[^515] Something[^516] Something[^517] Something[^518] Something[^519] Something[^520] Something[^521] Something[^522] Something[^523] Something[^524] Something[^525] Something[^526] Something[^527] Something[^528] Something[^529] Something[^530] Something[^531] Something[^532] Something[^533] Something[^534] Something[^535] Something[^536] Something[^537] Something[^538] Something[^539] Something[^540] Something[^541] Something[^542] Something[^543] Something[^544] Something[^545] Something[^546] Something[^547] Something[^548] Something[^549] Something[^550] Something[^551] Something[^552] Something[^553] Something[^554] Something[^555] Something[^556] Something[^557] Something[^558] Something[^559] Something[^560] Something[^561] Something[^562] Something[^563] Something[^564] Something[^565] Something[^566] Something[^567] Something[^568] Something[^569] Something[^570] Something[^571] Something[^572] Something[^573] Something[^574] Something[^575] Something[^576] Something[^577] Something[^578] Something[^579] Something[^580] Something[^581] Something[^582] Something[^583] Something[^584] Something[^585] Something[^586] Something[^587] Something[^588] Something[^589] Something[^590] Something[^591] Something[^592] Something[^593] Something[^594] Something[^595] Something[^596] Something[^597] Something[^598] Something[^599] Something[^600] Something[^601] Something[^602] Something[^603] Something[^604] Something[^605] Something[^606] Something[^607] Something[^608] Something[^609] Something[^610] Something[^611] Something[^612] Something[^613] Something[^614] Something[^615] Something[^616] Something[^617] Something[^618] Something[^619] Something[^620] Something[^621] Something[^622] Something[^623] Something[^624] Something[^625] Something[^626] Something[^627] Something[^628] Something[^629] Something[^630] Something[^631] Something[^632] Something[^633] Something[^634] Something[^635] Something[^636] Something[^637] Something[^638] Something[^639] Something[^640] Something[^641] Something[^642] Something[^643] Something[^644] Something[^645] Something[^646] Something[^647] Something[^648] Something[^649] Something[^650] Something[^651] Something[^652] Something[^653] Something[^654] Something[^655] Something[^656] Something[^657] Something[^658] Something[^659] Something[^660] Something[^661] Something[^662] Something[^663] Something[^664] Something[^665] Something[^666] Something[^667] Something[^668] Something[^669] Something[^670] Something[^671] Something[^672] Something[^673] Something[^674] Something[^675] Something[^676] Something[^677] Something[^678] Something[^679] Something[^680] Something[^681] Something[^682] Something[^683] Something[^684] Something[^685] Something[^686] Something[^687] Something[^688] Something[^689] Something[^690] Something[^691] Something[^692] Something[^693] Something[^694] Something[^695] Something[^696] Something[^697] Something[^698] Something[^699] Something[^700] Something[^701] Something[^702] Something[^703] Something[^704] Something[^705] Something[^706] Something[^707] Something[^708] Something[^709] Something[^710] Something[^711] Something[^712] Something[^713] Something[^714] Something[^715] Something[^716] Something[^717] Something[^718] Something[^719] Something[^720] Something[^721] Something[^722] Something[^723] Something[^724] Something[^725] Something[^726] Something[^727] Something[^728] Something[^729] Something[^730] Something[^731] Something[^732] Something[^733] Something[^734] Something[^735] Something[^736] Something[^737] Something[^738] Something[^739] Something[^740] Something[^741] Something[^742] Something[^743] Something[^744] Something[^745] Something[^746] Something[^747] Something[^748] Something[^749] Something[^750] Something[^751] Something[^752] Something[^753] Something[^754] Something[^755] Something[^756] Something[^757] Something[^758] Something[^759] Something[^760] Something[^761] Something[^762] Something[^763] Something[^764] Something[^765] Something[^766] Something[^767] Something[^768] Something[^769] Something[^770] Something[^771] Something[^772] Something[^773] Something[^774] Something[^775] Something[^776] Something[^777] Something[^778] Something[^779] Something[^780] Something[^781] Something[^782] Something[^783] Something[^784] Something[^785] Something[^786] Something[^787] Something[^788] Something[^789] Something[^790] Something[^791] Something[^792] Something[^793] Something[^794] Something[^795] Something[^796] Something[^797] Something[^798] Something[^799] Something[^800] Something[^801] Something[^802] Something[^803] Something[^804] Something[^805] Something[^806] Something[^807] Something[^808] Something[^809] Something[^810] Something[^811] Something[^812] Something[^813] Something[^814] Something[^815] Something[^816] Something[^817] Something[^818] Something[^819] Something[^820] Something[^821] Something[^822] Something[^823] Something[^824] Something[^825] Something[^826] Something[^827] Something[^828] Something[^829] Something[^830] Something[^831] Something[^832] Something[^833] Something[^834] Something[^835] Something[^836] Something[^837] Something[^838] Something[^839] Something[^840] Something[^841] Something[^842] Something[^843] Something[^844] Something[^845] Something[^846] Something[^847] Something[^848] Something[^849] Something[^850] Something[^851] Something[^852] Something[^853] Something[^854] Something[^855] Something[^856] Something[^857] Something[^858] Something[^859] Something[^860] Something[^861] Something[^862] Something[^863] Something[^864] Something[^865] Something[^866] Something[^867] Something[^868] Something[^869] Something[^870] Something[^871] Something[^872] Something[^873] Something[^874] Something[^875] Something[^876] Something[^877] Something[^878] Something[^879] Something[^880] Something[^881] Something[^882] Something[^883] Something[^884] Something[^885] Something[^886] Something[^887] Something[^888] Something[^889] Something[^890] Something[^891] Something[^892] Something[^893] Something[^894] Something[^895] Something[^896] Something[^897] Something[^898] Something[^899] Something[^900] Something[^901] Something[^902] Something[^903] Something[^904] Something[^905] Something[^906] Something[^907] Something[^908] Something[^909] Something[^910] Something[^911] Something[^912] Something[^913] Something[^914] Something[^915] Something[^916] Something[^917] Something[^918] Something[^919] Something[^920] Something[^921] Something[^922] Something[^923] Something[^924] Something[^925] Something[^926] Something[^927] Something[^928] Something[^929] Something[^930] Something[^931] Something[^932] Something[^933] Something[^934] Something[^935] Something[^936] Something[^937] Something[^938] Something[^939] Something[^940] Something[^941] Something[^942] Something[^943] Something[^944] Something[^945] Something[^946] Something[^947] Something[^948] Something[^949] Something[^950] Something[^951] Something[^952] Something[^953] Something[^954] Something[^955] Something[^956] Something[^957] Something[^958] Something[^959] Something[^960] Something[^961] Something[^962] Something[^963] Something[^964] Something[^965] Something[^966] Something[^967] Something[^968] Something[^969] Something[^970] Something[^971] Something[^972] Something[^973] Something[^974] Something[^975] Something[^976] Something[^977] Something[^978] Something[^979] Something[^980] Something[^981] Something[^982] Something[^983] Something[^984] Something[^985] Something[^986] Something[^987] Something[^988] Something[^989] Something[^990] Something[^991] Something[^992] Something[^993] Something[^994] Something[^995] Something[^996] Something[^997] Something[^998] Something[^999] Something[^1000] Something[^1001] Something[^1002] Something[^1003] Something[^1004] Something[^1005] Something[^1006] Something[^1007] Something[^1008] Something[^1009] Something[^1010] Something[^1011] Something[^1012] Something[^1013] Something[^1014] Something[^1015] Something[^1016] Something[^1017] Something[^1018] Something[^1019] Something[^1020] Something[^1021] Something[^1022] Something[^1023] Something[^1024] Something[^1025] Something[^1026] Something[^1027] Something[^1028] Something[^1029] Something[^1030] Something[^1031] Something[^1032] Something[^1033] Something[^1034] Something[^1035] Something[^1036] Something[^1037] Something[^1038] Something[^1039] Something[^1040] Something[^1041] Something[^1042] Something[^1043] Something[^1044] Something[^1045] Something[^1046] Something[^1047] Something[^1048] Something[^1049] Something[^1050] Something[^1051] Something[^1052] Something[^1053] Something[^1054] Something[^1055] Something[^1056] Something[^1057] Something[^1058] Something[^1059] Something[^1060] Something[^1061] Something[^1062] Something[^1063] Something[^1064] Something[^1065] Something[^1066] Something[^1067] Something[^1068] Something[^1069] Something[^1070] Something[^1071] Something[^1072] Something[^1073] Something[^1074] Something[^1075] Something[^1076] Something[^1077] Something[^1078] Something[^1079] Something[^1080] Something[^1081] Something[^1082] Something[^1083] Something[^1084] Something[^1085] Something[^1086] Something[^1087] Something[^1088] Something[^1089] Something[^1090] Something[^1091] Something[^1092] Something[^1093] Something[^1094] Something[^1095] Something[^1096] Something[^1097] Something[^1098] Something[^1099] Something[^1100] Something[^1101] Something[^1102] Something[^1103] Something[^1104] Something[^1105] Something[^1106] Something[^1107] Something[^1108] Something[^1109] Something[^1110] Something[^1111] Something[^1112] Something[^1113] Something[^1114] Something[^1115] Something[^1116] Something[^1117] Something[^1118] Something[^1119] Something[^1120] Something[^1121] Something[^1122] Something[^1123] Something[^1124] Something[^1125] Something[^1126] Something[^1127] Something[^1128] Something[^1129] Something[^1130] Something[^1131] Something[^1132] Something[^1133] Something[^1134] Something[^1135] Something[^1136] Something[^1137] Something[^1138] Something[^1139] Something[^1140] Something[^1141] Something[^1142] Something[^1143] Something[^1144] Something[^1145] Something[^1146] Something[^1147] Something[^1148] Something[^1149] Something[^1150] Something[^1151] Something[^1152] Something[^1153] Something[^1154] Something[^1155] Something[^1156] Something[^1157] Something[^1158] Something[^1159] Something[^1160] Something[^1161] Something[^1162] Something[^1163] Something[^1164] Something[^1165] Something[^1166] Something[^1167] Something[^1168] Something[^1169] Something[^1170] Something[^1171] Something[^1172] Something[^1173] Something[^1174] Something[^1175] Something[^1176] Something[^1177] Something[^1178] Something[^1179] Something[^1180] Something[^1181] Something[^1182] Something[^1183] Something[^1184] Something[^1185] Something[^1186] Something[^1187] Something[^1188] Something[^1189] Something[^1190] Something[^1191] Something[^1192] Something[^1193] Something[^1194] Something[^1195] Something[^1196] Something[^1197] Something[^1198] Something[^1199] [^1]: Another thing [^2]: Another thing [^3]: Another thing [^4]: Another thing [^5]: Another thing [^6]: Another thing [^7]: Another thing [^8]: Another thing [^9]: Another thing [^10]: Another thing [^11]: Another thing [^12]: Another thing [^13]: Another thing [^14]: Another thing [^15]: Another thing [^16]: Another thing [^17]: Another thing [^18]: Another thing [^19]: Another thing [^20]: Another thing [^21]: Another thing [^22]: Another thing [^23]: Another thing [^24]: Another thing [^25]: Another thing [^26]: Another thing [^27]: Another thing [^28]: Another thing [^29]: Another thing [^30]: Another thing [^31]: Another thing [^32]: Another thing [^33]: Another thing [^34]: Another thing [^35]: Another thing [^36]: Another thing [^37]: Another thing [^38]: Another thing [^39]: Another thing [^40]: Another thing [^41]: Another thing [^42]: Another thing [^43]: Another thing [^44]: Another thing [^45]: Another thing [^46]: Another thing [^47]: Another thing [^48]: Another thing [^49]: Another thing [^50]: Another thing [^51]: Another thing [^52]: Another thing [^53]: Another thing [^54]: Another thing [^55]: Another thing [^56]: Another thing [^57]: Another thing [^58]: Another thing [^59]: Another thing [^60]: Another thing [^61]: Another thing [^62]: Another thing [^63]: Another thing [^64]: Another thing [^65]: Another thing [^66]: Another thing [^67]: Another thing [^68]: Another thing [^69]: Another thing [^70]: Another thing [^71]: Another thing [^72]: Another thing [^73]: Another thing [^74]: Another thing [^75]: Another thing [^76]: Another thing [^77]: Another thing [^78]: Another thing [^79]: Another thing [^80]: Another thing [^81]: Another thing [^82]: Another thing [^83]: Another thing [^84]: Another thing [^85]: Another thing [^86]: Another thing [^87]: Another thing [^88]: Another thing [^89]: Another thing [^90]: Another thing [^91]: Another thing [^92]: Another thing [^93]: Another thing [^94]: Another thing [^95]: Another thing [^96]: Another thing [^97]: Another thing [^98]: Another thing [^99]: Another thing [^100]: Another thing [^101]: Another thing [^102]: Another thing [^103]: Another thing [^104]: Another thing [^105]: Another thing [^106]: Another thing [^107]: Another thing [^108]: Another thing [^109]: Another thing [^110]: Another thing [^111]: Another thing [^112]: Another thing [^113]: Another thing [^114]: Another thing [^115]: Another thing [^116]: Another thing [^117]: Another thing [^118]: Another thing [^119]: Another thing [^120]: Another thing [^121]: Another thing [^122]: Another thing [^123]: Another thing [^124]: Another thing [^125]: Another thing [^126]: Another thing [^127]: Another thing [^128]: Another thing [^129]: Another thing [^130]: Another thing [^131]: Another thing [^132]: Another thing [^133]: Another thing [^134]: Another thing [^135]: Another thing [^136]: Another thing [^137]: Another thing [^138]: Another thing [^139]: Another thing [^140]: Another thing [^141]: Another thing [^142]: Another thing [^143]: Another thing [^144]: Another thing [^145]: Another thing [^146]: Another thing [^147]: Another thing [^148]: Another thing [^149]: Another thing [^150]: Another thing [^151]: Another thing [^152]: Another thing [^153]: Another thing [^154]: Another thing [^155]: Another thing [^156]: Another thing [^157]: Another thing [^158]: Another thing [^159]: Another thing [^160]: Another thing [^161]: Another thing [^162]: Another thing [^163]: Another thing [^164]: Another thing [^165]: Another thing [^166]: Another thing [^167]: Another thing [^168]: Another thing [^169]: Another thing [^170]: Another thing [^171]: Another thing [^172]: Another thing [^173]: Another thing [^174]: Another thing [^175]: Another thing [^176]: Another thing [^177]: Another thing [^178]: Another thing [^179]: Another thing [^180]: Another thing [^181]: Another thing [^182]: Another thing [^183]: Another thing [^184]: Another thing [^185]: Another thing [^186]: Another thing [^187]: Another thing [^188]: Another thing [^189]: Another thing [^190]: Another thing [^191]: Another thing [^192]: Another thing [^193]: Another thing [^194]: Another thing [^195]: Another thing [^196]: Another thing [^197]: Another thing [^198]: Another thing [^199]: Another thing [^200]: Another thing [^201]: Another thing [^202]: Another thing [^203]: Another thing [^204]: Another thing [^205]: Another thing [^206]: Another thing [^207]: Another thing [^208]: Another thing [^209]: Another thing [^210]: Another thing [^211]: Another thing [^212]: Another thing [^213]: Another thing [^214]: Another thing [^215]: Another thing [^216]: Another thing [^217]: Another thing [^218]: Another thing [^219]: Another thing [^220]: Another thing [^221]: Another thing [^222]: Another thing [^223]: Another thing [^224]: Another thing [^225]: Another thing [^226]: Another thing [^227]: Another thing [^228]: Another thing [^229]: Another thing [^230]: Another thing [^231]: Another thing [^232]: Another thing [^233]: Another thing [^234]: Another thing [^235]: Another thing [^236]: Another thing [^237]: Another thing [^238]: Another thing [^239]: Another thing [^240]: Another thing [^241]: Another thing [^242]: Another thing [^243]: Another thing [^244]: Another thing [^245]: Another thing [^246]: Another thing [^247]: Another thing [^248]: Another thing [^249]: Another thing [^250]: Another thing [^251]: Another thing [^252]: Another thing [^253]: Another thing [^254]: Another thing [^255]: Another thing [^256]: Another thing [^257]: Another thing [^258]: Another thing [^259]: Another thing [^260]: Another thing [^261]: Another thing [^262]: Another thing [^263]: Another thing [^264]: Another thing [^265]: Another thing [^266]: Another thing [^267]: Another thing [^268]: Another thing [^269]: Another thing [^270]: Another thing [^271]: Another thing [^272]: Another thing [^273]: Another thing [^274]: Another thing [^275]: Another thing [^276]: Another thing [^277]: Another thing [^278]: Another thing [^279]: Another thing [^280]: Another thing [^281]: Another thing [^282]: Another thing [^283]: Another thing [^284]: Another thing [^285]: Another thing [^286]: Another thing [^287]: Another thing [^288]: Another thing [^289]: Another thing [^290]: Another thing [^291]: Another thing [^292]: Another thing [^293]: Another thing [^294]: Another thing [^295]: Another thing [^296]: Another thing [^297]: Another thing [^298]: Another thing [^299]: Another thing [^300]: Another thing [^301]: Another thing [^302]: Another thing [^303]: Another thing [^304]: Another thing [^305]: Another thing [^306]: Another thing [^307]: Another thing [^308]: Another thing [^309]: Another thing [^310]: Another thing [^311]: Another thing [^312]: Another thing [^313]: Another thing [^314]: Another thing [^315]: Another thing [^316]: Another thing [^317]: Another thing [^318]: Another thing [^319]: Another thing [^320]: Another thing [^321]: Another thing [^322]: Another thing [^323]: Another thing [^324]: Another thing [^325]: Another thing [^326]: Another thing [^327]: Another thing [^328]: Another thing [^329]: Another thing [^330]: Another thing [^331]: Another thing [^332]: Another thing [^333]: Another thing [^334]: Another thing [^335]: Another thing [^336]: Another thing [^337]: Another thing [^338]: Another thing [^339]: Another thing [^340]: Another thing [^341]: Another thing [^342]: Another thing [^343]: Another thing [^344]: Another thing [^345]: Another thing [^346]: Another thing [^347]: Another thing [^348]: Another thing [^349]: Another thing [^350]: Another thing [^351]: Another thing [^352]: Another thing [^353]: Another thing [^354]: Another thing [^355]: Another thing [^356]: Another thing [^357]: Another thing [^358]: Another thing [^359]: Another thing [^360]: Another thing [^361]: Another thing [^362]: Another thing [^363]: Another thing [^364]: Another thing [^365]: Another thing [^366]: Another thing [^367]: Another thing [^368]: Another thing [^369]: Another thing [^370]: Another thing [^371]: Another thing [^372]: Another thing [^373]: Another thing [^374]: Another thing [^375]: Another thing [^376]: Another thing [^377]: Another thing [^378]: Another thing [^379]: Another thing [^380]: Another thing [^381]: Another thing [^382]: Another thing [^383]: Another thing [^384]: Another thing [^385]: Another thing [^386]: Another thing [^387]: Another thing [^388]: Another thing [^389]: Another thing [^390]: Another thing [^391]: Another thing [^392]: Another thing [^393]: Another thing [^394]: Another thing [^395]: Another thing [^396]: Another thing [^397]: Another thing [^398]: Another thing [^399]: Another thing [^400]: Another thing [^401]: Another thing [^402]: Another thing [^403]: Another thing [^404]: Another thing [^405]: Another thing [^406]: Another thing [^407]: Another thing [^408]: Another thing [^409]: Another thing [^410]: Another thing [^411]: Another thing [^412]: Another thing [^413]: Another thing [^414]: Another thing [^415]: Another thing [^416]: Another thing [^417]: Another thing [^418]: Another thing [^419]: Another thing [^420]: Another thing [^421]: Another thing [^422]: Another thing [^423]: Another thing [^424]: Another thing [^425]: Another thing [^426]: Another thing [^427]: Another thing [^428]: Another thing [^429]: Another thing [^430]: Another thing [^431]: Another thing [^432]: Another thing [^433]: Another thing [^434]: Another thing [^435]: Another thing [^436]: Another thing [^437]: Another thing [^438]: Another thing [^439]: Another thing [^440]: Another thing [^441]: Another thing [^442]: Another thing [^443]: Another thing [^444]: Another thing [^445]: Another thing [^446]: Another thing [^447]: Another thing [^448]: Another thing [^449]: Another thing [^450]: Another thing [^451]: Another thing [^452]: Another thing [^453]: Another thing [^454]: Another thing [^455]: Another thing [^456]: Another thing [^457]: Another thing [^458]: Another thing [^459]: Another thing [^460]: Another thing [^461]: Another thing [^462]: Another thing [^463]: Another thing [^464]: Another thing [^465]: Another thing [^466]: Another thing [^467]: Another thing [^468]: Another thing [^469]: Another thing [^470]: Another thing [^471]: Another thing [^472]: Another thing [^473]: Another thing [^474]: Another thing [^475]: Another thing [^476]: Another thing [^477]: Another thing [^478]: Another thing [^479]: Another thing [^480]: Another thing [^481]: Another thing [^482]: Another thing [^483]: Another thing [^484]: Another thing [^485]: Another thing [^486]: Another thing [^487]: Another thing [^488]: Another thing [^489]: Another thing [^490]: Another thing [^491]: Another thing [^492]: Another thing [^493]: Another thing [^494]: Another thing [^495]: Another thing [^496]: Another thing [^497]: Another thing [^498]: Another thing [^499]: Another thing [^500]: Another thing [^501]: Another thing [^502]: Another thing [^503]: Another thing [^504]: Another thing [^505]: Another thing [^506]: Another thing [^507]: Another thing [^508]: Another thing [^509]: Another thing [^510]: Another thing [^511]: Another thing [^512]: Another thing [^513]: Another thing [^514]: Another thing [^515]: Another thing [^516]: Another thing [^517]: Another thing [^518]: Another thing [^519]: Another thing [^520]: Another thing [^521]: Another thing [^522]: Another thing [^523]: Another thing [^524]: Another thing [^525]: Another thing [^526]: Another thing [^527]: Another thing [^528]: Another thing [^529]: Another thing [^530]: Another thing [^531]: Another thing [^532]: Another thing [^533]: Another thing [^534]: Another thing [^535]: Another thing [^536]: Another thing [^537]: Another thing [^538]: Another thing [^539]: Another thing [^540]: Another thing [^541]: Another thing [^542]: Another thing [^543]: Another thing [^544]: Another thing [^545]: Another thing [^546]: Another thing [^547]: Another thing [^548]: Another thing [^549]: Another thing [^550]: Another thing [^551]: Another thing [^552]: Another thing [^553]: Another thing [^554]: Another thing [^555]: Another thing [^556]: Another thing [^557]: Another thing [^558]: Another thing [^559]: Another thing [^560]: Another thing [^561]: Another thing [^562]: Another thing [^563]: Another thing [^564]: Another thing [^565]: Another thing [^566]: Another thing [^567]: Another thing [^568]: Another thing [^569]: Another thing [^570]: Another thing [^571]: Another thing [^572]: Another thing [^573]: Another thing [^574]: Another thing [^575]: Another thing [^576]: Another thing [^577]: Another thing [^578]: Another thing [^579]: Another thing [^580]: Another thing [^581]: Another thing [^582]: Another thing [^583]: Another thing [^584]: Another thing [^585]: Another thing [^586]: Another thing [^587]: Another thing [^588]: Another thing [^589]: Another thing [^590]: Another thing [^591]: Another thing [^592]: Another thing [^593]: Another thing [^594]: Another thing [^595]: Another thing [^596]: Another thing [^597]: Another thing [^598]: Another thing [^599]: Another thing [^600]: Another thing [^601]: Another thing [^602]: Another thing [^603]: Another thing [^604]: Another thing [^605]: Another thing [^606]: Another thing [^607]: Another thing [^608]: Another thing [^609]: Another thing [^610]: Another thing [^611]: Another thing [^612]: Another thing [^613]: Another thing [^614]: Another thing [^615]: Another thing [^616]: Another thing [^617]: Another thing [^618]: Another thing [^619]: Another thing [^620]: Another thing [^621]: Another thing [^622]: Another thing [^623]: Another thing [^624]: Another thing [^625]: Another thing [^626]: Another thing [^627]: Another thing [^628]: Another thing [^629]: Another thing [^630]: Another thing [^631]: Another thing [^632]: Another thing [^633]: Another thing [^634]: Another thing [^635]: Another thing [^636]: Another thing [^637]: Another thing [^638]: Another thing [^639]: Another thing [^640]: Another thing [^641]: Another thing [^642]: Another thing [^643]: Another thing [^644]: Another thing [^645]: Another thing [^646]: Another thing [^647]: Another thing [^648]: Another thing [^649]: Another thing [^650]: Another thing [^651]: Another thing [^652]: Another thing [^653]: Another thing [^654]: Another thing [^655]: Another thing [^656]: Another thing [^657]: Another thing [^658]: Another thing [^659]: Another thing [^660]: Another thing [^661]: Another thing [^662]: Another thing [^663]: Another thing [^664]: Another thing [^665]: Another thing [^666]: Another thing [^667]: Another thing [^668]: Another thing [^669]: Another thing [^670]: Another thing [^671]: Another thing [^672]: Another thing [^673]: Another thing [^674]: Another thing [^675]: Another thing [^676]: Another thing [^677]: Another thing [^678]: Another thing [^679]: Another thing [^680]: Another thing [^681]: Another thing [^682]: Another thing [^683]: Another thing [^684]: Another thing [^685]: Another thing [^686]: Another thing [^687]: Another thing [^688]: Another thing [^689]: Another thing [^690]: Another thing [^691]: Another thing [^692]: Another thing [^693]: Another thing [^694]: Another thing [^695]: Another thing [^696]: Another thing [^697]: Another thing [^698]: Another thing [^699]: Another thing [^700]: Another thing [^701]: Another thing [^702]: Another thing [^703]: Another thing [^704]: Another thing [^705]: Another thing [^706]: Another thing [^707]: Another thing [^708]: Another thing [^709]: Another thing [^710]: Another thing [^711]: Another thing [^712]: Another thing [^713]: Another thing [^714]: Another thing [^715]: Another thing [^716]: Another thing [^717]: Another thing [^718]: Another thing [^719]: Another thing [^720]: Another thing [^721]: Another thing [^722]: Another thing [^723]: Another thing [^724]: Another thing [^725]: Another thing [^726]: Another thing [^727]: Another thing [^728]: Another thing [^729]: Another thing [^730]: Another thing [^731]: Another thing [^732]: Another thing [^733]: Another thing [^734]: Another thing [^735]: Another thing [^736]: Another thing [^737]: Another thing [^738]: Another thing [^739]: Another thing [^740]: Another thing [^741]: Another thing [^742]: Another thing [^743]: Another thing [^744]: Another thing [^745]: Another thing [^746]: Another thing [^747]: Another thing [^748]: Another thing [^749]: Another thing [^750]: Another thing [^751]: Another thing [^752]: Another thing [^753]: Another thing [^754]: Another thing [^755]: Another thing [^756]: Another thing [^757]: Another thing [^758]: Another thing [^759]: Another thing [^760]: Another thing [^761]: Another thing [^762]: Another thing [^763]: Another thing [^764]: Another thing [^765]: Another thing [^766]: Another thing [^767]: Another thing [^768]: Another thing [^769]: Another thing [^770]: Another thing [^771]: Another thing [^772]: Another thing [^773]: Another thing [^774]: Another thing [^775]: Another thing [^776]: Another thing [^777]: Another thing [^778]: Another thing [^779]: Another thing [^780]: Another thing [^781]: Another thing [^782]: Another thing [^783]: Another thing [^784]: Another thing [^785]: Another thing [^786]: Another thing [^787]: Another thing [^788]: Another thing [^789]: Another thing [^790]: Another thing [^791]: Another thing [^792]: Another thing [^793]: Another thing [^794]: Another thing [^795]: Another thing [^796]: Another thing [^797]: Another thing [^798]: Another thing [^799]: Another thing [^800]: Another thing [^801]: Another thing [^802]: Another thing [^803]: Another thing [^804]: Another thing [^805]: Another thing [^806]: Another thing [^807]: Another thing [^808]: Another thing [^809]: Another thing [^810]: Another thing [^811]: Another thing [^812]: Another thing [^813]: Another thing [^814]: Another thing [^815]: Another thing [^816]: Another thing [^817]: Another thing [^818]: Another thing [^819]: Another thing [^820]: Another thing [^821]: Another thing [^822]: Another thing [^823]: Another thing [^824]: Another thing [^825]: Another thing [^826]: Another thing [^827]: Another thing [^828]: Another thing [^829]: Another thing [^830]: Another thing [^831]: Another thing [^832]: Another thing [^833]: Another thing [^834]: Another thing [^835]: Another thing [^836]: Another thing [^837]: Another thing [^838]: Another thing [^839]: Another thing [^840]: Another thing [^841]: Another thing [^842]: Another thing [^843]: Another thing [^844]: Another thing [^845]: Another thing [^846]: Another thing [^847]: Another thing [^848]: Another thing [^849]: Another thing [^850]: Another thing [^851]: Another thing [^852]: Another thing [^853]: Another thing [^854]: Another thing [^855]: Another thing [^856]: Another thing [^857]: Another thing [^858]: Another thing [^859]: Another thing [^860]: Another thing [^861]: Another thing [^862]: Another thing [^863]: Another thing [^864]: Another thing [^865]: Another thing [^866]: Another thing [^867]: Another thing [^868]: Another thing [^869]: Another thing [^870]: Another thing [^871]: Another thing [^872]: Another thing [^873]: Another thing [^874]: Another thing [^875]: Another thing [^876]: Another thing [^877]: Another thing [^878]: Another thing [^879]: Another thing [^880]: Another thing [^881]: Another thing [^882]: Another thing [^883]: Another thing [^884]: Another thing [^885]: Another thing [^886]: Another thing [^887]: Another thing [^888]: Another thing [^889]: Another thing [^890]: Another thing [^891]: Another thing [^892]: Another thing [^893]: Another thing [^894]: Another thing [^895]: Another thing [^896]: Another thing [^897]: Another thing [^898]: Another thing [^899]: Another thing [^900]: Another thing [^901]: Another thing [^902]: Another thing [^903]: Another thing [^904]: Another thing [^905]: Another thing [^906]: Another thing [^907]: Another thing [^908]: Another thing [^909]: Another thing [^910]: Another thing [^911]: Another thing [^912]: Another thing [^913]: Another thing [^914]: Another thing [^915]: Another thing [^916]: Another thing [^917]: Another thing [^918]: Another thing [^919]: Another thing [^920]: Another thing [^921]: Another thing [^922]: Another thing [^923]: Another thing [^924]: Another thing [^925]: Another thing [^926]: Another thing [^927]: Another thing [^928]: Another thing [^929]: Another thing [^930]: Another thing [^931]: Another thing [^932]: Another thing [^933]: Another thing [^934]: Another thing [^935]: Another thing [^936]: Another thing [^937]: Another thing [^938]: Another thing [^939]: Another thing [^940]: Another thing [^941]: Another thing [^942]: Another thing [^943]: Another thing [^944]: Another thing [^945]: Another thing [^946]: Another thing [^947]: Another thing [^948]: Another thing [^949]: Another thing [^950]: Another thing [^951]: Another thing [^952]: Another thing [^953]: Another thing [^954]: Another thing [^955]: Another thing [^956]: Another thing [^957]: Another thing [^958]: Another thing [^959]: Another thing [^960]: Another thing [^961]: Another thing [^962]: Another thing [^963]: Another thing [^964]: Another thing [^965]: Another thing [^966]: Another thing [^967]: Another thing [^968]: Another thing [^969]: Another thing [^970]: Another thing [^971]: Another thing [^972]: Another thing [^973]: Another thing [^974]: Another thing [^975]: Another thing [^976]: Another thing [^977]: Another thing [^978]: Another thing [^979]: Another thing [^980]: Another thing [^981]: Another thing [^982]: Another thing [^983]: Another thing [^984]: Another thing [^985]: Another thing [^986]: Another thing [^987]: Another thing [^988]: Another thing [^989]: Another thing [^990]: Another thing [^991]: Another thing [^992]: Another thing [^993]: Another thing [^994]: Another thing [^995]: Another thing [^996]: Another thing [^997]: Another thing [^998]: Another thing [^999]: Another thing [^1000]: Another thing [^1001]: Another thing [^1002]: Another thing [^1003]: Another thing [^1004]: Another thing [^1005]: Another thing [^1006]: Another thing [^1007]: Another thing [^1008]: Another thing [^1009]: Another thing [^1010]: Another thing [^1011]: Another thing [^1012]: Another thing [^1013]: Another thing [^1014]: Another thing [^1015]: Another thing [^1016]: Another thing [^1017]: Another thing [^1018]: Another thing [^1019]: Another thing [^1020]: Another thing [^1021]: Another thing [^1022]: Another thing [^1023]: Another thing [^1024]: Another thing [^1025]: Another thing [^1026]: Another thing [^1027]: Another thing [^1028]: Another thing [^1029]: Another thing [^1030]: Another thing [^1031]: Another thing [^1032]: Another thing [^1033]: Another thing [^1034]: Another thing [^1035]: Another thing [^1036]: Another thing [^1037]: Another thing [^1038]: Another thing [^1039]: Another thing [^1040]: Another thing [^1041]: Another thing [^1042]: Another thing [^1043]: Another thing [^1044]: Another thing [^1045]: Another thing [^1046]: Another thing [^1047]: Another thing [^1048]: Another thing [^1049]: Another thing [^1050]: Another thing [^1051]: Another thing [^1052]: Another thing [^1053]: Another thing [^1054]: Another thing [^1055]: Another thing [^1056]: Another thing [^1057]: Another thing [^1058]: Another thing [^1059]: Another thing [^1060]: Another thing [^1061]: Another thing [^1062]: Another thing [^1063]: Another thing [^1064]: Another thing [^1065]: Another thing [^1066]: Another thing [^1067]: Another thing [^1068]: Another thing [^1069]: Another thing [^1070]: Another thing [^1071]: Another thing [^1072]: Another thing [^1073]: Another thing [^1074]: Another thing [^1075]: Another thing [^1076]: Another thing [^1077]: Another thing [^1078]: Another thing [^1079]: Another thing [^1080]: Another thing [^1081]: Another thing [^1082]: Another thing [^1083]: Another thing [^1084]: Another thing [^1085]: Another thing [^1086]: Another thing [^1087]: Another thing [^1088]: Another thing [^1089]: Another thing [^1090]: Another thing [^1091]: Another thing [^1092]: Another thing [^1093]: Another thing [^1094]: Another thing [^1095]: Another thing [^1096]: Another thing [^1097]: Another thing [^1098]: Another thing [^1099]: Another thing [^1100]: Another thing [^1101]: Another thing [^1102]: Another thing [^1103]: Another thing [^1104]: Another thing [^1105]: Another thing [^1106]: Another thing [^1107]: Another thing [^1108]: Another thing [^1109]: Another thing [^1110]: Another thing [^1111]: Another thing [^1112]: Another thing [^1113]: Another thing [^1114]: Another thing [^1115]: Another thing [^1116]: Another thing [^1117]: Another thing [^1118]: Another thing [^1119]: Another thing [^1120]: Another thing [^1121]: Another thing [^1122]: Another thing [^1123]: Another thing [^1124]: Another thing [^1125]: Another thing [^1126]: Another thing [^1127]: Another thing [^1128]: Another thing [^1129]: Another thing [^1130]: Another thing [^1131]: Another thing [^1132]: Another thing [^1133]: Another thing [^1134]: Another thing [^1135]: Another thing [^1136]: Another thing [^1137]: Another thing [^1138]: Another thing [^1139]: Another thing [^1140]: Another thing [^1141]: Another thing [^1142]: Another thing [^1143]: Another thing [^1144]: Another thing [^1145]: Another thing [^1146]: Another thing [^1147]: Another thing [^1148]: Another thing [^1149]: Another thing [^1150]: Another thing [^1151]: Another thing [^1152]: Another thing [^1153]: Another thing [^1154]: Another thing [^1155]: Another thing [^1156]: Another thing [^1157]: Another thing [^1158]: Another thing [^1159]: Another thing [^1160]: Another thing [^1161]: Another thing [^1162]: Another thing [^1163]: Another thing [^1164]: Another thing [^1165]: Another thing [^1166]: Another thing [^1167]: Another thing [^1168]: Another thing [^1169]: Another thing [^1170]: Another thing [^1171]: Another thing [^1172]: Another thing [^1173]: Another thing [^1174]: Another thing [^1175]: Another thing [^1176]: Another thing [^1177]: Another thing [^1178]: Another thing [^1179]: Another thing [^1180]: Another thing [^1181]: Another thing [^1182]: Another thing [^1183]: Another thing [^1184]: Another thing [^1185]: Another thing [^1186]: Another thing [^1187]: Another thing [^1188]: Another thing [^1189]: Another thing [^1190]: Another thing [^1191]: Another thing [^1192]: Another thing [^1193]: Another thing [^1194]: Another thing [^1195]: Another thing [^1196]: Another thing [^1197]: Another thing [^1198]: Another thing [^1199]: Another thing Markdown-3.1.1/tests/extensions/extra/footnote_placeholder.html0000644000076500000240000000044413432642364025476 0ustar waylanstaff00000000000000

  1. A Footnote. 

Some text with a footnote1.

Markdown-3.1.1/tests/extensions/extra/footnote_placeholder.txt0000644000076500000240000000011313212354257025337 0ustar waylanstaff00000000000000///Footnotes Go Here/// Some text with a footnote[^1]. [^1]: A Footnote. Markdown-3.1.1/tests/extensions/extra/footnote_placeholder_depth.html0000644000076500000240000000053213432642364026660 0ustar waylanstaff00000000000000

  1. A Footnote. 

Some text with a footnote1.

Markdown-3.1.1/tests/extensions/extra/footnote_placeholder_depth.txt0000644000076500000240000000012313212354257026524 0ustar waylanstaff00000000000000>> ///Footnotes Go Here/// >> >> Some text with a footnote[^1]. [^1]: A Footnote. Markdown-3.1.1/tests/extensions/extra/loose_def_list.html0000644000076500000240000000055313212354257024267 0ustar waylanstaff00000000000000

some text

term 1

def 1-1

def 2-2

term 2
term 3

def 2-1 line 2 of def 2-1

def 2-2

par 2 of def2-2

more text

term 4
not loose
term 5

loose

term 6
also not loose
Markdown-3.1.1/tests/extensions/extra/loose_def_list.txt0000644000076500000240000000032113212354257024133 0ustar waylanstaff00000000000000some text term 1 : def 1-1 : def 2-2 term 2 term 3 : def 2-1 line 2 of def 2-1 : def 2-2 par 2 of def2-2 more text term 4 : not loose term 5 : loose term 6 : also not loose Markdown-3.1.1/tests/extensions/extra/markdown-syntax.html0000644000076500000240000007554713226455362024466 0ustar waylanstaff00000000000000

Markdown: Syntax

Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


Overview

Philosophy

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, atx, Textile, reStructuredText, Grutatext, and EtText -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email.

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.

Inline HTML

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.

Automatic Escaping for Special Characters

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, 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.)


Block Elements

Paragraphs and Line Breaks

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 intended 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 and multi-paragraph list items work best -- and look better -- when you format them with hard breaks.

Markdown supports two styles of headers, Setext and atx.

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 ######

Blockquotes

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.

Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists.

Unordered lists use asterisks, pluses, and hyphens -- interchangeably -- 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 intended 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.

Code Blocks

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.

Horizontal Rules

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:

* * *

***

*****

- - -

---------------------------------------

_ _ _

Span Elements

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.

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 constist 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.

Emphasis

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*fucking*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\*

Code

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>

Images

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.


Miscellaneous

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.)

Backslash Escapes

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 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
Markdown-3.1.1/tests/extensions/extra/markdown-syntax.txt0000644000076500000240000006545013226455362024331 0ustar waylanstaff00000000000000Markdown: Syntax ================ * [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 * * *

Overview

Philosophy

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.

Inline HTML

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. `
`, ``, `
`, `

`, 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) `

` tags around HTML block-level tags. For example, to add an HTML table to a Markdown article: This is a regular paragraph.

Foo
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. ``, ``, or `` -- 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 `` or `` 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.

Automatic Escaping for Special Characters

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. `<`, and `&`. Ampersands in particular are bedeviling for web writers. If you want to write about 'AT&T', you need to write '`AT&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&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 `&`. So, if you want to include a copyright symbol in your article, you can write: © and Markdown will leave it alone. But if you write: AT&T Markdown will translate it to: AT&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 < 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.) * * *

Block Elements

Paragraphs and Line Breaks

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 intended 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 `
` tag. When you *do* want to insert a `
` 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 `
`, but a simplistic "every line break is a `
`" 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 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 ######

Blockquotes

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.

Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists. Unordered lists use asterisks, pluses, and hyphens -- interchangeably -- 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:
  1. Bird
  2. McHale
  3. Parish
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 `

` tags in the HTML output. For example, this input: * Bird * Magic will turn into:

  • Bird
  • Magic
But this: * Bird * Magic will turn into:
  • Bird

  • Magic

List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be intended 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: 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.

Code Blocks

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 `
` and `` 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:

    

This is a normal paragraph:

This is a code block.
    
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:

Here is an example of AppleScript:

tell application "Foo"
        beep
    end tell
    
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: will turn into:
<div class="footer">
        &copy; 2004 Foo Corporation
    </div>
    
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.

Horizontal Rules

You can produce a horizontal rule tag (`
`) 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: * * * *** ***** - - - --------------------------------------- _ _ _ * * *

Span Elements

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:

This is an example inline link.

This link has no title attribute.

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. The link URL may, optionally, be surrounded by angle brackets: [id]: "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 constist 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:

I get 10 times more traffic from Google than from Yahoo or MSN.

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.

Emphasis

Markdown treats asterisks (`*`) and underscores (`_`) as indicators of emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML `` tag. E.g., this input: *single asterisks* _single underscores_ **double asterisks** __double underscores__ will produce: single asterisks single underscores double asterisks double underscores 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*fucking*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\*

Code

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:

Use the printf() function.

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:

There is a literal backtick (`) here.

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:

A single backtick in a code span: `

A backtick-delimited string in a code span: `foo`

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 `` tags. into:

Please don't use any <blink> tags.

You can write this: `—` is the decimal-encoded equivalent of `—`. to produce:

&#8212; is the decimal-encoded equivalent of &mdash;.

Images

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 `` tags. * * *

Miscellaneous

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: Markdown will turn this into: http://example.com/ 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: into something like this: address@exa mple.com 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.)

Backslash Escapes

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 `` tag), you can 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 Markdown-3.1.1/tests/extensions/extra/named_markers.html0000644000076500000240000000207013432642364024104 0ustar waylanstaff00000000000000

This is the body with footnotes1 that have named2 markers and oddly3 numbered4 markers.


  1. Footnote marked foo

  2. This one is marked bar

  3. A numbered footnote. 

  4. The last one. 

Markdown-3.1.1/tests/extensions/extra/named_markers.txt0000644000076500000240000000034713212354257023761 0ustar waylanstaff00000000000000This is the body with footnotes[^foo] that have named[^bar] markers and oddly[^56] numbered[^99] markers. [^foo]: Footnote marked ``foo``. [^bar]: This one is marked *bar*. [^56]: A __numbered__ footnote. [^99]: The last one. Markdown-3.1.1/tests/extensions/extra/raw-html.html0000644000076500000240000000663513432642364023042 0ustar waylanstaff00000000000000

foo

bar

blah

The text of the Example element.

This text gets wrapped in p tags.

The tail of the DefaultBlockMode subelement.

This text is not wrapped in additional p tags.

The tail of the DefaultSpanMode subelement.

This div block is not wrapped in paragraph tags. Note: Subelements are not required to have tail text.

This p block is foolishly wrapped in further paragraph tags.

The tail of the BlockModeOverride subelement.

Raw html blocks may also be nested.

This text is after the markdown in html.

1 2

Markdown is active here.

Raw html blocks may also be nested.

Markdown is still active here.

Markdown is active again here.

foo bar

bar

abbr

footnote1

abbr

footnote2


    1. The top couple half figure, contrary sides and hands across with bottom couple,

      Half figure back on your own sides, and turn partner to places,

      Swing partners with right hands into straight line long-ways, as in a reel, and

      Set,

      Hey and return to places,

      The other three couples do the same.

    2. Top and bottom couples meet and set,

      Then each gentleman leas the opposite lady to the couple on his left, and set,

      Aach four right and left,

      Swing side couples to places, and turn partners all eight,

      The other two couple o the same.

    1. The top couple half figure, contrary sides and hands across with bottom couple,

      Half figure back on your own sides, and turn partner to places,

      Swing partners with right hands into straight line long-ways, as in a reel, and

      Set,

      Hey and return to places,

      The other three couples do the same.

    2. Top and bottom couples meet and set,

      Then each gentleman leas the opposite lady to the couple on his left, and set,

      Aach four right and left,

      Swing side couples to places, and turn partners all eight,

      The other two couple o the same.

Markdown-3.1.1/tests/extensions/extra/raw-html.txt0000644000076500000240000000601613223544651022704 0ustar waylanstaff00000000000000
_foo_
_bar_
_blah_
The text of the `Example` element.
This text gets wrapped in `p` tags.
The tail of the `DefaultBlockMode` subelement.

This text *is not* wrapped in additional `p` tags.

The tail of the `DefaultSpanMode` subelement.
This `div` block is not wrapped in paragraph tags. Note: Subelements are not required to have tail text.

This `p` block *is* foolishly wrapped in further paragraph tags.

The tail of the `BlockModeOverride` subelement.
Raw html blocks may also be nested.
This text is after the markdown in html.
1 2
Markdown is *active* here.
Raw html blocks may also be nested.
Markdown is *still* active here.
Markdown is *active again* here.
foo bar bar
[link]: http://example.com
[link][link]
*[abbr]: Abbreviation
abbr
[^1]: 1. The top couple half figure, contrary sides and hands across with bottom couple, Half figure back on your own sides, and turn partner to places, Swing partners with right hands into straight line long-ways, as in a reel, and Set, Hey and return to places, The other three couples do the same. 2. Top and bottom couples meet and set, Then each gentleman leas the opposite lady to the couple on his left, and set, Aach four right and left, Swing side couples to places, and turn partners all eight, The other two couple o the same.
footnote[^1]
[link]: http://example.com
[link][link]
*[abbr]: Abbreviation
abbr
[^2]: 1. The top couple half figure, contrary sides and hands across with bottom couple, Half figure back on your own sides, and turn partner to places, Swing partners with right hands into straight line long-ways, as in a reel, and Set, Hey and return to places, The other three couples do the same. 2. Top and bottom couples meet and set, Then each gentleman leas the opposite lady to the couple on his left, and set, Aach four right and left, Swing side couples to places, and turn partners all eight, The other two couple o the same.
footnote[^2]
Markdown-3.1.1/tests/extensions/extra/simple_def-lists.html0000644000076500000240000000111413212354257024532 0ustar waylanstaff00000000000000

Some text

term1
Def1
term2-1
term2-2
Def2-1
Def2-2

more text

term 3

def 3 line 2 of def 3

paragraph 2 of def 3.

def 3-2

# A code block in a def

a blockquote

  • a list item

  • blockquote in list

and more text.

term 4
def4 line 2 of def 4

final text.

Markdown-3.1.1/tests/extensions/extra/simple_def-lists.txt0000644000076500000240000000050213212354257024405 0ustar waylanstaff00000000000000Some text term1 : Def1 term2-1 term2-2 : Def2-1 : Def2-2 more text term *3* : def 3 line __2__ of def 3 paragraph 2 of def 3. : def 3-2 # A code block in a def > a blockquote * a list item * > blockquote in list and more text. term 4 : def4 line 2 of def 4 final text. Markdown-3.1.1/tests/extensions/extra/tables.html0000644000076500000240000001373113212354257022551 0ustar waylanstaff00000000000000

Table Tests

First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
Item Value
Computer $1600
Phone $12
Pipe $1
Function name Description
help() Display the help window.
destroy() Destroy your computer!
foo bar baz
Q
W W
foo bar baz
Q
W W

Three spaces in front of a table:

First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

Four spaces is a code block:

First Header | Second Header
------------ | -------------
Content Cell | Content Cell
Content Cell | Content Cell
First Header Second Header

More inline code block tests

Column 1 Column 2 Column 3
word 1 word 2 word 3
word 1 word 2 word 3
word 1 `word 2 word 3
word 1 `word 2 word 3
word 1 word |2 word 3
words some | code more words
words some | code more words
words some | code more words
words some ` | ` code more words
words some ` | ` code more words
words some ` | ` code more words

A test for issue #440:

foo bar
foo (bar) and baz.

Lists are not tables

  • this | should | not
  • be | a | table

Add tests for issue #449

Odd backticks Even backticks
[!\"\#$%&'()*+,\-./:;<=>?@\[\\\]^_`{|}~] [!\"\#$%&'()*+,\-./:;<=>?@\[\\\]^`_`{|}~]
Escapes More Escapes
`\ \

Only the first backtick can be escaped

Escaped Bacticks
`\ ``

Test escaped pipes

Column 1 Column 2
| | Pipes are okay in code and escaped. |
Column 1 Column 2
row1 row1 |
row2 row2

Test header escapes

`\ | \ |
row1 row1
row2 row2

Escaped pipes in format row should not be a table

| Column1 | Column2 | | ------- || ------- | | row1 | row1 | | row2 | row2 |

Test escaped code in Table

Should not be code Should be code
`Not code` \code
\`Not code\` \\code

Single column tables

Is a Table
Is a Table
Is a Table
Is a Table
row
Is a Table
row
Is a Table
row

| Is not a Table

| row

Is not a Table |

row |

| Is not a Table | -------------- row

Is not a Table | -------------- | row

Markdown-3.1.1/tests/extensions/extra/tables.txt0000644000076500000240000000623013212354257022420 0ustar waylanstaff00000000000000Table Tests ----------- First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell | First Header | Second Header | | ------------- | ------------- | | Content Cell | Content Cell | | Content Cell | Content Cell | | Item | Value | | :-------- | -----:| | Computer | $1600 | | Phone | $12 | | Pipe | $1 | | Function name | Description | | ------------- | ------------------------------ | | `help()` | Display the help window. | | `destroy()` | **Destroy your computer!** | |foo|bar|baz| |:--|:-:|--:| | | Q | | |W | | W| foo|bar|baz ---|---|--- | Q | W | | W Three spaces in front of a table: First Header | Second Header ------------ | ------------- Content Cell | Content Cell Content Cell | Content Cell | First Header | Second Header | | ------------ | ------------- | | Content Cell | Content Cell | | Content Cell | Content Cell | Four spaces is a code block: First Header | Second Header ------------ | ------------- Content Cell | Content Cell Content Cell | Content Cell | First Header | Second Header | | ------------ | ------------- | More inline code block tests Column 1 | Column 2 | Column 3 ---------|----------|--------- word 1 | word 2 | word 3 word 1 | `word 2` | word 3 word 1 | \`word 2 | word 3 word 1 | `word 2 | word 3 word 1 | `word |2` | word 3 words |`` some | code `` | more words words |``` some | code ``` | more words words |```` some | code ```` | more words words |`` some ` | ` code `` | more words words |``` some ` | ` code ``` | more words words |```` some ` | ` code ```` | more words A test for issue #440: foo | bar --- | --- foo | (`bar`) and `baz`. Lists are not tables - this | should | not - be | a | table Add tests for issue #449 Odd backticks | Even backticks ------------ | ------------- ``[!\"\#$%&'()*+,\-./:;<=>?@\[\\\]^_`{|}~]`` | ``[!\"\#$%&'()*+,\-./:;<=>?@\[\\\]^`_`{|}~]`` Escapes | More Escapes ------- | ------ `` `\`` | `\` Only the first backtick can be escaped Escaped | Bacticks ------- | ------ \`` \` | \`\` Test escaped pipes Column 1 | Column 2 -------- | -------- `|` \| | Pipes are okay in code and escaped. \| | Column 1 | Column 2 | | -------- | -------- | | row1 | row1 \| | row2 | row2 | Test header escapes | `` `\`` \| | `\` \| | ---------- | ---- | | row1 | row1 | | row2 | row2 | Escaped pipes in format row should not be a table | Column1 | Column2 | | ------- \|| ------- | | row1 | row1 | | row2 | row2 | Test escaped code in Table Should not be code | Should be code ------------------ | -------------- \`Not code\` | \\`code` \\\`Not code\\\` | \\\\`code` Single column tables | Is a Table | | ---------- | | Is a Table | ---------- Is a Table | ---------- | | Is a Table | | ---------- | | row | | Is a Table | ---------- | row Is a Table | ---------- | row | | Is not a Table -------------- | row Is not a Table | -------------- row | | Is not a Table | -------------- row Is not a Table | -------------- | row Markdown-3.1.1/tests/extensions/extra/tables_and_attr_list.html0000644000076500000240000000044013212354257025451 0ustar waylanstaff00000000000000
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
Markdown-3.1.1/tests/extensions/extra/tables_and_attr_list.txt0000644000076500000240000000050213212354257025323 0ustar waylanstaff00000000000000First Header | Second Header ------------------------------------------------------ | ------------- Content Cell{: class="foo bar" title="Some title!" } | Content Cell Content Cell | Content Cell{: class="foo bar" title="Some title!" } Markdown-3.1.1/tests/extensions/fenced_code.html0000644000076500000240000000156613212354257022375 0ustar waylanstaff00000000000000

index 0000000..6e956a9

--- /dev/null
+++ b/test/data/stripped_text/mike-30-lili
@@ -0,0 +1,27 @@
+Summary:
+ drift_mod.py |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+commit da4bfb04debdd994683740878d09988b2641513d
+Author: Mike Dirolf <mike@dirolf.com>
+Date:   Tue Jan 17 13:42:28 2012 -0500
+
+```
+minor: just wanted to push something.
+```
+
+diff --git a/drift_mod.py b/drift_mod.py
+index 34dfba6..8a88a69 100644
+
+```
+--- a/drift_mod.py
++++ b/drift_mod.py
+@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^('
+                                        '|\+ .*'
+                                        '|- .*'
+                                        ')$')
++
+ def wrap_context_diffs(message_text):
+     return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN,
+                       CONTEXT_DIFF_LINE_PATTERN,
+```
Markdown-3.1.1/tests/extensions/fenced_code.txt0000644000076500000240000000153213212354257022241 0ustar waylanstaff00000000000000index 0000000..6e956a9 ``` --- /dev/null +++ b/test/data/stripped_text/mike-30-lili @@ -0,0 +1,27 @@ +Summary: + drift_mod.py | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit da4bfb04debdd994683740878d09988b2641513d +Author: Mike Dirolf +Date: Tue Jan 17 13:42:28 2012 -0500 + +``` +minor: just wanted to push something. +``` + +diff --git a/drift_mod.py b/drift_mod.py +index 34dfba6..8a88a69 100644 + +``` +--- a/drift_mod.py ++++ b/drift_mod.py +@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^(' + '|\+ .*' + '|- .*' + ')$') ++ + def wrap_context_diffs(message_text): + return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN, + CONTEXT_DIFF_LINE_PATTERN, +``` ``` Markdown-3.1.1/tests/extensions/github_flavored.html0000644000076500000240000000226213212354257023315 0ustar waylanstaff00000000000000

index 0000000..6e956a9

--- /dev/null
+++ b/test/data/stripped_text/mike-30-lili
@@ -0,0 +1,27 @@
+Summary:
+ drift_mod.py |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+commit da4bfb04debdd994683740878d09988b2641513d
+Author: Mike Dirolf <mike@dirolf.com>
+Date:   Tue Jan 17 13:42:28 2012 -0500
+
+```
+minor: just wanted to push something.
+```
+
+diff --git a/drift_mod.py b/drift_mod.py
+index 34dfba6..8a88a69 100644
+
+```
+--- a/drift_mod.py
++++ b/drift_mod.py
+@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^('
+                                        '|\+ .*'
+                                        '|- .*'
+                                        ')$')
++
+ def wrap_context_diffs(message_text):
+     return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN,
+                       CONTEXT_DIFF_LINE_PATTERN,
+```

Test support for foo+bar lexer names.

<title>{% block title %}{% endblock %}</title>
<ul>
{% for user in users %}
  <li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
</ul>
Markdown-3.1.1/tests/extensions/github_flavored.txt0000644000076500000240000000206313212354257023167 0ustar waylanstaff00000000000000index 0000000..6e956a9 ```diff --- /dev/null +++ b/test/data/stripped_text/mike-30-lili @@ -0,0 +1,27 @@ +Summary: + drift_mod.py | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit da4bfb04debdd994683740878d09988b2641513d +Author: Mike Dirolf +Date: Tue Jan 17 13:42:28 2012 -0500 + +``` +minor: just wanted to push something. +``` + +diff --git a/drift_mod.py b/drift_mod.py +index 34dfba6..8a88a69 100644 + +``` +--- a/drift_mod.py ++++ b/drift_mod.py +@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^(' + '|\+ .*' + '|- .*' + ')$') ++ + def wrap_context_diffs(message_text): + return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN, + CONTEXT_DIFF_LINE_PATTERN, +``` ``` Test support for foo+bar lexer names. ```html+jinja {% block title %}{% endblock %} ``` Markdown-3.1.1/tests/extensions/nl2br_w_attr_list.html0000644000076500000240000000003113212354257023573 0ustar waylanstaff00000000000000

Foo

Markdown-3.1.1/tests/extensions/nl2br_w_attr_list.txt0000644000076500000240000000001413212354257023447 0ustar waylanstaff00000000000000Foo {: #bar}Markdown-3.1.1/tests/extensions/sane_lists.html0000644000076500000240000000063413432642364022321 0ustar waylanstaff00000000000000
  1. Ordered
  2. List
  • Unordered
  • List
  1. Ordered again

Paragraph * not a list item

  1. More ordered * not a list item
  • Unordered again 1. not a list item
  1. Bird
  2. McHale
  3. Parish

Not a list

  1. Bird
  2. McHale
  3. Parish
Markdown-3.1.1/tests/extensions/sane_lists.txt0000644000076500000240000000034413432642364022172 0ustar waylanstaff000000000000001. Ordered 2. List * Unordered * List 1. Ordered again Paragraph * not a list item 1. More ordered * not a list item * Unordered again 1. not a list item 3. Bird 1. McHale 8. Parish Not a list 3. Bird 1. McHale 8. ParishMarkdown-3.1.1/tests/extensions/smarty.html0000644000076500000240000000243213212354257021467 0ustar waylanstaff00000000000000

’.
1440–80’s
1440–’80s
1440—’80s
1960s
1960’s
one two ’60s
’60s

It’s fun. What’s fun?
“Isn’t this fun”? — she said…
“‘Quoted’ words in a larger quote.”
‘Quoted “words” in a larger quote.’
“quoted” text and bold “quoted” text
‘quoted’ text and bold ‘quoted’ text
em-dashes (—) and ellipes (…)
Link” — she said.

“Ellipsis within quotes…”

Кавычки-«ёлочки»
«hello»
Anführungszeichen-»Chevrons«


Escaped -- ndash
'Escaped' "quotes"
Escaped ellipsis...

‘Escaped "quotes" in real ones’
'“Real” quotes in escaped ones'

Skip <<all>> "code" -- --- 'spans' ....

Also skip "code" 'blocks'
foo -- bar --- baz ...

A line that ‘wraps’ with emphasis at the beginning of the next line.

Markdown-3.1.1/tests/extensions/smarty.txt0000644000076500000240000000145413212354257021345 0ustar waylanstaff00000000000000'. 1440--80's 1440--'80s 1440---'80s 1960s 1960's one two '60s '60s It's fun. What's fun? "Isn't this fun"? --- she said... "'Quoted' words in a larger quote." 'Quoted "words" in a larger quote.' "quoted" text and **bold "quoted" text** 'quoted' text and **bold 'quoted' text** em-dashes (---) and ellipes (...) "[Link](http://example.com)" --- she said. "Ellipsis within quotes..." Кавычки-<<ёлочки>> <> Anführungszeichen->>Chevrons<< --- -- --- Escaped \-- ndash \'Escaped\' \"quotes\" Escaped ellipsis\... 'Escaped \"quotes\" in real ones' \'"Real" quotes in escaped ones\' Skip `<> "code" -- --- 'spans' ...`. Also skip "code" 'blocks' foo -- bar --- baz ... A line that 'wraps' with *emphasis* at the beginning of the next line. Markdown-3.1.1/tests/extensions/toc.html0000644000076500000240000007471213226455362020753 0ustar waylanstaff00000000000000

Overview

Philosophy

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, atx, Textile, reStructuredText, Grutatext, and EtText -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email.

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.

Inline HTML

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.

Automatic Escaping for Special Characters

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, 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.)


Block Elements

Paragraphs and Line Breaks

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 intended 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 and multi-paragraph list items work best -- and look better -- when you format them with hard breaks.

Headers

Markdown supports two styles of headers, Setext and atx.

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 ######

Blockquotes

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.

Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists.

Unordered lists use asterisks, pluses, and hyphens -- interchangeably -- 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 intended 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.

Code Blocks

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.

Horizontal Rules

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:

* * *

***

*****

- - -

---------------------------------------

_ _ _

Span Elements

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.

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 constist 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.

Emphasis

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*fucking*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\*

Code

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>

Images

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.


Miscellaneous

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.)

Backslash Escapes

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 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
Markdown-3.1.1/tests/extensions/toc.txt0000644000076500000240000006233413226455362020623 0ustar waylanstaff00000000000000 [TOC] # Overview ## Philosophy 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. ## Inline HTML 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. `
`, ``, `
`, `

`, 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) `

` tags around HTML block-level tags. For example, to add an HTML table to a Markdown article: This is a regular paragraph.

Foo
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. ``, ``, or `` -- 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 `` or `` 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. ## Automatic Escaping for Special Characters 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. `<`, and `&`. Ampersands in particular are bedeviling for web writers. If you want to write about 'AT&T', you need to write '`AT&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&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 `&`. So, if you want to include a copyright symbol in your article, you can write: © and Markdown will leave it alone. But if you write: AT&T Markdown will translate it to: AT&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 < 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.) * * * # Block Elements ## Paragraphs and Line Breaks 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 intended 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 `
` tag. When you *do* want to insert a `
` 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 `
`, but a simplistic "every line break is a `
`" 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 ## Headers 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 ###### ## Blockquotes 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. ## Lists Markdown supports ordered (numbered) and unordered (bulleted) lists. Unordered lists use asterisks, pluses, and hyphens -- interchangeably -- 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:
  1. Bird
  2. McHale
  3. Parish
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 `

` tags in the HTML output. For example, this input: * Bird * Magic will turn into:

  • Bird
  • Magic
But this: * Bird * Magic will turn into:
  • Bird

  • Magic

List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be intended 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: 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. ## Code Blocks 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 `
` and `` 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:

    

This is a normal paragraph:

This is a code block.
    
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:

Here is an example of AppleScript:

tell application "Foo"
        beep
    end tell
    
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: will turn into:
<div class="footer">
        &copy; 2004 Foo Corporation
    </div>
    
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. ## Horizontal Rules You can produce a horizontal rule tag (`
`) 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: * * * *** ***** - - - --------------------------------------- _ _ _ * * * # Span Elements ## Links 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:

This is an example inline link.

This link has no title attribute.

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. The link URL may, optionally, be surrounded by angle brackets: [id]: "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 constist 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:

I get 10 times more traffic from Google than from Yahoo or MSN.

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. ## Emphasis Markdown treats asterisks (`*`) and underscores (`_`) as indicators of emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML `` tag. E.g., this input: *single asterisks* _single underscores_ **double asterisks** __double underscores__ will produce: single asterisks single underscores double asterisks double underscores 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*fucking*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\* ## Code 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:

Use the printf() function.

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:

There is a literal backtick (`) here.

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:

A single backtick in a code span: `

A backtick-delimited string in a code span: `foo`

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 `` tags. into:

Please don't use any <blink> tags.

You can write this: `—` is the decimal-encoded equivalent of `—`. to produce:

&#8212; is the decimal-encoded equivalent of &mdash;.

## Images 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 `` tags. * * * # Miscellaneous ## Automatic Links 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: Markdown will turn this into: http://example.com/ 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: into something like this: address@exa mple.com 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.) ## Backslash Escapes 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 `` tag), you can 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 Markdown-3.1.1/tests/extensions/toc_invalid.html0000644000076500000240000000050213212354257022437 0ustar waylanstaff00000000000000

[TOC]

Header 1

The TOC marker cannot be inside a header. This test makes sure markdown doesn't crash when it encounters this errant syntax. The unexpected output should clue the author in that s/he needs to add a blank line between the TOC and the <hr>.

Markdown-3.1.1/tests/extensions/toc_invalid.txt0000644000076500000240000000041413212354257022314 0ustar waylanstaff00000000000000[TOC] ----- # Header 1 The TOC marker cannot be inside a header. This test makes sure markdown doesn't crash when it encounters this errant syntax. The unexpected output should clue the author in that s/he needs to add a blank line between the TOC and the `
`. Markdown-3.1.1/tests/extensions/toc_nested.html0000644000076500000240000000121213212354257022272 0ustar waylanstaff00000000000000

Header A

Header 1

Header i

Header B

Markdown-3.1.1/tests/extensions/toc_nested.txt0000644000076500000240000000007313212354257022151 0ustar waylanstaff00000000000000# Header A ## Header 1 ### Header i # Header *B* [TOC] Markdown-3.1.1/tests/extensions/toc_nested2.html0000644000076500000240000000136613212354257022366 0ustar waylanstaff00000000000000

Start with header other than one.[link]

Header 3[link]

Header 4[link]

Header 3[link]

Markdown-3.1.1/tests/extensions/toc_nested2.txt0000644000076500000240000000013113212354257022226 0ustar waylanstaff00000000000000[TOC] ### Start with header other than one. ### Header 3 #### Header 4 ### Header 3 Markdown-3.1.1/tests/extensions/toc_nested_list.html0000644000076500000240000000120613212354257023330 0ustar waylanstaff00000000000000

Title

Section 1

  1. List Item 1

    Subsection 1

    Explanation 1

  2. List Item 2

    Subsection 2

    Explanation 2

Section 2

Section 3

Markdown-3.1.1/tests/extensions/toc_nested_list.txt0000644000076500000240000000025013212354257023201 0ustar waylanstaff00000000000000# Title [TOC] ## Section 1 1. List Item 1 ### Subsection 1 Explanation 1 2. List Item 2 ### Subsection 2 Explanation 2 ## Section 2 ## Section 3Markdown-3.1.1/tests/extensions/toc_out_of_order.html0000644000076500000240000000026713212354257023507 0ustar waylanstaff00000000000000

Header 2

Header 1

Markdown-3.1.1/tests/extensions/toc_out_of_order.txt0000644000076500000240000000003713212354257023355 0ustar waylanstaff00000000000000[TOC] ## Header 2 # Header 1 Markdown-3.1.1/tests/extensions/wikilinks.html0000644000076500000240000000156113212354257022156 0ustar waylanstaff00000000000000

Some text with a WikiLink.

A link with white space and_underscores and a empty one.

Another with double spaces and double__underscores and one that has emphasis inside and one with_multiple_underscores and one that is emphasised.

And a RealLink.

http://example.com/And_A_AutoLink

And a MarkdownLink for completeness.

Markdown-3.1.1/tests/extensions/wikilinks.txt0000644000076500000240000000067413212354257022035 0ustar waylanstaff00000000000000Some text with a [[WikiLink]]. A link with [[ white space and_underscores ]] and a empty [[ ]] one. Another with [[double spaces]] and [[double__underscores]] and one that [[has _emphasis_ inside]] and one [[with_multiple_underscores]] and one that is _[[emphasised]]_. And a RealLink. And a [MarkdownLink](/MarkdownLink/ "A MarkdownLink") for completeness. Markdown-3.1.1/tests/misc/0000755000076500000240000000000013470647777016037 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/misc/CRLF_line_ends.html0000644000076500000240000000003313212354257021445 0ustar waylanstaff00000000000000

foo

bar
Markdown-3.1.1/tests/misc/CRLF_line_ends.txt0000644000076500000240000000003313212354257021320 0ustar waylanstaff00000000000000foo
bar
Markdown-3.1.1/tests/misc/adjacent-headers.html0000644000076500000240000000010013212354257022054 0ustar waylanstaff00000000000000

this is a huge header

this is a smaller header

Markdown-3.1.1/tests/misc/adjacent-headers.txt0000644000076500000240000000007113212354257021736 0ustar waylanstaff00000000000000# this is a huge header # ## this is a smaller header ## Markdown-3.1.1/tests/misc/ampersand.html0000644000076500000240000000003413457143376020663 0ustar waylanstaff00000000000000

&

AT&T

Markdown-3.1.1/tests/misc/ampersand.txt0000644000076500000240000000001213457143376020532 0ustar waylanstaff00000000000000& AT&T Markdown-3.1.1/tests/misc/arabic.html0000644000076500000240000000422513212354257020127 0ustar waylanstaff00000000000000

بايثون

بايثون لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً.

نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python.

تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره.

أمثلة

مثال Hello World!

print "Hello World!"

مثال لاستخراج المضروب Factorial :

num = 1
x = raw_input('Insert the number please ')
x = int(x)

if x > 69:
 print 'Math Error !'
else:
 while x > 1:
  num *= x
  x = x-1

 print num

وصلات خارجية

بذرة حاس

Markdown-3.1.1/tests/misc/arabic.txt0000644000076500000240000000406713212354257020006 0ustar waylanstaff00000000000000 بايثون ===== **بايثون** لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً. نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python. تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره. ##أمثلة مثال Hello World! print "Hello World!" مثال لاستخراج المضروب Factorial : num = 1 x = raw_input('Insert the number please ') x = int(x) if x > 69: print 'Math Error !' else: while x > 1: num *= x x = x-1 print num ##وصلات خارجية * [الموقع الرسمي للغة بايثون](http://www.python.org) بذرة حاس Markdown-3.1.1/tests/misc/autolinks_with_asterisks.html0000644000076500000240000000012613212354257024036 0ustar waylanstaff00000000000000

http://some.site/weird*url*thing

Markdown-3.1.1/tests/misc/autolinks_with_asterisks.txt0000644000076500000240000000004413212354257023710 0ustar waylanstaff00000000000000 Markdown-3.1.1/tests/misc/autolinks_with_asterisks_russian.html0000644000076500000240000000020413212354257025577 0ustar waylanstaff00000000000000

http://some.site/нечто*очень*странное

Markdown-3.1.1/tests/misc/autolinks_with_asterisks_russian.txt0000644000076500000240000000007413212354257025457 0ustar waylanstaff00000000000000 Markdown-3.1.1/tests/misc/backtick-escape.html0000644000076500000240000000022613212354257021714 0ustar waylanstaff00000000000000

`This should not be in code.` \This should be in code.\\ \`This should not be in code.\` `And finally this should not be in code.`

Markdown-3.1.1/tests/misc/backtick-escape.txt0000644000076500000240000000021513212354257021565 0ustar waylanstaff00000000000000\`This should not be in code.\` \\`This should be in code.\\` \\\`This should not be in code.\\\` \`And finally this should not be in code.` Markdown-3.1.1/tests/misc/bidi.html0000644000076500000240000001724213330711640017612 0ustar waylanstaff00000000000000

Python(パイソン)は、Guido van Rossum によって作られたオープンソースのオブジェクト指向スクリプト言語。Perlとともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。)

|||||||||||||||||||||||||||||THIS SHOULD BE LTR|||||||||||||||||||||||||

|||||||||||||||||||||||||||||THIS SHOULD BE RTL|||||||||||||||||||||||||

(بايثون لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (THIS SHOULD BE LTR ) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوح

پایتون زبان برنامه‌نویسی تفسیری و سطح بالا ، شی‌گرا و یک زبان برنامه‌نویسی تفسیری سمت سرور قدرتمند است که توسط گیدو ون روسوم در سال ۱۹۹۰ ساخته شد. این زبان در ویژگی‌ها شبیه پرل، روبی، اسکیم، اسمال‌تاک و تی‌سی‌ال است و از مدیریت خودکار حافظه استفاده می‌کند

Python,是一种面向对象的、直譯式的计算机程序设计语言,也是一种功能强大而完善的通用型语言,已经具有十多年的发展历史,成熟且稳定。

ބްލޫ ވޭލްގެ ދޫ މަތީގައި އެއްފަހަރާ 50 މީހުންނަށް ތިބެވިދާނެވެ. ބޮޑު މަހުގެ ދުލަކީ އެހާމެ ބޮޑު އެއްޗެކެވެ.

உருது 13ஆம் நூற்றாண்டில் உருவான ஒரு இந்தோ-ஐரோப்பிய மொழியாகும். உருது, ஹிந்தியுடன் சேர்த்து "ஹிந்துஸ்தானி" என அழைக்கப்படுகின்றது. மண்டரின், ஆங்கிலம் ஆகியவற்றுக்கு அடுத்தபடியாக மூன்றாவது கூடிய அளவு மக்களால் புரிந்து கொள்ளப்படக்கூடியது ஹிந்துஸ்தானியேயாகும். தாய் மொழியாகப் பேசுபவர்கள் எண்ணிக்கையின் அடிப்படையில் உருது உலகின் 20 ஆவது பெரிய மொழியாகும். 6 கோடி மக்கள் இதனைத் தாய் மொழியாகக் கொண்டுள்ளார்கள். இரண்டாவது மொழியாகக் கொண்டுள்ளவர்கள் உட்பட 11 கோடிப் பேர் இதனைப் பேசுகிறார்கள். உருது பாகிஸ்தானின் அரசகரும மொழியாகவும், இந்தியாவின் அரசகரும மொழிகளுள் ஒன்றாகவும் விளங்குகிறது.

اردو ہندوآریائی زبانوں کی ہندويورپی شاخ کی ایک زبان ہے جو تيرھويں صدی ميں بر صغير ميں پيدا ہوئی ـ اردو پاکستان کی سرکاری زبان ہے اور بھارت کی سرکاری زبانوں ميں سے ايک ہے۔ اردو بھارت ميں 5 کروڑ اور پاکستان ميں 1 کروڑ لوگوں کی مادری زبان ہے مگر اسے بھارت اور پاکستان کے تقریباً 50 کروڑ لوگ بول اور سمجھ سکتے ھیں ۔ جن میں سے تقریباً 10.5 کروڑ لوگ اسے باقاعدہ بولتے ھیں۔

بايثون

بايثون لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً.

|||||||||||||||||||||||||||||THIS SHOULD BE RTL|||||||||||||||||||||||||

(نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python.

تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره.

أمثلة

مثال Hello World!

print "Hello World!"

مثال لاستخراج المضروب Factorial :

num = 1
x = raw_input('Insert the number please ')
x = int(x)

if x > 69:
 print 'Math Error !'
else:
 while x > 1:
  num *= x
  x = x-1

 print num

وصلات خارجية

بذرة حاس

Недвард «Нед» Фландерс (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая.

Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы Northeast Flanders St. в Портленде, Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы NE Flanders St. хулиганы часто исправляли на NED Flanders St.

Markdown-3.1.1/tests/misc/bidi.txt0000644000076500000240000001663113330711640017466 0ustar waylanstaff00000000000000**Python**(パイソン)は、[Guido van Rossum](http://en.wikipedia.org/wiki/Guido_van_Rossum) によって作られたオープンソースのオブジェクト指向スクリプト言語。[Perl](http://ja.wikipedia.org/wiki/Perl)とともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。) |||||||||||||||||||||||||||||THIS SHOULD BE LTR||||||||||||||||||||||||| |||||||||||||||||||||||||||||THIS SHOULD BE RTL||||||||||||||||||||||||| (**بايثون** لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (THIS SHOULD BE LTR ) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوح پایتون زبان برنامه‌نویسی تفسیری و سطح بالا ، شی‌گرا و یک زبان برنامه‌نویسی تفسیری سمت سرور قدرتمند است که توسط گیدو ون روسوم در سال ۱۹۹۰ ساخته شد. این زبان در ویژگی‌ها شبیه پرل، روبی، اسکیم، اسمال‌تاک و تی‌سی‌ال است و از مدیریت خودکار حافظه استفاده می‌کند Python,是一种面向对象的、直譯式的计算机程序设计语言,也是一种功能强大而完善的通用型语言,已经具有十多年的发展历史,成熟且稳定。 ބްލޫ ވޭލްގެ ދޫ މަތީގައި އެއްފަހަރާ 50 މީހުންނަށް ތިބެވިދާނެވެ. ބޮޑު މަހުގެ ދުލަކީ އެހާމެ ބޮޑު އެއްޗެކެވެ. **உருது** 13ஆம் நூற்றாண்டில் உருவான ஒரு இந்தோ-ஐரோப்பிய மொழியாகும். உருது, ஹிந்தியுடன் சேர்த்து "ஹிந்துஸ்தானி" என அழைக்கப்படுகின்றது. மண்டரின், ஆங்கிலம் ஆகியவற்றுக்கு அடுத்தபடியாக மூன்றாவது கூடிய அளவு மக்களால் புரிந்து கொள்ளப்படக்கூடியது ஹிந்துஸ்தானியேயாகும். தாய் மொழியாகப் பேசுபவர்கள் எண்ணிக்கையின் அடிப்படையில் உருது உலகின் 20 ஆவது பெரிய மொழியாகும். 6 கோடி மக்கள் இதனைத் தாய் மொழியாகக் கொண்டுள்ளார்கள். இரண்டாவது மொழியாகக் கொண்டுள்ளவர்கள் உட்பட 11 கோடிப் பேர் இதனைப் பேசுகிறார்கள். உருது பாகிஸ்தானின் அரசகரும மொழியாகவும், இந்தியாவின் அரசகரும மொழிகளுள் ஒன்றாகவும் விளங்குகிறது. اردو ہندوآریائی زبانوں کی ہندويورپی شاخ کی ایک زبان ہے جو تيرھويں صدی ميں بر صغير ميں پيدا ہوئی ـ اردو پاکستان کی سرکاری زبان ہے اور بھارت کی سرکاری زبانوں ميں سے ايک ہے۔ اردو بھارت ميں 5 کروڑ اور پاکستان ميں 1 کروڑ لوگوں کی مادری زبان ہے مگر اسے بھارت اور پاکستان کے تقریباً 50 کروڑ لوگ بول اور سمجھ سکتے ھیں ۔ جن میں سے تقریباً 10.5 کروڑ لوگ اسے باقاعدہ بولتے ھیں۔ بايثون ===== **بايثون** لغة برمجة حديثة بسيطة، واضحة، سريعة ، تستخدم أسلوب البرمجة الكائنية (OOP) وقابلة للتطوير بالإضافة إلى أنها مجانية و مفتوحة المصدر. صُنفت بالأساس كلغة تفسيرية ، بايثون مصممة أصلاً للأداء بعض المهام الخاصة أو المحدودة. إلا أنه يمكن استخدامها بايثون لإنجاز المشاريع الضخمه كأي لغة برمجية أخرى، غالباً ما يُنصح المبتدئين في ميدان البرمجة بتعلم هذه اللغة لأنها من بين أسهل اللغات البرمجية تعلماً. |||||||||||||||||||||||||||||THIS SHOULD BE RTL||||||||||||||||||||||||| (نشأت بايثون في مركز CWI (مركز العلوم والحاسب الآلي) بأمستردام على يد جويدو فان رُزوم. تم تطويرها بلغة C. أطلق فان رُزوم اسم "بايثون" على لغته تعبيرًا عن إعجابه بفِرقَة مسرحية هزلية شهيرة من بريطانيا، كانت تطلق على نفسها اسم مونتي بايثون Monty Python. تتميز بايثون بمجتمعها النشط ، كما أن لها الكثير من المكتبات البرمجية ذات الأغراض الخاصة والتي برمجها أشخاص من مجتمع هذه اللغة ، مثلاً مكتبة PyGame التي توفر مجموعه من الوظائف من اجل برمجة الالعاب. ويمكن لبايثون التعامل مع العديد من أنواع قواعد البيانات مثل MySQL وغيره. ##أمثلة مثال Hello World! print "Hello World!" مثال لاستخراج المضروب Factorial : num = 1 x = raw_input('Insert the number please ') x = int(x) if x > 69: print 'Math Error !' else: while x > 1: num *= x x = x-1 print num ##وصلات خارجية * [الموقع الرسمي للغة بايثون](http://www.python.org) بذرة حاس **Недвард «Нед» Фландерс** (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая. Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы *Northeast Flanders St.* в [Портленде](http://www.portland.gov), Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы *NE Flanders St.* хулиганы часто исправляли на _NED Flanders St._ Markdown-3.1.1/tests/misc/blank-block-quote.html0000644000076500000240000000007713212354257022221 0ustar waylanstaff00000000000000

aaaaaaaaaaa

bbbbbbbbbbb

Markdown-3.1.1/tests/misc/blank-block-quote.txt0000644000076500000240000000003613212354257022067 0ustar waylanstaff00000000000000 aaaaaaaaaaa > bbbbbbbbbbb Markdown-3.1.1/tests/misc/blank_lines_in_codeblocks.html0000644000076500000240000000065113212354257024044 0ustar waylanstaff00000000000000

Preserve blank lines in code blocks with tabs:

a code block

two tabbed lines


three tabbed lines



four tabbed lines




five tabbed lines





six tabbed lines






End of tabbed block

And without tabs:

a code block

two blank lines


three blank lines



four blank lines




five blank lines





six blank lines






End of block

End of document

Markdown-3.1.1/tests/misc/blank_lines_in_codeblocks.txt0000644000076500000240000000102413212354257023712 0ustar waylanstaff00000000000000Preserve blank lines in code blocks with tabs: a code block two tabbed lines three tabbed lines four tabbed lines five tabbed lines six tabbed lines End of tabbed block And without tabs: a code block two blank lines three blank lines four blank lines five blank lines six blank lines End of block End of documentMarkdown-3.1.1/tests/misc/block_html5.html0000644000076500000240000000044513457143376021122 0ustar waylanstaff00000000000000

Hello :-)

Caption

Some footer

Markdown-3.1.1/tests/misc/block_html5.txt0000644000076500000240000000044413457143376020774 0ustar waylanstaff00000000000000

Hello :-)

Caption

Some footer

Markdown-3.1.1/tests/misc/block_html_attr.html0000644000076500000240000000147113457143376022067 0ustar waylanstaff00000000000000
Raw HTML processing should not confuse this with the blockquote below

Header2

Header3

Paragraph

Header3

Paragraph

Paragraph

Paragraph

linktext

Markdown-3.1.1/tests/misc/block_html_attr.txt0000644000076500000240000000146713457143376021747 0ustar waylanstaff00000000000000
Raw HTML processing should not confuse this with the blockquote below

Header2

Header3

Paragraph

Header3

Paragraph

Paragraph

Paragraph

linktext

Markdown-3.1.1/tests/misc/block_html_simple.html0000644000076500000240000000010213457143376022374 0ustar waylanstaff00000000000000

foo

  • bar

  • baz

Markdown-3.1.1/tests/misc/block_html_simple.txt0000644000076500000240000000010213457143376022247 0ustar waylanstaff00000000000000

foo

  • bar

  • baz

Markdown-3.1.1/tests/misc/blockquote-below-paragraph.html0000644000076500000240000000032613212354257024125 0ustar waylanstaff00000000000000

Paragraph

Block quote Yep

Paragraph

no space Nope

Paragraph one

blockquote More blockquote.

Markdown-3.1.1/tests/misc/blockquote-below-paragraph.txt0000644000076500000240000000014613212354257024000 0ustar waylanstaff00000000000000Paragraph > Block quote > Yep Paragraph >no space >Nope Paragraph one > blockquote More blockquote. Markdown-3.1.1/tests/misc/blockquote-hr.html0000644000076500000240000000062213212354257021462 0ustar waylanstaff00000000000000

This is a paragraph.


Block quote with horizontal lines.


Double block quote.


End of the double block quote.

A new paragraph. With multiple lines. Even a lazy line.


The last line.

foo

bar



baz

Markdown-3.1.1/tests/misc/blockquote-hr.txt0000644000076500000240000000037613212354257021343 0ustar waylanstaff00000000000000This is a paragraph. --- > Block quote with horizontal lines. > --- > > Double block quote. > > --- > > End of the double block quote. > A new paragraph. > With multiple lines. Even a lazy line. > --- > The last line. foo > bar > *** --- > baz Markdown-3.1.1/tests/misc/blockquote.html0000644000076500000240000000121713212354257021054 0ustar waylanstaff00000000000000

blockquote with no whitespace before >.

foo

blockquote with one space before the >.

bar

blockquote with 2 spaces.

baz

this has three spaces so its a paragraph.

blah

> this one had four so it's a code block.

this nested blockquote has 0 on level one and 3 (one after the first > + 2 more) on level 2.

and this has 4 on level 2 - another code block.

Markdown-3.1.1/tests/misc/blockquote.txt0000644000076500000240000000061313212354257020726 0ustar waylanstaff00000000000000> blockquote with no whitespace before `>`. foo > blockquote with one space before the `>`. bar > blockquote with 2 spaces. baz > this has three spaces so its a paragraph. blah > this one had four so it's a code block. > > this nested blockquote has 0 on level one and 3 (one after the first `>` + 2 more) on level 2. > > and this has 4 on level 2 - another code block. Markdown-3.1.1/tests/misc/bold_links.html0000644000076500000240000000010213212354257021014 0ustar waylanstaff00000000000000

bold link

Markdown-3.1.1/tests/misc/bold_links.txt0000644000076500000240000000004413212354257020674 0ustar waylanstaff00000000000000**bold [link](http://example.com)** Markdown-3.1.1/tests/misc/br.html0000644000076500000240000000103713226455362017313 0ustar waylanstaff00000000000000

Output:

<p>Some of these words <em>are emphasized</em>.
Some of these words <em>are emphasized also</em>.</p>

<p>Use two asterisks for <strong>strong emphasis</strong>.
Or, if you prefer, <strong>use two underscores instead</strong>.</p>

Lists

Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, +, and -) as list markers. These three markers are interchangeable; this:

Markdown-3.1.1/tests/misc/br.txt0000644000076500000240000000064313226455362017170 0ustar waylanstaff00000000000000Output:

Some of these words are emphasized. Some of these words are emphasized also.

Use two asterisks for strong emphasis. Or, if you prefer, use two underscores instead.

## Lists ## Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, `+`, and `-`) as list markers. These three markers are interchangeable; this: Markdown-3.1.1/tests/misc/bracket_re.html0000644000076500000240000000355113212354257021010 0ustar waylanstaff00000000000000

[x xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx

Markdown-3.1.1/tests/misc/bracket_re.txt0000644000076500000240000000354413212354257020665 0ustar waylanstaff00000000000000 [x xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx Markdown-3.1.1/tests/misc/brackets-in-img-title.html0000644000076500000240000000101213212354257022770 0ustar waylanstaff00000000000000

alt alt alt

alt alt

alt alt alt alt

Markdown-3.1.1/tests/misc/brackets-in-img-title.txt0000644000076500000240000000047113212354257022653 0ustar waylanstaff00000000000000![alt](local-img.jpg) ![alt](local-img.jpg "") ![alt](local-img.jpg "normal title") ![alt](local-img.jpg "(just title in brackets)") ![alt](local-img.jpg "title with brackets (I think)") ![alt](local-img.jpg "(") ![alt](local-img.jpg "(open only") ![alt](local-img.jpg ")") ![alt](local-img.jpg "close only)") Markdown-3.1.1/tests/misc/code-first-line.html0000644000076500000240000000006613212354257021671 0ustar waylanstaff00000000000000
print "This is a code block."
Markdown-3.1.1/tests/misc/code-first-line.txt0000644000076500000240000000004213212354257021536 0ustar waylanstaff00000000000000 print "This is a code block." Markdown-3.1.1/tests/misc/comments.html0000644000076500000240000000017113457143376020540 0ustar waylanstaff00000000000000

X<0

X>0

as if

no blank line

Markdown-3.1.1/tests/misc/comments.txt0000644000076500000240000000012313457143376020410 0ustar waylanstaff00000000000000X<0 X>0
as if
__no blank line__ Markdown-3.1.1/tests/misc/div.html0000644000076500000240000000012313457143376017472 0ustar waylanstaff00000000000000

And now in uppercase:

foo
Markdown-3.1.1/tests/misc/div.txt0000644000076500000240000000011613457143376017347 0ustar waylanstaff00000000000000 And now in uppercase:
foo
Markdown-3.1.1/tests/misc/em-around-links.html0000644000076500000240000000126513212354326021711 0ustar waylanstaff00000000000000

Title

Python in Markdown by some great folks - This does work as expected.

Markdown-3.1.1/tests/misc/em-around-links.txt0000644000076500000240000000101013212354326021550 0ustar waylanstaff00000000000000# Title - *[Python in Markdown](http://example.com) by some great folks* - This *does* work as expected. - _[Python in Markdown](http://example.com) by some great folks_ - This *does* work as expected. - [_Python in Markdown_](http://example.com) by some great folks - This *does* work as expected. - [_Python in Markdown_](http://example.com) _by some great folks_ - This *does* work as expected. _[Python in Markdown](http://example.com) by some great folks_ - This *does* work as expected. Markdown-3.1.1/tests/misc/em_strong.html0000644000076500000240000000043413212354257020701 0ustar waylanstaff00000000000000

One asterisk: *

One underscore: _

Two asterisks: **

With spaces: * *

Two underscores __

with spaces: _ _

three asterisks: ***

with spaces: * * *

three underscores: ___

with spaces: _ _ _

One char: a

Markdown-3.1.1/tests/misc/em_strong.txt0000644000076500000240000000032313212354257020551 0ustar waylanstaff00000000000000One asterisk: * One underscore: _ Two asterisks: ** With spaces: * * Two underscores __ with spaces: _ _ three asterisks: *** with spaces: * * * three underscores: ___ with spaces: _ _ _ One char: _a_ Markdown-3.1.1/tests/misc/em_strong_complex.html0000644000076500000240000000110113432642364022423 0ustar waylanstaff00000000000000

test test test test

test test test test

test

test

test test_

test test

test_test test_test

test test test test

test test test test

*test

test

test*

test test

testtest testtest

Markdown-3.1.1/tests/misc/em_strong_complex.txt0000644000076500000240000000040213432642364022301 0ustar waylanstaff00000000000000___test test__ test test_ ___test test_ test test__ ___test___ __test__ ___test_ test___ ___test_ test__ _test_test test_test_ ***test test** test test* ***test test* test test** **test* ***test*** **test*** ***test* test** *test*test test*test*Markdown-3.1.1/tests/misc/email.html0000644000076500000240000000156313212354257017777 0ustar waylanstaff00000000000000

asdfasdfadsfasd yuri@freewisdom.org or you can say instead yuri@freewisdom.org

bob&sue@example.com

Markdown-3.1.1/tests/misc/email.txt0000644000076500000240000000016313212354257017645 0ustar waylanstaff00000000000000 asdfasdfadsfasd or you can say instead Markdown-3.1.1/tests/misc/escaped_chars_in_js.html0000644000076500000240000000072313457143376022664 0ustar waylanstaff00000000000000

[javascript protected email address]

Markdown-3.1.1/tests/misc/escaped_chars_in_js.txt0000644000076500000240000000071513457143376022540 0ustar waylanstaff00000000000000[javascript protected email address] Markdown-3.1.1/tests/misc/escaped_links.html0000644000076500000240000000032413212354257021506 0ustar waylanstaff00000000000000

Backslashed in links:

q=go:GO\:0000307

q=go:GO\:0000308

a \non-escaped char.

Markdown-3.1.1/tests/misc/escaped_links.txt0000644000076500000240000000025613212354257021365 0ustar waylanstaff00000000000000Backslashed in links: [q=go:GO\\:0000307](/query?q=go:GO\\:0000307) [q=go:GO\\:0000308][foo] [foo]: /query?q=go:GO\:0000308 "/query?q=go:GO\:0000308" a \non-escaped char.Markdown-3.1.1/tests/misc/funky-list.html0000644000076500000240000000042213212354257021006 0ustar waylanstaff00000000000000
  1. this starts a list with numbers
  2. this will show as number "2"
  3. this will show as number "3."
  4. any number, +, -, or * will keep the list going.

aaaaaaaaaaaaaaa

  • now a normal list
  • and more
Markdown-3.1.1/tests/misc/funky-list.txt0000644000076500000240000000031313212354257020660 0ustar waylanstaff000000000000001. this starts a list *with* numbers + this will show as number "2" * this will show as number "3." 9. any number, +, -, or * will keep the list going. aaaaaaaaaaaaaaa - now a normal list - and more Markdown-3.1.1/tests/misc/h1.html0000644000076500000240000000010513212354257017207 0ustar waylanstaff00000000000000

Header

Header 2

H3

H1

H2

Markdown-3.1.1/tests/misc/h1.txt0000644000076500000240000000006713212354257017071 0ustar waylanstaff00000000000000Header ------ Header 2 ======== ### H3 H1 = H2 -- Markdown-3.1.1/tests/misc/hash.html0000644000076500000240000000014313212354257017624 0ustar waylanstaff00000000000000

a

#!/usr/bin/python
hello

a

!/usr/bin/python
hello

a

Markdown-3.1.1/tests/misc/hash.txt0000644000076500000240000000012113212354257017473 0ustar waylanstaff00000000000000a
#!/usr/bin/python
hello
a
!/usr/bin/python
hello
a Markdown-3.1.1/tests/misc/header-in-lists.html0000644000076500000240000000052413212354257021674 0ustar waylanstaff00000000000000

Tight List:

  • Header1

    Line 1-2 - not a header or paragraph!
  • Header2

    Line 2-2 - not a header or paragraph!

Loose List:

  • Header1

    Line 1-2 - a paragraph

  • Header2

    Line 2-2 - a paragraph

Markdown-3.1.1/tests/misc/header-in-lists.txt0000644000076500000240000000031213212354257021542 0ustar waylanstaff00000000000000Tight List: * #Header1 Line 1-2 - **not** a header *or* paragraph! * #Header2 Line 2-2 - not a header or paragraph! Loose List: * #Header1 Line 1-2 - *a* paragraph * #Header2 Line 2-2 - a paragraph Markdown-3.1.1/tests/misc/headers.html0000644000076500000240000000034313212354257020316 0ustar waylanstaff00000000000000

Hello world

Line 2 Line 3

[Markdown][5]

Markdown

[5]: http://foo.com/

Issue #1: Markdown

Text

Header

Some other text

Markdown-3.1.1/tests/misc/headers.txt0000644000076500000240000000024313212354257020170 0ustar waylanstaff00000000000000### Hello world Line 2 Line 3 # [Markdown][5] # [Markdown](http://some.link.com/) # [5]: http://foo.com/ # Issue #1: Markdown Text # Header Some other text Markdown-3.1.1/tests/misc/hline.html0000644000076500000240000000004013212354257017774 0ustar waylanstaff00000000000000

Header

Next line

Markdown-3.1.1/tests/misc/hline.txt0000644000076500000240000000002513212354257017652 0ustar waylanstaff00000000000000 #Header Next line Markdown-3.1.1/tests/misc/html-comments.html0000644000076500000240000000011413457143376021477 0ustar waylanstaff00000000000000

Here is HTML and once more

Markdown-3.1.1/tests/misc/html-comments.txt0000644000076500000240000000010613457143376021353 0ustar waylanstaff00000000000000Here is HTML and once more

Markdown-3.1.1/tests/misc/html.html0000644000076500000240000000145713457143376017667 0ustar waylanstaff00000000000000

Block level html

Some inline stuff.

Now some arbitrary tags.

More block level html.
Html with various attributes.
Div with a blank line in the middle.
This gets treated as HTML.

And of course .

this . [this ) Some funky inline stuff with markdown escaping syntax. And now a line with only an opening bracket: < And one with other stuff but no closing bracket: < foo Markdown-3.1.1/tests/misc/image-2.html0000644000076500000240000000016013212354257020121 0ustar waylanstaff00000000000000

link!

link

Markdown-3.1.1/tests/misc/image-2.txt0000644000076500000240000000010013212354257017766 0ustar waylanstaff00000000000000[*link!*](http://src.com/) *[link](http://www.freewisdom.org)* Markdown-3.1.1/tests/misc/image_in_links.html0000644000076500000240000000013013212354257021645 0ustar waylanstaff00000000000000

altname

Markdown-3.1.1/tests/misc/image_in_links.txt0000644000076500000240000000007113212354257021524 0ustar waylanstaff00000000000000 [![altname](path/to/img_thumb.png)](path/to/image.png) Markdown-3.1.1/tests/misc/ins-at-start-of-paragraph.html0000644000076500000240000000011413212354257023572 0ustar waylanstaff00000000000000

Hello, fellow developer this ins should be wrapped in a p.

Markdown-3.1.1/tests/misc/ins-at-start-of-paragraph.txt0000644000076500000240000000010613212354257023446 0ustar waylanstaff00000000000000Hello, fellow developer this ins should be wrapped in a p. Markdown-3.1.1/tests/misc/inside_html.html0000644000076500000240000000006113212354257021177 0ustar waylanstaff00000000000000

ok?

Markdown-3.1.1/tests/misc/inside_html.txt0000644000076500000240000000003613212354257021054 0ustar waylanstaff00000000000000 __ok__? Markdown-3.1.1/tests/misc/japanese.html0000644000076500000240000000565713212354257020506 0ustar waylanstaff00000000000000

パイソン (Python)

Python(パイソン)は、Guido van Rossum によって作られたオープンソースのオブジェクト指向スクリプト言語。Perlとともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。)

概要

プログラミング言語 Python は初心者から専門家まで幅広いユーザ層を獲得している。利用目的は汎用で、方向性としてはJavaに近い。ただし、最初からネットワーク利用をメインとして考えられているJavaよりセキュリティについてはやや寛大である。多くのプラットフォームをサポートしており(⇒動作するプラットフォーム)、豊富なライブラリがあることから、産業界でも利用が増えつつある。また、Pythonは純粋なプログラミング言語のほかにも、多くの異なる言語で書かれたモジュールをまとめる糊言語のひとつとして位置づけることができる。実際Pythonは多くの商用アプリケーションでスクリプト言語として採用されている(⇒Pythonを使っている製品あるいはソフトウェアの一覧)。豊富なドキュメントをもち、Unicodeによる文字列操作をサポートしており、日本語処理も標準で可能である。

Python は基本的にインタプリタ上で実行されることを念頭において設計されており、以下のような特徴をもっている:

  • 動的な型付け。
  • オブジェクトのメンバに対するアクセスが制限されていない。(属性や専用のメソッドフックを実装することによって制限は可能。)
  • モジュール、クラス、オブジェクト等の言語の要素が内部からアクセス可能であり、リフレクションを利用した記述が可能。

また、Pythonではインデントによりブロックを指定する構文を採用している(⇒オフサイドルール)。この構文はPythonに慣れたユーザからは称賛をもって受け入れられているが、他の言語のユーザからは批判も多い。このほかにも、大きすぎる実行ファイルや、Javaに比べて遅い処理速度などが欠点として指摘されている。しかし プロトタイピング の際にはこれらの点はさして問題とはならないことから、研究開発部門では頻繁に利用されている。

Markdown-3.1.1/tests/misc/japanese.txt0000644000076500000240000000545413212354257020354 0ustar waylanstaff00000000000000パイソン (Python) ======= **Python**(パイソン)は、[Guido van Rossum](http://en.wikipedia.org/wiki/Guido_van_Rossum) によって作られたオープンソースのオブジェクト指向スクリプト言語。[Perl](http://ja.wikipedia.org/wiki/Perl)とともに欧米で広く普及している。イギリスのテレビ局 BBC が製作したコメディ番組『空飛ぶモンティ・パイソン』にちなんで名付けられた。 (Pythonには、爬虫類のニシキヘビの意味があり、Python言語のマスコットやアイコンとして使われることがある。) ## 概要 プログラミング言語 Python は初心者から専門家まで幅広いユーザ層を獲得している。利用目的は汎用で、方向性としてはJavaに近い。ただし、最初からネットワーク利用をメインとして考えられているJavaよりセキュリティについてはやや寛大である。多くのプラットフォームをサポートしており(⇒[動作するプラットフォーム](#somelink))、豊富なライブラリがあることから、産業界でも利用が増えつつある。また、Pythonは純粋なプログラミング言語のほかにも、多くの異なる言語で書かれたモジュールをまとめる糊言語のひとつとして位置づけることができる。実際Pythonは多くの商用アプリケーションでスクリプト言語として採用されている(⇒Pythonを使っている製品あるいはソフトウェアの一覧)。豊富なドキュメントをもち、Unicodeによる文字列操作をサポートしており、日本語処理も標準で可能である。 Python は基本的にインタプリタ上で実行されることを念頭において設計されており、以下のような特徴をもっている: * 動的な型付け。 * オブジェクトのメンバに対するアクセスが制限されていない。(属性や専用のメソッドフックを実装することによって制限は可能。) * モジュール、クラス、オブジェクト等の言語の要素が内部からアクセス可能であり、リフレクションを利用した記述が可能。 また、Pythonではインデントによりブロックを指定する構文を採用している(⇒[オフサイドルール](#jklj))。この構文はPythonに慣れたユーザからは称賛をもって受け入れられているが、他の言語のユーザからは批判も多い。このほかにも、大きすぎる実行ファイルや、Javaに比べて遅い処理速度などが欠点として指摘されている。しかし **プロトタイピング** の際にはこれらの点はさして問題とはならないことから、研究開発部門では頻繁に利用されている。 Markdown-3.1.1/tests/misc/lazy-block-quote.html0000644000076500000240000000023213212354257022102 0ustar waylanstaff00000000000000

Line one of lazy block quote. Line two of lazy block quote.

Line one of paragraph two. Line two of paragraph two.

Markdown-3.1.1/tests/misc/lazy-block-quote.txt0000644000076500000240000000016713212354257021764 0ustar waylanstaff00000000000000> Line one of lazy block quote. Line two of lazy block quote. > Line one of paragraph two. Line two of paragraph two. Markdown-3.1.1/tests/misc/link-with-parenthesis.html0000644000076500000240000000021513212354257023132 0ustar waylanstaff00000000000000

ZIP archives

Markdown-3.1.1/tests/misc/link-with-parenthesis.txt0000644000076500000240000000016613212354257023012 0ustar waylanstaff00000000000000[ZIP archives](http://en.wikipedia.org/wiki/ZIP_(file_format) "ZIP (file format) - Wikipedia, the free encyclopedia") Markdown-3.1.1/tests/misc/lists.html0000644000076500000240000000064613212354257020047 0ustar waylanstaff00000000000000
  • A multi-paragraph list, unindented.

Simple tight list

  • Uno
  • Due
  • Tri

A singleton tight list:

  • Uno

A lose list:

  • One

  • Two

  • Three

A lose list with paragraphs

  • One one one one

    one one one one

  • Two two two two

Markdown-3.1.1/tests/misc/lists.txt0000644000076500000240000000035513212354257017717 0ustar waylanstaff00000000000000 * A multi-paragraph list, unindented. Simple tight list * Uno * Due * Tri A singleton tight list: * Uno A lose list: * One * Two * Three A lose list with paragraphs * One one one one one one one one * Two two two two Markdown-3.1.1/tests/misc/lists2.html0000644000076500000240000000011413212354257020117 0ustar waylanstaff00000000000000
  • blah blah blah sdf asdf asdf asdf asdf asda asdf asdfasd
Markdown-3.1.1/tests/misc/lists2.txt0000644000076500000240000000007313212354257017776 0ustar waylanstaff00000000000000* blah blah blah sdf asdf asdf asdf asdf asda asdf asdfasd Markdown-3.1.1/tests/misc/lists3.html0000644000076500000240000000012413212354257020121 0ustar waylanstaff00000000000000
  • blah blah blah sdf asdf asdf asdf asdf asda asdf asdfasd
Markdown-3.1.1/tests/misc/lists3.txt0000644000076500000240000000010313212354257017771 0ustar waylanstaff00000000000000* blah blah blah sdf asdf asdf asdf asdf asda asdf asdfasd Markdown-3.1.1/tests/misc/lists4.html0000644000076500000240000000012713212354257020125 0ustar waylanstaff00000000000000
  • item1
  • item2
    1. Number 1
    2. Number 2
Markdown-3.1.1/tests/misc/lists4.txt0000644000076500000240000000006113212354257017775 0ustar waylanstaff00000000000000 * item1 * item2 1. Number 1 2. Number 2 Markdown-3.1.1/tests/misc/lists5.html0000644000076500000240000000036713212354257020134 0ustar waylanstaff00000000000000

This is a test of a block quote With just two lines

A paragraph

This is a more difficult case With a list item inside the quote

  • Alpha
  • Beta Etc.
Markdown-3.1.1/tests/misc/lists5.txt0000644000076500000240000000024713212354257020004 0ustar waylanstaff00000000000000> This is a test of a block quote > With just two lines A paragraph > This is a more difficult case > With a list item inside the quote > > * Alpha > * Beta > Etc. Markdown-3.1.1/tests/misc/lists6.html0000644000076500000240000000036313212354257020131 0ustar waylanstaff00000000000000

Test five or more spaces as start of list:

  • five spaces

not first item:

  • one space
  • five spaces

loose list:

  • one space

  • five spaces

Markdown-3.1.1/tests/misc/lists6.txt0000644000076500000240000000023313212354257020000 0ustar waylanstaff00000000000000Test five or more spaces as start of list: * five spaces not first item: * one space * five spaces loose list: * one space * five spaces Markdown-3.1.1/tests/misc/lists7.html0000644000076500000240000000174613212354257020140 0ustar waylanstaff00000000000000
  • item 1
    • item 2-1
    • item 2-2
    • item 2-3
    • item 2-4
  • item 3
    • item 4-1

    • item 4-2

    • item 4-3

    • item 4-4

same as above, different spacing

  • item 1
    • item 2-1
    • item 2-2
  • item 3
    • item 4-1

    • item 4-2

only 1 item in nested list ##

  • item 1
    • item 2-1
  • item 3
    • item 4-1

Something ludicrous ##

  • item 1
    • item 2-1
    • item 2-2
      • item 2-2-1
      • item 2-2-2
    • item 2-3
  • item 3
    • item 4-1

      • item 4-1-1
      • item 4-1-2
    • item 4-2

Markdown-3.1.1/tests/misc/lists7.txt0000644000076500000240000000102513212354257020001 0ustar waylanstaff00000000000000* item 1 * * item 2-1 * item 2-2 * item 2-3 * item 2-4 * item 3 * * item 4-1 * item 4-2 * item 4-3 * item 4-4 ## same as above, different spacing * item 1 * * item 2-1 * item 2-2 * item 3 * * item 4-1 * item 4-2 ## only 1 item in nested list ## * item 1 * * item 2-1 * item 3 * * item 4-1 ## Something ludicrous ## * item 1 * * item 2-1 * item 2-2 * * item 2-2-1 * item 2-2-2 * item 2-3 * item 3 * * item 4-1 * * item 4-1-1 * item 4-1-2 * item 4-2 Markdown-3.1.1/tests/misc/lists8.html0000644000076500000240000000106213212354257020130 0ustar waylanstaff00000000000000

Lists with blockquotes

  1. Four-score and seven years ago...

  2. We have nothing to fear...

  3. This is it...

Multi-line blockquotes

  • Four-score and sever years ago our fathers brought forth

  • We have nothing to fear but fear itself

  • This is it as far as I'm concerned

Markdown-3.1.1/tests/misc/lists8.txt0000644000076500000240000000045513212354257020010 0ustar waylanstaff00000000000000# Lists with blockquotes 1. > Four-score and seven years ago... 2. > We have nothing to fear... 3. > This is it... # Multi-line blockquotes * > Four-score and sever years ago > our fathers brought forth * > We have nothing to fear > but fear itself * > This is it > as far as I'm concerned Markdown-3.1.1/tests/misc/markup-inside-p.html0000644000076500000240000000012013457143376021712 0ustar waylanstaff00000000000000

_foo_

_foo_

_foo_

_foo_

_foo_

Markdown-3.1.1/tests/misc/markup-inside-p.txt0000644000076500000240000000012113457143376021566 0ustar waylanstaff00000000000000

_foo_

_foo_

_foo_

_foo_

_foo_

Markdown-3.1.1/tests/misc/mismatched-tags.html0000644000076500000240000000037713457143376021775 0ustar waylanstaff00000000000000

Some text

some more text

and a bit more

And this output

Compatible with PHP Markdown Extra 1.2.2 and Markdown.pl1.0.2b8:

text


Should be in p

Markdown-3.1.1/tests/misc/mismatched-tags.txt0000644000076500000240000000033113457143376021636 0ustar waylanstaff00000000000000

Some text

some more text
and a bit more

And this output

*Compatible with PHP Markdown Extra 1.2.2 and Markdown.pl1.0.2b8:*

text


Should be in p Markdown-3.1.1/tests/misc/missing-link-def.html0000644000076500000240000000015113212354257022040 0ustar waylanstaff00000000000000

This is a [missing link][empty] and a valid and [missing][again].

Markdown-3.1.1/tests/misc/missing-link-def.txt0000644000076500000240000000014713212354257021720 0ustar waylanstaff00000000000000This is a [missing link][empty] and a [valid][link] and [missing][again]. [link]: http://example.com Markdown-3.1.1/tests/misc/more_comments.html0000644000076500000240000000015513457143376021564 0ustar waylanstaff00000000000000

Foo

Bar

foo

foo

foo

foo
This shouldn't

<?php echo "not_block_level";?>

Markdown-3.1.1/tests/misc/php.txt0000644000076500000240000000037613457143376017364 0ustar waylanstaff00000000000000 This should have a p tag
This shouldn't
Markdown-3.1.1/tests/misc/pre.html0000644000076500000240000000022113457143376017475 0ustar waylanstaff00000000000000

aaa

bbb
* and this is pre-formatted content
* and it should be printed just like this
* and not formatted as a list

Markdown-3.1.1/tests/misc/pre.txt0000644000076500000240000000022313457143376017352 0ustar waylanstaff00000000000000

aaa

bbb
* and this is pre-formatted content
* and it should be printed just like this
* and not formatted as a list

Markdown-3.1.1/tests/misc/raw_whitespace.html0000644000076500000240000000017313457143376021722 0ustar waylanstaff00000000000000

Preserve whitespace in raw html

class Foo():
    bar = 'bar'

    def baz(self):
        print self.bar
Markdown-3.1.1/tests/misc/raw_whitespace.txt0000644000076500000240000000016713457143376021600 0ustar waylanstaff00000000000000Preserve whitespace in raw html
class Foo():
    bar = 'bar'

    def baz(self):
        print self.bar
Markdown-3.1.1/tests/misc/russian.html0000644000076500000240000000643313212354257020375 0ustar waylanstaff00000000000000

Недвард «Нед» Фландерс

Недвард «Нед» Фландерс (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая.

Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы Northeast Flanders St. в Портленде, Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы NE Flanders St. хулиганы часто исправляли на NED Flanders St.

Биография

Нед Фландерс родился в Нью-Йорке, его родители были битниками. Его отец в точности похож на взрослого Неда, только он носил козлиную бородку. Их отказ от воспитания Неда и то, что они, в общем-то, были плохими родителями («мы ничего в этом не понимаем и не знаем как начать») привело к тому, что Нед превратился в ужасного сорванца. В конце концов они согласились на экспериментальную восьмимесячную шлепологическую терапию Миннесотского Университета (воспоминания Неда в эпизоде «Hurricane Neddy»), которая научила его подавлять чувство злости. Побочным эфектом терапии стало то, что Нед стал ненавидеть своих родителей (это одна из двух вещей которые ненавидит Фландерс, вторая — отделения почты, чьи длинные очереди, суета и угрюмый персонал раздражают его).

У Неда есть странная привычка добавлять «дидли», «дадли» и другие бессмысленные слова в свои фразы при разговоре, например: «Hi-diddly-ho, neighbor-ino» («Приветик, соседушка»). Это результат сублимации его злости, вызванной сдерживанием гнева, который не имеет никакого другого выхода.

Markdown-3.1.1/tests/misc/russian.txt0000644000076500000240000000634313212354257020250 0ustar waylanstaff00000000000000Недвард «Нед» Фландерс ====================== **Недвард «Нед» Фландерс** (Nedward «Ned» Flanders) — вымышленный персонаж мультсериала «[Симпсоны][]», озвученный Гарри Ширером. Он и его семья живут по соседству от семьи Симпсонов. Набожный христианин, Нед является одним из столпов морали Спрингфилда. В эпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате несчастного случая. Нед был одним из первых персонажей в мультсериале, который не был членом семьи Симпсонов. Начиная с первых серий, он регулярно появляется в «Симпсонах». Считается, что Нед Фландерс был назван в честь улицы *Northeast Flanders St.* в [Портленде](http://www.portland.gov), Орегон, родном городе создателя мультсериала Мэтта Грейнинга]]. Надпись на указателе улицы *NE Flanders St.* хулиганы часто исправляли на _NED Flanders St._ ## Биография Нед Фландерс родился в Нью-Йорке, его родители были битниками. Его отец в точности похож на взрослого Неда, только он носил козлиную бородку. Их отказ от воспитания Неда и то, что они, в общем-то, были плохими родителями («мы ничего в этом не понимаем и не знаем как начать») привело к тому, что Нед превратился в ужасного сорванца. В конце концов они согласились на экспериментальную восьмимесячную шлепологическую терапию Миннесотского Университета (воспоминания Неда в эпизоде «Hurricane Neddy»), которая научила его подавлять чувство злости. Побочным эфектом терапии стало то, что Нед стал ненавидеть своих родителей (это одна из двух вещей которые ненавидит Фландерс, вторая — отделения почты, чьи длинные очереди, суета и угрюмый персонал раздражают его). У Неда есть странная привычка добавлять «дидли», «дадли» и другие бессмысленные слова в свои фразы при разговоре, например: «Hi-diddly-ho, neighbor-ino» («Приветик, соседушка»). Это результат сублимации его злости, вызванной сдерживанием гнева, который не имеет никакого другого выхода. Markdown-3.1.1/tests/misc/smart_em.html0000644000076500000240000000026213212354257020512 0ustar waylanstaff00000000000000

emphasis

this_is_not_emphasis

[punctuation with emphasis]

[punctuation_with_emphasis]

[punctuation_without_emphasis]

Markdown-3.1.1/tests/misc/smart_em.txt0000644000076500000240000000017713212354257020372 0ustar waylanstaff00000000000000_emphasis_ this_is_not_emphasis [_punctuation with emphasis_] [_punctuation_with_emphasis_] [punctuation_without_emphasis] Markdown-3.1.1/tests/misc/some-test.html0000644000076500000240000000132613212354257020625 0ustar waylanstaff00000000000000
  • as if

  • as if2


  • as if

  • as if2


  • as if non_code
  • as if2

Markdown

  • Python is ok

    • Therefore i am
  • Perl sucks big time

    • But that's ok
  • Python is ok Or not?

Here is a normal paragraph

  1. Another list with a bunch of items
  2. Mostly fruits

    1. Apple
    2. Pare

asdfasdfasd

# This is a code example
import stuff

Another code example
* Lists and similar stuff

> Should be ignored
Markdown-3.1.1/tests/misc/some-test.txt0000644000076500000240000000103113212354257020471 0ustar waylanstaff00000000000000---------------------- * as if * as if2 ---------------------- * as if * as if2 ---------------------- * as if non_code * as if2 Markdown * Python is ok * Therefore i am * Perl sucks big time * But that's ok * Python is ok Or not? Here is a normal paragraph 1. Another list with a bunch of items 2. Mostly fruits 3. Apple 4. Pare asdfasdfasd # This is a code example import stuff Another code example * Lists and similar stuff > Should be ignored Markdown-3.1.1/tests/misc/span.html0000644000076500000240000000025613212354257017647 0ustar waylanstaff00000000000000

Foo bar Baz

*foo*
Foo *bar* Baz

Foo bar Baz

Markdown-3.1.1/tests/misc/span.txt0000644000076500000240000000022713212354257017520 0ustar waylanstaff00000000000000 Foo *bar* Baz
*foo*
Foo *bar* Baz
Foo *bar* Baz Markdown-3.1.1/tests/misc/strong-with-underscores.html0000644000076500000240000000004613212354257023522 0ustar waylanstaff00000000000000

this_is_strong

Markdown-3.1.1/tests/misc/strong-with-underscores.txt0000644000076500000240000000002313212354257023370 0ustar waylanstaff00000000000000__this_is_strong__ Markdown-3.1.1/tests/misc/stronintags.html0000644000076500000240000000034613212354257021261 0ustar waylanstaff00000000000000

this is a test

this is a second test

reference [test][] reference [test][]

Markdown-3.1.1/tests/misc/stronintags.txt0000644000076500000240000000021413212354257021126 0ustar waylanstaff00000000000000this is a [**test**](http://example.com/) this is a second **[test](http://example.com)** reference **[test][]** reference [**test**][] Markdown-3.1.1/tests/misc/tabs-in-lists.html0000644000076500000240000000066213212354257021400 0ustar waylanstaff00000000000000

First a list with a tabbed line

  • A

  • B

Just a blank line:

  • A

  • B

Now a list with 4 spaces and some text:

  • A abcdef
  • B

Now with a tab and an extra space:

  • A

  • B

Now a list with 4 spaces:

  • A

  • B

Markdown-3.1.1/tests/misc/tabs-in-lists.txt0000644000076500000240000000034213212354257021246 0ustar waylanstaff00000000000000First a list with a tabbed line * A * B Just a blank line: * A * B Now a list with 4 spaces and some text: * A abcdef * B Now with a tab and an extra space: * A * B Now a list with 4 spaces: * A * B Markdown-3.1.1/tests/misc/two-spaces.html0000644000076500000240000000064413212354257020774 0ustar waylanstaff00000000000000

This line has two spaces at the end
but this one has none but this line has three
and this is the second from last line in this test message

  • This list item has two spaces.
  • This has none. This line has three.
    This line has none. And this line two.

    This line has none.

  • This line has none.

And this is the end.

Markdown-3.1.1/tests/misc/two-spaces.txt0000644000076500000240000000053213212354257020643 0ustar waylanstaff00000000000000This line has two spaces at the end but this one has none but this line has three and this is the second from last line in this test message * This list item has two spaces. * This has none. This line has three. This line has none. And this line two. This line has none. * This line has none. And this is the end. Markdown-3.1.1/tests/misc/uche.html0000644000076500000240000000045613330711640017626 0ustar waylanstaff00000000000000

asif

Alt text

text

Markdown-3.1.1/tests/misc/uche.txt0000644000076500000240000000031213330711640017470 0ustar waylanstaff00000000000000![asif](http://fourthought.com/images/ftlogo.png "Fourthought logo") [![Alt text](http://fourthought.com/images/ftlogo.png "Fourthought logo")](http://fourthought.com/) [![text](x)](http://link.com/) Markdown-3.1.1/tests/misc/underscores.html0000644000076500000240000000036513432642364021246 0ustar waylanstaff00000000000000

THIS_SHOULD_STAY_AS_IS

Here is some emphasis, ok?

Ok, at least this should work.

THIS__SHOULD__STAY

Here is some strong stuff.

THISSHOULDSTAY?

Markdown-3.1.1/tests/misc/underscores.txt0000644000076500000240000000024213212354257021110 0ustar waylanstaff00000000000000THIS_SHOULD_STAY_AS_IS Here is some _emphasis_, ok? Ok, at least _this_ should work. THIS__SHOULD__STAY Here is some __strong__ stuff. THIS___SHOULD___STAY? Markdown-3.1.1/tests/misc/url_spaces.html0000644000076500000240000000024113212354257021040 0ustar waylanstaff00000000000000

Dawn of War

Dawn of War

Markdown-3.1.1/tests/misc/url_spaces.txt0000644000076500000240000000017213212354257020716 0ustar waylanstaff00000000000000[Dawn of War](http://wikipedia.org/wiki/Dawn of War) [Dawn of War](http://wikipedia.org/wiki/Dawn of War "Dawn of War") Markdown-3.1.1/tests/pl/0000755000076500000240000000000013470647776015516 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/pl/Tests_2004/0000755000076500000240000000000013470647777017266 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/pl/Tests_2004/Amps and angle encoding.html0000644000076500000240000000077113212354257024400 0ustar waylanstaff00000000000000

AT&T has an ampersand in their name.

AT&T is another way to write it.

This & that.

4 < 5.

6 > 5.

Here's a link with an ampersand in the URL.

Here's a link with an amersand in the link text: AT&T.

Here's an inline link.

Here's an inline link.

Markdown-3.1.1/tests/pl/Tests_2004/Auto links.html0000644000076500000240000000104213212354257022140 0ustar waylanstaff00000000000000

Link: http://example.com/.

With an ampersand: http://example.com/?foo=1&bar=2

Blockquoted: http://example.com/

Auto-links should not occur here: <http://example.com/>

or here: <http://example.com/>
Markdown-3.1.1/tests/pl/Tests_2004/Backslash escapes.html0000644000076500000240000000242613212354257023435 0ustar waylanstaff00000000000000

These should all get escaped:

Backslash: \

Backtick: `

Asterisk: *

Underscore: _

Left brace: {

Right brace: }

Left bracket: [

Right bracket: ]

Left paren: (

Right paren: )

Greater-than: >

Hash: #

Period: .

Bang: !

Plus: +

Minus: -

These should not, because they occur within a code block:

Backslash: \\

Backtick: \`

Asterisk: \*

Underscore: \_

Left brace: \{

Right brace: \}

Left bracket: \[

Right bracket: \]

Left paren: \(

Right paren: \)

Greater-than: \>

Hash: \#

Period: \.

Bang: \!

Plus: \+

Minus: \-

Nor should these, which occur in code spans:

Backslash: \\

Backtick: \`

Asterisk: \*

Underscore: \_

Left brace: \{

Right brace: \}

Left bracket: \[

Right bracket: \]

Left paren: \(

Right paren: \)

Greater-than: \>

Hash: \#

Period: \.

Bang: \!

Plus: \+

Minus: \-

Markdown-3.1.1/tests/pl/Tests_2004/Blockquotes with code blocks.html0000644000076500000240000000027213212354257025513 0ustar waylanstaff00000000000000

Example:

sub status {
    print "working";
}

Or:

sub status {
    return "working";
}
Markdown-3.1.1/tests/pl/Tests_2004/Hard-wrapped paragraphs with list-like lines.html0000644000076500000240000000032313212354257030464 0ustar waylanstaff00000000000000

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.

Here's one with a bullet. * criminey.

Markdown-3.1.1/tests/pl/Tests_2004/Horizontal rules.html0000644000076500000240000000066113212354257023401 0ustar waylanstaff00000000000000

Dashes:





---




- - -

Asterisks:





***




* * *

Underscores:





___




_ _ _
Markdown-3.1.1/tests/pl/Tests_2004/Inline HTML (Advanced).html0000644000076500000240000000022413212354257023702 0ustar waylanstaff00000000000000

Simple block on one line:

foo

And nested without indentation:

foo
bar
Markdown-3.1.1/tests/pl/Tests_2004/Inline HTML (Simple).html0000644000076500000240000000142013212354257023425 0ustar waylanstaff00000000000000

Here's a simple block:

foo

This should be a code block, though:

<div>
    foo
</div>

As should this:

<div>foo</div>

Now, nested:

foo

This should just be an HTML comment:

Multiline:

Code block:

<!-- Comment -->

Just plain comment, with trailing spaces on the line:

Code:

<hr />

Hr's:










Markdown-3.1.1/tests/pl/Tests_2004/Inline HTML comments.html0000644000076500000240000000027413212354257023706 0ustar waylanstaff00000000000000

Paragraph one.

Paragraph two.

The end.

Markdown-3.1.1/tests/pl/Tests_2004/Links, inline style.html0000644000076500000240000000043113212354257023644 0ustar waylanstaff00000000000000

Just a URL.

URL and title.

URL and title.

URL and title.

Empty.

Markdown-3.1.1/tests/pl/Tests_2004/Links, reference style.html0000644000076500000240000000062713212354257024333 0ustar waylanstaff00000000000000

Foo bar.

Foo bar.

Foo bar.

With embedded [brackets].

Indented once.

Indented twice.

Indented thrice.

Indented [four][] times.

[four]: /url
Markdown-3.1.1/tests/pl/Tests_2004/Literal quotes in titles.html0000644000076500000240000000024313212354257024702 0ustar waylanstaff00000000000000

Foo bar.

Foo bar.

Markdown-3.1.1/tests/pl/Tests_2004/Markdown Documentation - Basics.html0000644000076500000240000002225013212354257026011 0ustar waylanstaff00000000000000

Markdown: Basics

Getting the Gist of Markdown's Formatting Syntax

This page offers a brief overview of what it's like to use Markdown. The syntax page provides complete, detailed documentation for every feature, but Markdown should be very easy to pick up simply by looking at a few examples of it in action. The examples on this page are written in a before/after style, showing example syntax and the HTML output produced by Markdown.

It's also helpful to simply try Markdown out; the Dingus is a web application that allows you type your own Markdown-formatted text and translate it to XHTML.

Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.

Paragraphs, Headers, Blockquotes

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 spaces or tabs is considered blank.) Normal paragraphs should not be intended with spaces or tabs.

Markdown offers two styles of headers: Setext and atx. Setext-style headers for <h1> and <h2> are created by "underlining" with equal signs (=) and hyphens (-), respectively. To create an atx-style header, you put 1-6 hash marks (#) at the beginning of the line -- the number of hashes equals the resulting HTML header level.

Blockquotes are indicated using email-style '>' angle brackets.

Markdown:

A First Level Header
====================

A Second Level Header
---------------------

Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.

The quick brown fox jumped over the lazy
dog's back.

### Header 3

> This is a blockquote.
> 
> This is the second paragraph in the blockquote.
>
> ## This is an H2 in a blockquote

Output:

<h1>A First Level Header</h1>

<h2>A Second Level Header</h2>

<p>Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.</p>

<p>The quick brown fox jumped over the lazy
dog's back.</p>

<h3>Header 3</h3>

<blockquote>
    <p>This is a blockquote.</p>

    <p>This is the second paragraph in the blockquote.</p>

    <h2>This is an H2 in a blockquote</h2>
</blockquote>

Phrase Emphasis

Markdown uses asterisks and underscores to indicate spans of emphasis.

Markdown:

Some of these words *are emphasized*.
Some of these words _are emphasized also_.

Use two asterisks for **strong emphasis**.
Or, if you prefer, __use two underscores instead__.

Output:

<p>Some of these words <em>are emphasized</em>.
Some of these words <em>are emphasized also</em>.</p>

<p>Use two asterisks for <strong>strong emphasis</strong>.
Or, if you prefer, <strong>use two underscores instead</strong>.</p>

Lists

Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, +, and -) as list markers. These three markers are interchangable; this:

*   Candy.
*   Gum.
*   Booze.

this:

+   Candy.
+   Gum.
+   Booze.

and this:

-   Candy.
-   Gum.
-   Booze.

all produce the same output:

<ul>
<li>Candy.</li>
<li>Gum.</li>
<li>Booze.</li>
</ul>

Ordered (numbered) lists use regular numbers, followed by periods, as list markers:

1.  Red
2.  Green
3.  Blue

Output:

<ol>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ol>

If you put blank lines between items, you'll get <p> tags for the list item text. You can create multi-paragraph list items by indenting the paragraphs by 4 spaces or 1 tab:

*   A list item.

    With multiple paragraphs.

*   Another item in the list.

Output:

<ul>
<li><p>A list item.</p>
<p>With multiple paragraphs.</p></li>
<li><p>Another item in the list.</p></li>
</ul>

Links

Markdown supports two styles for creating links: inline and reference. With both styles, you use square brackets to delimit the text you want to turn into a link.

Inline-style links use parentheses immediately after the link text. For example:

This is an [example link](http://example.com/).

Output:

<p>This is an <a href="http://example.com/">
example link</a>.</p>

Optionally, you may include a title attribute in the parentheses:

This is an [example link](http://example.com/ "With a Title").

Output:

<p>This is an <a href="http://example.com/" title="With a Title">
example link</a>.</p>

Reference-style links allow you to refer to your links by names, which you define elsewhere in your document:

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"

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>

The title attribute is optional. Link names may contain letters, numbers and spaces, but are not case sensitive:

I start my morning with a cup of coffee and
[The New York Times][NY Times].

[ny times]: http://www.nytimes.com/

Output:

<p>I start my morning with a cup of coffee and
<a href="http://www.nytimes.com/">The New York Times</a>.</p>

Images

Image syntax is very much like link syntax.

Inline (titles are optional):

![alt text](/path/to/img.jpg "Title")

Reference-style:

![alt text][id]

[id]: /path/to/img.jpg "Title"

Both of the above examples produce the same output:

<img src="/path/to/img.jpg" alt="alt text" title="Title" />

Code

In a regular paragraph, you can create code span by wrapping text in backtick quotes. Any ampersands (&) and angle brackets (< or >) will automatically be translated into HTML entities. This makes it easy to use Markdown to write about HTML example code:

I strongly recommend against using any `<blink>` tags.

I wish SmartyPants used named entities like `&mdash;`
instead of decimal-encoded entites like `&#8212;`.

Output:

<p>I strongly recommend against using any
<code>&lt;blink&gt;</code> tags.</p>

<p>I wish SmartyPants used named entities like
<code>&amp;mdash;</code> instead of decimal-encoded
entites like <code>&amp;#8212;</code>.</p>

To specify an entire block of pre-formatted code, indent every line of the block by 4 spaces or 1 tab. Just like with code spans, &, <, and > characters will be escaped automatically.

Markdown:

If you want your page to validate under XHTML 1.0 Strict,
you've got to put paragraph tags in your blockquotes:

    <blockquote>
        <p>For example.</p>
    </blockquote>

Output:

<p>If you want your page to validate under XHTML 1.0 Strict,
you've got to put paragraph tags in your blockquotes:</p>

<pre><code>&lt;blockquote&gt;
    &lt;p&gt;For example.&lt;/p&gt;
&lt;/blockquote&gt;
</code></pre>
Markdown-3.1.1/tests/pl/Tests_2004/Markdown Documentation - Syntax.html0000644000076500000240000007605113212354257026103 0ustar waylanstaff00000000000000

Markdown: Syntax

Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


Overview

Philosophy

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, atx, Textile, reStructuredText, Grutatext, and EtText -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email.

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.

Inline HTML

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.

Automatic Escaping for Special Characters

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, 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.)


Block Elements

Paragraphs and Line Breaks

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 intended 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 and multi-paragraph list items work best -- and look better -- when you format them with hard breaks.

Markdown supports two styles of headers, Setext and atx.

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 ######

Blockquotes

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.

Lists

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 intended 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.

Code Blocks

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.

Horizontal Rules

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:

* * *

***

*****

- - -

---------------------------------------

_ _ _

Span Elements

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.

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 constist 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.

Emphasis

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*fucking*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\*

Code

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>

Images

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.


Miscellaneous

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.)

Backslash Escapes

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 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
Markdown-3.1.1/tests/pl/Tests_2004/Nested blockquotes.html0000644000076500000240000000015113212354257023665 0ustar waylanstaff00000000000000

foo

bar

foo

Markdown-3.1.1/tests/pl/Tests_2004/Ordered and unordered lists.html0000644000076500000240000000306213212354257025331 0ustar waylanstaff00000000000000

Unordered

Asterisks tight:

  • asterisk 1
  • asterisk 2
  • asterisk 3

Asterisks loose:

  • asterisk 1

  • asterisk 2

  • asterisk 3


Pluses tight:

  • Plus 1
  • Plus 2
  • Plus 3

Pluses loose:

  • Plus 1

  • Plus 2

  • Plus 3


Minuses tight:

  • Minus 1
  • Minus 2
  • Minus 3

Minuses loose:

  • Minus 1

  • Minus 2

  • Minus 3

Ordered

Tight:

  1. First
  2. Second
  3. Third

and:

  1. One
  2. Two
  3. Three

Loose using tabs:

  1. First

  2. Second

  3. Third

and using spaces:

  1. One

  2. Two

  3. Three

Multiple paragraphs:

  1. Item 1, graf one.

    Item 2. graf two. The quick brown fox jumped over the lazy dog's back.

  2. Item 2.

  3. Item 3.

Nested

  • Tab
    • Tab
      • Tab

Here's another:

  1. First
  2. Second:
    • Fee
    • Fie
    • Foe
  3. Third

Same thing but with paragraphs:

  1. First

  2. Second:

    • Fee
    • Fie
    • Foe
  3. Third

Markdown-3.1.1/tests/pl/Tests_2004/Strong and em together.html0000644000076500000240000000032713212354257024317 0ustar waylanstaff00000000000000

This is strong and em.

So is this word.

This is strong and em.

So is this word.

Markdown-3.1.1/tests/pl/Tests_2004/Tabs.html0000644000076500000240000000066713212354257021034 0ustar waylanstaff00000000000000
  • this is a list item indented with tabs

  • this is a list item indented with spaces

Code:

this code block is indented by one tab

And:

    this code block is indented by two tabs

And:

+   this is an example list item
    indented with tabs

+   this is an example list item
    indented with spaces
Markdown-3.1.1/tests/pl/Tests_2004/Tidyness.html0000644000076500000240000000020513212354257021731 0ustar waylanstaff00000000000000

A list within a blockquote:

  • asterisk 1
  • asterisk 2
  • asterisk 3
Markdown-3.1.1/tests/pl/Tests_2004/Yuri-Attributes.html0000644000076500000240000000151113212354257023204 0ustar waylanstaff00000000000000

Lorem ipsum

Dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

  • Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur2. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Markdown-3.1.1/tests/pl/Tests_2004/Yuri-Email.html0000644000076500000240000000112713212354257022110 0ustar waylanstaff00000000000000

Lorem ipsum yuri@domain.org, etc.

Markdown-3.1.1/tests/pl/Tests_2004/Yuri-Footnotes.html0000644000076500000240000000435613212354257023050 0ustar waylanstaff00000000000000

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua1. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur2. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore3 magna aliqua.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


  1. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
  2. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

    Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.

  3. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Markdown-3.1.1/tests/pl/Tests_2004/Yuri-Links-in-Headers.html0000644000076500000240000000046513212354257024122 0ustar waylanstaff00000000000000

A plain header

Let's first have a plain header

An underlined header

(That's also useful)

A header with a link

First with a hash

Another with a link

This time underlined

Markdown-3.1.1/tests/pl/Tests_2007/0000755000076500000240000000000013470647777017271 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/pl/Tests_2007/Amps and angle encoding.html0000644000076500000240000000077113212354257024403 0ustar waylanstaff00000000000000

AT&T has an ampersand in their name.

AT&T is another way to write it.

This & that.

4 < 5.

6 > 5.

Here's a link with an ampersand in the URL.

Here's a link with an amersand in the link text: AT&T.

Here's an inline link.

Here's an inline link.

Markdown-3.1.1/tests/pl/Tests_2007/Auto links.html0000644000076500000240000000104213212354257022143 0ustar waylanstaff00000000000000

Link: http://example.com/.

With an ampersand: http://example.com/?foo=1&bar=2

Blockquoted: http://example.com/

Auto-links should not occur here: <http://example.com/>

or here: <http://example.com/>
Markdown-3.1.1/tests/pl/Tests_2007/Backslash escapes.html0000644000076500000240000000326113212354257023436 0ustar waylanstaff00000000000000

These should all get escaped:

Backslash: \

Backtick: `

Asterisk: *

Underscore: _

Left brace: {

Right brace: }

Left bracket: [

Right bracket: ]

Left paren: (

Right paren: )

Greater-than: >

Hash: #

Period: .

Bang: !

Plus: +

Minus: -

These should not, because they occur within a code block:

Backslash: \\

Backtick: \`

Asterisk: \*

Underscore: \_

Left brace: \{

Right brace: \}

Left bracket: \[

Right bracket: \]

Left paren: \(

Right paren: \)

Greater-than: \>

Hash: \#

Period: \.

Bang: \!

Plus: \+

Minus: \-

Nor should these, which occur in code spans:

Backslash: \\

Backtick: \`

Asterisk: \*

Underscore: \_

Left brace: \{

Right brace: \}

Left bracket: \[

Right bracket: \]

Left paren: \(

Right paren: \)

Greater-than: \>

Hash: \#

Period: \.

Bang: \!

Plus: \+

Minus: \-

These should get escaped, even though they're matching pairs for other Markdown constructs:

*asterisks*

_underscores_

`backticks`

This is a code span with a literal backslash-backtick sequence: \`

This is a tag with unescaped backticks bar.

This is a tag with backslashes bar.

Markdown-3.1.1/tests/pl/Tests_2007/Blockquotes with code blocks.html0000644000076500000240000000027213212354257025516 0ustar waylanstaff00000000000000

Example:

sub status {
    print "working";
}

Or:

sub status {
    return "working";
}
Markdown-3.1.1/tests/pl/Tests_2007/Code Blocks.html0000644000076500000240000000047013212354257022206 0ustar waylanstaff00000000000000
code block on the first line

Regular text.

code block indented by spaces

Regular text.

the lines in this block  
all contain trailing spaces  

Regular Text.

code block on the last line
Markdown-3.1.1/tests/pl/Tests_2007/Code Spans.html0000644000076500000240000000033613212354257022056 0ustar waylanstaff00000000000000

<test a=" content of attribute ">

Fix for backticks within HTML tag: like this

Here's how you put `backticks` in a code span.

Markdown-3.1.1/tests/pl/Tests_2007/Hard-wrapped paragraphs with list-like lines.html0000644000076500000240000000032313212354257030467 0ustar waylanstaff00000000000000

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.

Here's one with a bullet. * criminey.

Markdown-3.1.1/tests/pl/Tests_2007/Horizontal rules.html0000644000076500000240000000066113212354257023404 0ustar waylanstaff00000000000000

Dashes:





---




- - -

Asterisks:





***




* * *

Underscores:





___




_ _ _
Markdown-3.1.1/tests/pl/Tests_2007/Images.html0000644000076500000240000000131613212354257021343 0ustar waylanstaff00000000000000

Alt text

Alt text

Inline within a paragraph: alt text.

alt text

alt text

alt text

alt text.

Empty

this is a stupid URL

alt text

alt text

Markdown-3.1.1/tests/pl/Tests_2007/Inline HTML (Advanced).html0000644000076500000240000000053213212354257023707 0ustar waylanstaff00000000000000

Simple block on one line:

foo

And nested without indentation:

foo
bar

And with attributes:

This was broken in 1.0.2b7:

foo
Markdown-3.1.1/tests/pl/Tests_2007/Inline HTML (Simple).html0000644000076500000240000000142013212354257023430 0ustar waylanstaff00000000000000

Here's a simple block:

foo

This should be a code block, though:

<div>
    foo
</div>

As should this:

<div>foo</div>

Now, nested:

foo

This should just be an HTML comment:

Multiline:

Code block:

<!-- Comment -->

Just plain comment, with trailing spaces on the line:

Code:

<hr />

Hr's:










Markdown-3.1.1/tests/pl/Tests_2007/Inline HTML comments.html0000644000076500000240000000027413212354257023711 0ustar waylanstaff00000000000000

Paragraph one.

Paragraph two.

The end.

Markdown-3.1.1/tests/pl/Tests_2007/Links, inline style.html0000644000076500000240000000147413212354257023657 0ustar waylanstaff00000000000000

Just a URL.

URL and title.

URL and title.

URL and title.

URL and title.

URL wrapped in angle brackets.

URL w/ angle brackets + title.

Empty.

With parens in the URL

(With outer parens and parens in url)

With parens in the URL

(With outer parens and parens in url)

Markdown-3.1.1/tests/pl/Tests_2007/Links, reference style.html0000644000076500000240000000214513212354257024333 0ustar waylanstaff00000000000000

Foo bar.

Foo bar.

Foo bar.

With embedded [brackets].

Indented once.

Indented twice.

Indented thrice.

Indented [four][] times.

[four]: /url

this should work

So should this.

And this.

And this.

And this.

But not [that] [].

Nor [that][].

Nor [that].

[Something in brackets like this should work]

[Same with this.]

In this case, this points to something else.

Backslashing should suppress [this] and [this].


Here's one where the link breaks across lines.

Here's another where the link breaks across lines, but with a line-ending space.

Markdown-3.1.1/tests/pl/Tests_2007/Links, shortcut references.html0000644000076500000240000000040013212354257025221 0ustar waylanstaff00000000000000

This is the simple case.

This one has a line break.

This one has a line break with a line-ending space.

this and the other

Markdown-3.1.1/tests/pl/Tests_2007/Literal quotes in titles.html0000644000076500000240000000024313212354257024705 0ustar waylanstaff00000000000000

Foo bar.

Foo bar.

Markdown-3.1.1/tests/pl/Tests_2007/Markdown Documentation - Basics.html0000644000076500000240000002225013212354257026014 0ustar waylanstaff00000000000000

Markdown: Basics

Getting the Gist of Markdown's Formatting Syntax

This page offers a brief overview of what it's like to use Markdown. The syntax page provides complete, detailed documentation for every feature, but Markdown should be very easy to pick up simply by looking at a few examples of it in action. The examples on this page are written in a before/after style, showing example syntax and the HTML output produced by Markdown.

It's also helpful to simply try Markdown out; the Dingus is a web application that allows you type your own Markdown-formatted text and translate it to XHTML.

Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.

Paragraphs, Headers, Blockquotes

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 spaces or tabs is considered blank.) Normal paragraphs should not be intended with spaces or tabs.

Markdown offers two styles of headers: Setext and atx. Setext-style headers for <h1> and <h2> are created by "underlining" with equal signs (=) and hyphens (-), respectively. To create an atx-style header, you put 1-6 hash marks (#) at the beginning of the line -- the number of hashes equals the resulting HTML header level.

Blockquotes are indicated using email-style '>' angle brackets.

Markdown:

A First Level Header
====================

A Second Level Header
---------------------

Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.

The quick brown fox jumped over the lazy
dog's back.

### Header 3

> This is a blockquote.
> 
> This is the second paragraph in the blockquote.
>
> ## This is an H2 in a blockquote

Output:

<h1>A First Level Header</h1>

<h2>A Second Level Header</h2>

<p>Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.</p>

<p>The quick brown fox jumped over the lazy
dog's back.</p>

<h3>Header 3</h3>

<blockquote>
    <p>This is a blockquote.</p>

    <p>This is the second paragraph in the blockquote.</p>

    <h2>This is an H2 in a blockquote</h2>
</blockquote>

Phrase Emphasis

Markdown uses asterisks and underscores to indicate spans of emphasis.

Markdown:

Some of these words *are emphasized*.
Some of these words _are emphasized also_.

Use two asterisks for **strong emphasis**.
Or, if you prefer, __use two underscores instead__.

Output:

<p>Some of these words <em>are emphasized</em>.
Some of these words <em>are emphasized also</em>.</p>

<p>Use two asterisks for <strong>strong emphasis</strong>.
Or, if you prefer, <strong>use two underscores instead</strong>.</p>

Lists

Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, +, and -) as list markers. These three markers are interchangable; this:

*   Candy.
*   Gum.
*   Booze.

this:

+   Candy.
+   Gum.
+   Booze.

and this:

-   Candy.
-   Gum.
-   Booze.

all produce the same output:

<ul>
<li>Candy.</li>
<li>Gum.</li>
<li>Booze.</li>
</ul>

Ordered (numbered) lists use regular numbers, followed by periods, as list markers:

1.  Red
2.  Green
3.  Blue

Output:

<ol>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ol>

If you put blank lines between items, you'll get <p> tags for the list item text. You can create multi-paragraph list items by indenting the paragraphs by 4 spaces or 1 tab:

*   A list item.

    With multiple paragraphs.

*   Another item in the list.

Output:

<ul>
<li><p>A list item.</p>
<p>With multiple paragraphs.</p></li>
<li><p>Another item in the list.</p></li>
</ul>

Links

Markdown supports two styles for creating links: inline and reference. With both styles, you use square brackets to delimit the text you want to turn into a link.

Inline-style links use parentheses immediately after the link text. For example:

This is an [example link](http://example.com/).

Output:

<p>This is an <a href="http://example.com/">
example link</a>.</p>

Optionally, you may include a title attribute in the parentheses:

This is an [example link](http://example.com/ "With a Title").

Output:

<p>This is an <a href="http://example.com/" title="With a Title">
example link</a>.</p>

Reference-style links allow you to refer to your links by names, which you define elsewhere in your document:

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"

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>

The title attribute is optional. Link names may contain letters, numbers and spaces, but are not case sensitive:

I start my morning with a cup of coffee and
[The New York Times][NY Times].

[ny times]: http://www.nytimes.com/

Output:

<p>I start my morning with a cup of coffee and
<a href="http://www.nytimes.com/">The New York Times</a>.</p>

Images

Image syntax is very much like link syntax.

Inline (titles are optional):

![alt text](/path/to/img.jpg "Title")

Reference-style:

![alt text][id]

[id]: /path/to/img.jpg "Title"

Both of the above examples produce the same output:

<img src="/path/to/img.jpg" alt="alt text" title="Title" />

Code

In a regular paragraph, you can create code span by wrapping text in backtick quotes. Any ampersands (&) and angle brackets (< or >) will automatically be translated into HTML entities. This makes it easy to use Markdown to write about HTML example code:

I strongly recommend against using any `<blink>` tags.

I wish SmartyPants used named entities like `&mdash;`
instead of decimal-encoded entites like `&#8212;`.

Output:

<p>I strongly recommend against using any
<code>&lt;blink&gt;</code> tags.</p>

<p>I wish SmartyPants used named entities like
<code>&amp;mdash;</code> instead of decimal-encoded
entites like <code>&amp;#8212;</code>.</p>

To specify an entire block of pre-formatted code, indent every line of the block by 4 spaces or 1 tab. Just like with code spans, &, <, and > characters will be escaped automatically.

Markdown:

If you want your page to validate under XHTML 1.0 Strict,
you've got to put paragraph tags in your blockquotes:

    <blockquote>
        <p>For example.</p>
    </blockquote>

Output:

<p>If you want your page to validate under XHTML 1.0 Strict,
you've got to put paragraph tags in your blockquotes:</p>

<pre><code>&lt;blockquote&gt;
    &lt;p&gt;For example.&lt;/p&gt;
&lt;/blockquote&gt;
</code></pre>
Markdown-3.1.1/tests/pl/Tests_2007/Markdown Documentation - Syntax.html0000644000076500000240000007605113212354257026106 0ustar waylanstaff00000000000000

Markdown: Syntax

Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


Overview

Philosophy

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, atx, Textile, reStructuredText, Grutatext, and EtText -- the single biggest source of inspiration for Markdown's syntax is the format of plain text email.

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.

Inline HTML

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.

Automatic Escaping for Special Characters

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, 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.)


Block Elements

Paragraphs and Line Breaks

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 intended 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 and multi-paragraph list items work best -- and look better -- when you format them with hard breaks.

Markdown supports two styles of headers, Setext and atx.

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 ######

Blockquotes

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.

Lists

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 intended 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.

Code Blocks

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.

Horizontal Rules

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:

* * *

***

*****

- - -

---------------------------------------

_ _ _

Span Elements

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.

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 constist 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.

Emphasis

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*fucking*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\*

Code

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>

Images

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.


Miscellaneous

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.)

Backslash Escapes

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 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
Markdown-3.1.1/tests/pl/Tests_2007/Nested blockquotes.html0000644000076500000240000000015113212354257023670 0ustar waylanstaff00000000000000

foo

bar

foo

Markdown-3.1.1/tests/pl/Tests_2007/Ordered and unordered lists.html0000644000076500000240000000324513212354257025337 0ustar waylanstaff00000000000000

Unordered

Asterisks tight:

  • asterisk 1
  • asterisk 2
  • asterisk 3

Asterisks loose:

  • asterisk 1

  • asterisk 2

  • asterisk 3


Pluses tight:

  • Plus 1
  • Plus 2
  • Plus 3

Pluses loose:

  • Plus 1

  • Plus 2

  • Plus 3


Minuses tight:

  • Minus 1
  • Minus 2
  • Minus 3

Minuses loose:

  • Minus 1

  • Minus 2

  • Minus 3

Ordered

Tight:

  1. First
  2. Second
  3. Third

and:

  1. One
  2. Two
  3. Three

Loose using tabs:

  1. First

  2. Second

  3. Third

and using spaces:

  1. One

  2. Two

  3. Three

Multiple paragraphs:

  1. Item 1, graf one.

    Item 2. graf two. The quick brown fox jumped over the lazy dog's back.

  2. Item 2.

  3. Item 3.

Nested

  • Tab
    • Tab
      • Tab

Here's another:

  1. First
  2. Second:
    • Fee
    • Fie
    • Foe
  3. Third

Same thing but with paragraphs:

  1. First

  2. Second:

    • Fee
    • Fie
    • Foe
  3. Third

This was an error in Markdown 1.0.1:

  • this

    • sub

    that

Markdown-3.1.1/tests/pl/Tests_2007/Strong and em together.html0000644000076500000240000000032713212354257024322 0ustar waylanstaff00000000000000

This is strong and em.

So is this word.

This is strong and em.

So is this word.

Markdown-3.1.1/tests/pl/Tests_2007/Tabs.html0000644000076500000240000000066713212354257021037 0ustar waylanstaff00000000000000
  • this is a list item indented with tabs

  • this is a list item indented with spaces

Code:

this code block is indented by one tab

And:

    this code block is indented by two tabs

And:

+   this is an example list item
    indented with tabs

+   this is an example list item
    indented with spaces
Markdown-3.1.1/tests/pl/Tests_2007/Tidyness.html0000644000076500000240000000020513212354257021734 0ustar waylanstaff00000000000000

A list within a blockquote:

  • asterisk 1
  • asterisk 2
  • asterisk 3
Markdown-3.1.1/tests/test_apis.py0000644000076500000240000011160113432642364017432 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). Python-Markdown Regression Tests ================================ Tests of the various APIs with the python markdown lib. """ from __future__ import unicode_literals import unittest import sys import os import markdown import warnings from markdown.__main__ import parse_options from logging import DEBUG, WARNING, CRITICAL import yaml import tempfile from io import BytesIO from xml.etree.ElementTree import ProcessingInstruction PY3 = sys.version_info[0] == 3 if not PY3: def bytes(string, encoding): return string.encode(encoding) class TestMarkdownBasics(unittest.TestCase): """ Tests basics of the Markdown class. """ def setUp(self): """ Create instance of Markdown. """ self.md = markdown.Markdown() def testBlankInput(self): """ Test blank input. """ self.assertEqual(self.md.convert(''), '') def testWhitespaceOnly(self): """ Test input of only whitespace. """ self.assertEqual(self.md.convert(' '), '') def testSimpleInput(self): """ Test simple input. """ self.assertEqual(self.md.convert('foo'), '

foo

') def testInstanceExtension(self): """ Test Extension loading with a class instance. """ from markdown.extensions.footnotes import FootnoteExtension markdown.Markdown(extensions=[FootnoteExtension()]) def testEntryPointExtension(self): """ Test Extension loading with an entry point. """ markdown.Markdown(extensions=['footnotes']) def testDotNotationExtension(self): """ Test Extension loading with Name (`path.to.module`). """ markdown.Markdown(extensions=['markdown.extensions.footnotes']) def testDotNotationExtensionWithClass(self): """ Test Extension loading with class name (`path.to.module:Class`). """ markdown.Markdown(extensions=['markdown.extensions.footnotes:FootnoteExtension']) class TestConvertFile(unittest.TestCase): """ Tests of ConvertFile. """ def setUp(self): self.saved = sys.stdin, sys.stdout sys.stdin = BytesIO(bytes('foo', encoding='utf-8')) sys.stdout = BytesIO() def tearDown(self): sys.stdin, sys.stdout = self.saved def getTempFiles(self, src): """ Return the file names for two temp files. """ infd, infile = tempfile.mkstemp(suffix='.txt') with os.fdopen(infd, 'w') as fp: fp.write(src) outfd, outfile = tempfile.mkstemp(suffix='.html') return infile, outfile, outfd def testFileNames(self): infile, outfile, outfd = self.getTempFiles('foo') markdown.markdownFromFile(input=infile, output=outfile) with os.fdopen(outfd, 'r') as fp: output = fp.read() self.assertEqual(output, '

foo

') def testFileObjects(self): infile = BytesIO(bytes('foo', encoding='utf-8')) outfile = BytesIO() markdown.markdownFromFile(input=infile, output=outfile) outfile.seek(0) self.assertEqual(outfile.read().decode('utf-8'), '

foo

') def testStdinStdout(self): markdown.markdownFromFile() sys.stdout.seek(0) self.assertEqual(sys.stdout.read().decode('utf-8'), '

foo

') class TestBlockParser(unittest.TestCase): """ Tests of the BlockParser class. """ def setUp(self): """ Create instance of BlockParser. """ self.parser = markdown.Markdown().parser def testParseChunk(self): """ Test BlockParser.parseChunk. """ root = markdown.util.etree.Element("div") text = 'foo' self.parser.parseChunk(root, text) self.assertEqual( markdown.serializers.to_xhtml_string(root), "

foo

" ) def testParseDocument(self): """ Test BlockParser.parseDocument. """ lines = ['#foo', '', 'bar', '', ' baz'] tree = self.parser.parseDocument(lines) self.assertTrue(isinstance(tree, markdown.util.etree.ElementTree)) self.assertTrue(markdown.util.etree.iselement(tree.getroot())) self.assertEqual( markdown.serializers.to_xhtml_string(tree.getroot()), "

foo

bar

baz\n
" ) class TestBlockParserState(unittest.TestCase): """ Tests of the State class for BlockParser. """ def setUp(self): self.state = markdown.blockparser.State() def testBlankState(self): """ Test State when empty. """ self.assertEqual(self.state, []) def testSetSate(self): """ Test State.set(). """ self.state.set('a_state') self.assertEqual(self.state, ['a_state']) self.state.set('state2') self.assertEqual(self.state, ['a_state', 'state2']) def testIsSate(self): """ Test State.isstate(). """ self.assertEqual(self.state.isstate('anything'), False) self.state.set('a_state') self.assertEqual(self.state.isstate('a_state'), True) self.state.set('state2') self.assertEqual(self.state.isstate('state2'), True) self.assertEqual(self.state.isstate('a_state'), False) self.assertEqual(self.state.isstate('missing'), False) def testReset(self): """ Test State.reset(). """ self.state.set('a_state') self.state.reset() self.assertEqual(self.state, []) self.state.set('state1') self.state.set('state2') self.state.reset() self.assertEqual(self.state, ['state1']) class TestHtmlStash(unittest.TestCase): """ Test Markdown's HtmlStash. """ def setUp(self): self.stash = markdown.util.HtmlStash() self.placeholder = self.stash.store('foo') def testSimpleStore(self): """ Test HtmlStash.store. """ self.assertEqual(self.placeholder, self.stash.get_placeholder(0)) self.assertEqual(self.stash.html_counter, 1) self.assertEqual(self.stash.rawHtmlBlocks, ['foo']) def testStoreMore(self): """ Test HtmlStash.store with additional blocks. """ placeholder = self.stash.store('bar') self.assertEqual(placeholder, self.stash.get_placeholder(1)) self.assertEqual(self.stash.html_counter, 2) self.assertEqual( self.stash.rawHtmlBlocks, ['foo', 'bar'] ) def testReset(self): """ Test HtmlStash.reset. """ self.stash.reset() self.assertEqual(self.stash.html_counter, 0) self.assertEqual(self.stash.rawHtmlBlocks, []) class Item(object): """ A dummy Registry item object for testing. """ def __init__(self, data): self.data = data def __repr__(self): return repr(self.data) def __eq__(self, other): return self.data == other class RegistryTests(unittest.TestCase): """ Test the processor registry. """ def testCreateRegistry(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) self.assertEqual(len(r), 1) self.assertTrue(isinstance(r, markdown.util.Registry)) def testRegisterWithoutPriority(self): r = markdown.util.Registry() with self.assertRaises(TypeError): r.register(Item('a')) def testSortRegistry(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) r.register(Item('b'), 'b', 21) r.register(Item('c'), 'c', 20.5) self.assertEqual(len(r), 3) self.assertEqual(list(r), ['b', 'c', 'a']) def testIsSorted(self): r = markdown.util.Registry() self.assertFalse(r._is_sorted) r.register(Item('a'), 'a', 20) list(r) self.assertTrue(r._is_sorted) r.register(Item('b'), 'b', 21) self.assertFalse(r._is_sorted) r['a'] self.assertTrue(r._is_sorted) r._is_sorted = False r.get_index_for_name('a') self.assertTrue(r._is_sorted) r._is_sorted = False repr(r) self.assertTrue(r._is_sorted) def testDeregister(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) r.register(Item('b'), 'b', 30) r.register(Item('c'), 'c', 40) self.assertEqual(len(r), 3) r.deregister('b') self.assertEqual(len(r), 2) r.deregister('c', strict=False) self.assertEqual(len(r), 1) # deregister non-existant item with strict=False r.deregister('d', strict=False) self.assertEqual(len(r), 1) with self.assertRaises(ValueError): # deregister non-existant item with strict=True r.deregister('e') self.assertEqual(list(r), ['a']) def testRegistryContains(self): r = markdown.util.Registry() item = Item('a') r.register(item, 'a', 20) self.assertTrue('a' in r) self.assertTrue(item in r) self.assertFalse('b' in r) def testRegistryIter(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) r.register(Item('b'), 'b', 30) self.assertEqual(list(r), ['b', 'a']) def testRegistryGetItemByIndex(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) r.register(Item('b'), 'b', 30) self.assertEqual(r[0], 'b') self.assertEqual(r[1], 'a') with self.assertRaises(IndexError): r[3] def testRegistryGetItemByItem(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) r.register(Item('b'), 'b', 30) self.assertEqual(r['a'], 'a') self.assertEqual(r['b'], 'b') with self.assertRaises(KeyError): r['c'] def testRegistrySetItem(self): r = markdown.util.Registry() with self.assertRaises(TypeError): r[0] = 'a' # TODO: restore this when deprecated __setitem__ is removed. # with self.assertRaises(TypeError): # r['a'] = 'a' # TODO: remove this when deprecated __setitem__ is removed. with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") r['a'] = Item('a') self.assertEqual(list(r), ['a']) r['b'] = Item('b') self.assertEqual(list(r), ['a', 'b']) r['a'] = Item('a1') self.assertEqual(list(r), ['a1', 'b']) # Check the warnings self.assertEqual(len(w), 3) self.assertTrue(all(issubclass(x.category, DeprecationWarning) for x in w)) def testRegistryDelItem(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) with self.assertRaises(TypeError): del r[0] # TODO: restore this when deprecated __del__ is removed. # with self.assertRaises(TypeError): # del r['a'] # TODO: remove this when deprecated __del__ is removed. with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") r.register(Item('b'), 'b', 15) r.register(Item('c'), 'c', 10) del r['b'] self.assertEqual(list(r), ['a', 'c']) del r['a'] self.assertEqual(list(r), ['c']) with self.assertRaises(TypeError): del r['badname'] del r['c'] self.assertEqual(list(r), []) # Check the warnings self.assertEqual(len(w), 3) self.assertTrue(all(issubclass(x.category, DeprecationWarning) for x in w)) def testRegistrySlice(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) r.register(Item('b'), 'b', 30) r.register(Item('c'), 'c', 40) slc = r[1:] self.assertEqual(len(slc), 2) self.assertTrue(isinstance(slc, markdown.util.Registry)) self.assertEqual(list(slc), ['b', 'a']) def testGetIndexForName(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) r.register(Item('b'), 'b', 30) self.assertEqual(r.get_index_for_name('a'), 1) self.assertEqual(r.get_index_for_name('b'), 0) with self.assertRaises(ValueError): r.get_index_for_name('c') def testRegisterDupplicate(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) r.register(Item('b1'), 'b', 10) self.assertEqual(list(r), ['a', 'b1']) self.assertEqual(len(r), 2) r.register(Item('b2'), 'b', 30) self.assertEqual(len(r), 2) self.assertEqual(list(r), ['b2', 'a']) def testRegistryDeprecatedAdd(self): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") r = markdown.util.Registry() # Add first item r.add('c', Item('c'), '_begin') self.assertEqual(list(r), ['c']) # Added to beginning r.add('b', Item('b'), '_begin') self.assertEqual(list(r), ['b', 'c']) # Add before first item r.add('a', Item('a'), 'b') self.assertEqual(list(r), ['a', 'a1', 'b', 'b1', 'c']) # Add after last item r.add('d', Item('d'), '>c') self.assertEqual(list(r), ['a', 'a1', 'b', 'b1', 'c', 'd']) # Add to end r.add('e', Item('e'), '_end') self.assertEqual(list(r), ['a', 'a1', 'b', 'b1', 'c', 'd', 'e']) with self.assertRaises(ValueError): r.add('f', Item('f'), 'badlocation') # Check the warnings self.assertEqual(len(w), 7) self.assertTrue(all(issubclass(x.category, DeprecationWarning) for x in w)) class TestErrors(unittest.TestCase): """ Test Error Reporting. """ def setUp(self): # Set warnings to be raised as errors warnings.simplefilter('error') def tearDown(self): # Reset warning behavior back to default warnings.simplefilter('default') def testNonUnicodeSource(self): """ Test falure on non-unicode source text. """ if not PY3: source = "foo".encode('utf-16') self.assertRaises(UnicodeDecodeError, markdown.markdown, source) def testBadOutputFormat(self): """ Test failure on bad output_format. """ self.assertRaises(KeyError, markdown.Markdown, output_format='invalid') def testLoadExtensionFailure(self): """ Test failure of an extension to load. """ self.assertRaises( ImportError, markdown.Markdown, extensions=['non_existant_ext'] ) def testLoadBadExtension(self): """ Test loading of an Extension with no makeExtension function. """ self.assertRaises(AttributeError, markdown.Markdown, extensions=['markdown.util']) def testNonExtension(self): """ Test loading a non Extension object as an extension. """ self.assertRaises(TypeError, markdown.Markdown, extensions=[object]) def testDotNotationExtensionWithBadClass(self): """ Test Extension loading with non-existant class name (`path.to.module:Class`). """ self.assertRaises( AttributeError, markdown.Markdown, extensions=['markdown.extensions.footnotes:MissingExtension'] ) def testBaseExtention(self): """ Test that the base Extension class will raise NotImplemented. """ self.assertRaises( NotImplementedError, markdown.Markdown, extensions=[markdown.extensions.Extension()] ) class testETreeComments(unittest.TestCase): """ Test that ElementTree Comments work. These tests should only be a concern when using cElementTree with third party serializers (including markdown's (x)html serializer). While markdown doesn't use ElementTree.Comment itself, we should certainly support any third party extensions which may. Therefore, these tests are included to ensure such support is maintained. """ def setUp(self): # Create comment node self.comment = markdown.util.etree.Comment('foo') if hasattr(markdown.util.etree, 'test_comment'): self.test_comment = markdown.util.etree.test_comment else: self.test_comment = markdown.util.etree.Comment def testCommentIsComment(self): """ Test that an ElementTree Comment passes the `is Comment` test. """ self.assertTrue(self.comment.tag is markdown.util.etree.test_comment) def testCommentIsBlockLevel(self): """ Test that an ElementTree Comment is recognized as BlockLevel. """ md = markdown.Markdown() self.assertFalse(md.is_block_level(self.comment.tag)) def testCommentSerialization(self): """ Test that an ElementTree Comment serializes properly. """ self.assertEqual( markdown.serializers.to_html_string(self.comment), '' ) def testCommentPrettify(self): """ Test that an ElementTree Comment is prettified properly. """ pretty = markdown.treeprocessors.PrettifyTreeprocessor(markdown.Markdown()) pretty.run(self.comment) self.assertEqual( markdown.serializers.to_html_string(self.comment), '\n' ) class testElementTailTests(unittest.TestCase): """ Element Tail Tests """ def setUp(self): self.pretty = markdown.treeprocessors.PrettifyTreeprocessor(markdown.Markdown()) def testBrTailNoNewline(self): """ Test that last
in tree has a new line tail """ root = markdown.util.etree.Element('root') br = markdown.util.etree.SubElement(root, 'br') self.assertEqual(br.tail, None) self.pretty.run(root) self.assertEqual(br.tail, "\n") class testSerializers(unittest.TestCase): """ Test the html and xhtml serializers. """ def testHtml(self): """ Test HTML serialization. """ el = markdown.util.etree.Element('div') el.set('id', 'foo<&">') p = markdown.util.etree.SubElement(el, 'p') p.text = 'foo <&escaped>' p.set('hidden', 'hidden') markdown.util.etree.SubElement(el, 'hr') non_element = markdown.util.etree.SubElement(el, None) non_element.text = 'non-element text' script = markdown.util.etree.SubElement(non_element, 'script') script.text = '<&"test\nescaping">' el.tail = "tail text" self.assertEqual( markdown.serializers.to_html_string(el), '
' '' '
' 'non-element text' '' '
tail text' ) def testXhtml(self): """" Test XHTML serialization. """ el = markdown.util.etree.Element('div') el.set('id', 'foo<&">') p = markdown.util.etree.SubElement(el, 'p') p.text = 'foo<&escaped>' p.set('hidden', 'hidden') markdown.util.etree.SubElement(el, 'hr') non_element = markdown.util.etree.SubElement(el, None) non_element.text = 'non-element text' script = markdown.util.etree.SubElement(non_element, 'script') script.text = '<&"test\nescaping">' el.tail = "tail text" self.assertEqual( markdown.serializers.to_xhtml_string(el), '
' '' '
' 'non-element text' '' '
tail text' ) def testMixedCaseTags(self): """" Test preservation of tag case. """ el = markdown.util.etree.Element('MixedCase') el.text = 'not valid ' em = markdown.util.etree.SubElement(el, 'EMPHASIS') em.text = 'html' markdown.util.etree.SubElement(el, 'HR') self.assertEqual( markdown.serializers.to_xhtml_string(el), 'not valid html
' ) def testProsessingInstruction(self): """ Test serialization of ProcessignInstruction. """ pi = ProcessingInstruction('foo', text='<&"test\nescaping">') self.assertIs(pi.tag, ProcessingInstruction) self.assertEqual( markdown.serializers.to_xhtml_string(pi), '' ) def testQNameTag(self): """ Test serialization of QName tag. """ div = markdown.util.etree.Element('div') qname = markdown.util.etree.QName('http://www.w3.org/1998/Math/MathML', 'math') math = markdown.util.etree.SubElement(div, qname) math.set('display', 'block') sem = markdown.util.etree.SubElement(math, 'semantics') msup = markdown.util.etree.SubElement(sem, 'msup') mi = markdown.util.etree.SubElement(msup, 'mi') mi.text = 'x' mn = markdown.util.etree.SubElement(msup, 'mn') mn.text = '2' ann = markdown.util.etree.SubElement(sem, 'annotations') ann.text = 'x^2' self.assertEqual( markdown.serializers.to_xhtml_string(div), '
' '' '' '' 'x' '2' '' 'x^2' '' '' '
' ) def testQNameAttribute(self): """ Test serialization of QName attribute. """ div = markdown.util.etree.Element('div') div.set(markdown.util.etree.QName('foo'), markdown.util.etree.QName('bar')) self.assertEqual( markdown.serializers.to_xhtml_string(div), '
' ) def testBadQNameTag(self): """ Test serialization of QName with no tag. """ qname = markdown.util.etree.QName('http://www.w3.org/1998/Math/MathML') el = markdown.util.etree.Element(qname) self.assertRaises(ValueError, markdown.serializers.to_xhtml_string, el) def testQNameEscaping(self): """ Test QName escaping. """ qname = markdown.util.etree.QName('<&"test\nescaping">', 'div') el = markdown.util.etree.Element(qname) self.assertEqual( markdown.serializers.to_xhtml_string(el), '
' ) def testQNamePreEscaping(self): """ Test QName that is already partially escaped. """ qname = markdown.util.etree.QName('<&"test escaping">', 'div') el = markdown.util.etree.Element(qname) self.assertEqual( markdown.serializers.to_xhtml_string(el), '
' ) def buildExtension(self): """ Build an extension which registers fakeSerializer. """ def fakeSerializer(elem): # Ignore input and return hardcoded output return '

foo

' class registerFakeSerializer(markdown.extensions.Extension): def extendMarkdown(self, md): md.output_formats['fake'] = fakeSerializer return registerFakeSerializer() def testRegisterSerializer(self): self.assertEqual( markdown.markdown( 'baz', extensions=[self.buildExtension()], output_format='fake' ), '

foo

' ) def testXHTMLOutput(self): self.assertEqual( markdown.markdown('foo \nbar', output_format='xhtml'), '

foo
\nbar

' ) def testHTMLOutput(self): self.assertEqual( markdown.markdown('foo \nbar', output_format='html'), '

foo
\nbar

' ) class testAtomicString(unittest.TestCase): """ Test that AtomicStrings are honored (not parsed). """ def setUp(self): md = markdown.Markdown() self.inlineprocessor = md.treeprocessors['inline'] def testString(self): """ Test that a regular string is parsed. """ tree = markdown.util.etree.Element('div') p = markdown.util.etree.SubElement(tree, 'p') p.text = 'some *text*' new = self.inlineprocessor.run(tree) self.assertEqual( markdown.serializers.to_html_string(new), '

some text

' ) def testSimpleAtomicString(self): """ Test that a simple AtomicString is not parsed. """ tree = markdown.util.etree.Element('div') p = markdown.util.etree.SubElement(tree, 'p') p.text = markdown.util.AtomicString('some *text*') new = self.inlineprocessor.run(tree) self.assertEqual( markdown.serializers.to_html_string(new), '

some *text*

' ) def testNestedAtomicString(self): """ Test that a nested AtomicString is not parsed. """ tree = markdown.util.etree.Element('div') p = markdown.util.etree.SubElement(tree, 'p') p.text = markdown.util.AtomicString('*some* ') span1 = markdown.util.etree.SubElement(p, 'span') span1.text = markdown.util.AtomicString('*more* ') span2 = markdown.util.etree.SubElement(span1, 'span') span2.text = markdown.util.AtomicString('*text* ') span3 = markdown.util.etree.SubElement(span2, 'span') span3.text = markdown.util.AtomicString('*here*') span3.tail = markdown.util.AtomicString(' *to*') span2.tail = markdown.util.AtomicString(' *test*') span1.tail = markdown.util.AtomicString(' *with*') new = self.inlineprocessor.run(tree) self.assertEqual( markdown.serializers.to_html_string(new), '

*some* *more* *text* *here* ' '*to* *test* *with*

' ) class TestConfigParsing(unittest.TestCase): def assertParses(self, value, result): self.assertTrue(markdown.util.parseBoolValue(value, False) is result) def testBooleansParsing(self): self.assertParses(True, True) self.assertParses('novalue', None) self.assertParses('yES', True) self.assertParses('FALSE', False) self.assertParses(0., False) self.assertParses('none', False) def testPreserveNone(self): self.assertTrue(markdown.util.parseBoolValue('None', preserve_none=True) is None) self.assertTrue(markdown.util.parseBoolValue(None, preserve_none=True) is None) def testInvalidBooleansParsing(self): self.assertRaises(ValueError, markdown.util.parseBoolValue, 'novalue') class TestCliOptionParsing(unittest.TestCase): """ Test parsing of Command Line Interface Options. """ def setUp(self): self.default_options = { 'input': None, 'output': None, 'encoding': None, 'output_format': 'xhtml', 'lazy_ol': True, 'extensions': [], 'extension_configs': {}, } self.tempfile = '' def tearDown(self): if os.path.isfile(self.tempfile): os.remove(self.tempfile) def testNoOptions(self): options, logging_level = parse_options([]) self.assertEqual(options, self.default_options) self.assertEqual(logging_level, CRITICAL) def testQuietOption(self): options, logging_level = parse_options(['-q']) self.assertTrue(logging_level > CRITICAL) def testVerboseOption(self): options, logging_level = parse_options(['-v']) self.assertEqual(logging_level, WARNING) def testNoisyOption(self): options, logging_level = parse_options(['--noisy']) self.assertEqual(logging_level, DEBUG) def testInputFileOption(self): options, logging_level = parse_options(['foo.txt']) self.default_options['input'] = 'foo.txt' self.assertEqual(options, self.default_options) def testOutputFileOption(self): options, logging_level = parse_options(['-f', 'foo.html']) self.default_options['output'] = 'foo.html' self.assertEqual(options, self.default_options) def testInputAndOutputFileOptions(self): options, logging_level = parse_options(['-f', 'foo.html', 'foo.txt']) self.default_options['output'] = 'foo.html' self.default_options['input'] = 'foo.txt' self.assertEqual(options, self.default_options) def testEncodingOption(self): options, logging_level = parse_options(['-e', 'utf-8']) self.default_options['encoding'] = 'utf-8' self.assertEqual(options, self.default_options) def testOutputFormatOption(self): options, logging_level = parse_options(['-o', 'html']) self.default_options['output_format'] = 'html' self.assertEqual(options, self.default_options) def testNoLazyOlOption(self): options, logging_level = parse_options(['-n']) self.default_options['lazy_ol'] = False self.assertEqual(options, self.default_options) def testExtensionOption(self): options, logging_level = parse_options(['-x', 'markdown.extensions.footnotes']) self.default_options['extensions'] = ['markdown.extensions.footnotes'] self.assertEqual(options, self.default_options) def testMultipleExtensionOptions(self): options, logging_level = parse_options([ '-x', 'markdown.extensions.footnotes', '-x', 'markdown.extensions.smarty' ]) self.default_options['extensions'] = [ 'markdown.extensions.footnotes', 'markdown.extensions.smarty' ] self.assertEqual(options, self.default_options) def create_config_file(self, config): """ Helper to create temp config files. """ if not isinstance(config, markdown.util.string_type): # convert to string config = yaml.dump(config) fd, self.tempfile = tempfile.mkstemp('.yml') with os.fdopen(fd, 'w') as fp: fp.write(config) def testExtensionConfigOption(self): config = { 'markdown.extensions.wikilinks': { 'base_url': 'http://example.com/', 'end_url': '.html', 'html_class': 'test', }, 'markdown.extensions.footnotes:FootnotesExtension': { 'PLACE_MARKER': '~~~footnotes~~~' } } self.create_config_file(config) options, logging_level = parse_options(['-c', self.tempfile]) self.default_options['extension_configs'] = config self.assertEqual(options, self.default_options) def textBoolExtensionConfigOption(self): config = { 'markdown.extensions.toc': { 'title': 'Some Title', 'anchorlink': True, 'permalink': True } } self.create_config_file(config) options, logging_level = parse_options(['-c', self.tempfile]) self.default_options['extension_configs'] = config self.assertEqual(options, self.default_options) def testExtensionConfigOptionAsJSON(self): config = { 'markdown.extensions.wikilinks': { 'base_url': 'http://example.com/', 'end_url': '.html', 'html_class': 'test', }, 'markdown.extensions.footnotes:FootnotesExtension': { 'PLACE_MARKER': '~~~footnotes~~~' } } import json self.create_config_file(json.dumps(config)) options, logging_level = parse_options(['-c', self.tempfile]) self.default_options['extension_configs'] = config self.assertEqual(options, self.default_options) def testExtensionConfigOptionMissingFile(self): self.assertRaises(IOError, parse_options, ['-c', 'missing_file.yaml']) def testExtensionConfigOptionBadFormat(self): config = """ [footnotes] PLACE_MARKER= ~~~footnotes~~~ """ self.create_config_file(config) self.assertRaises(yaml.YAMLError, parse_options, ['-c', self.tempfile]) class TestEscapeAppend(unittest.TestCase): """ Tests escape character append. """ def testAppend(self): """ Test that appended escapes are only in the current instance. """ md = markdown.Markdown() md.ESCAPED_CHARS.append('|') self.assertEqual('|' in md.ESCAPED_CHARS, True) md2 = markdown.Markdown() self.assertEqual('|' not in md2.ESCAPED_CHARS, True) class TestBlockAppend(unittest.TestCase): """ Tests block kHTML append. """ def testBlockAppend(self): """ Test that appended escapes are only in the current instance. """ md = markdown.Markdown() md.block_level_elements.append('test') self.assertEqual('test' in md.block_level_elements, True) md2 = markdown.Markdown() self.assertEqual('test' not in md2.block_level_elements, True) class TestAncestorExclusion(unittest.TestCase): """ Tests exclusion of tags in ancestor list. """ class AncestorExample(markdown.inlinepatterns.SimpleTagInlineProcessor): """ Ancestor Test. """ ANCESTOR_EXCLUDES = ('a',) def handleMatch(self, m, data): """ Handle match. """ el = markdown.util.etree.Element(self.tag) el.text = m.group(2) return el, m.start(0), m.end(0) class AncestorExtension(markdown.Extension): def __init__(self, *args, **kwargs): """Initialize.""" self.config = {} def extendMarkdown(self, md): """Modify inline patterns.""" pattern = r'(\+)([^\+]+)\1' md.inlinePatterns.register(TestAncestorExclusion.AncestorExample(pattern, 'strong'), 'ancestor-test', 0) def setUp(self): """Setup markdown object.""" self.md = markdown.Markdown(extensions=[TestAncestorExclusion.AncestorExtension()]) def test_ancestors(self): """ Test that an extension can exclude parent tags. """ test = """ Some +test+ and a [+link+](http://test.com) """ result = """

Some test and a +link+

""" self.md.reset() self.assertEqual(self.md.convert(test), result) def test_ancestors_tail(self): """ Test that an extension can exclude parent tags when dealing with a tail. """ test = """ [***+em+*+strong+**](http://test.com) """ result = """

+em++strong+

""" self.md.reset() self.assertEqual(self.md.convert(test), result) class TestGeneralDeprecations(unittest.TestCase): """Test general deprecations.""" def test_version_deprecation(self): """Test that version is deprecated.""" with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. warnings.simplefilter("always") # Trigger a warning. version = markdown.version # Verify some things self.assertTrue(len(w) == 1) self.assertTrue(issubclass(w[-1].category, DeprecationWarning)) self.assertEqual(version, markdown.__version__) def test_version_info_deprecation(self): """Test that version info is deprecated.""" with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. warnings.simplefilter("always") # Trigger a warning. version_info = markdown.version_info # Verify some things self.assertTrue(len(w) == 1) self.assertTrue(issubclass(w[-1].category, DeprecationWarning)) self.assertEqual(version_info, markdown.__version_info__) def test_deprecation_wrapper_dir(self): """Tests the `__dir__` attribute of the class as it replaces the module's.""" dir_attr = dir(markdown) self.assertFalse('version' in dir_attr) self.assertTrue('__version__' in dir_attr) self.assertFalse('version_info' in dir_attr) self.assertTrue('__version_info__' in dir_attr) Markdown-3.1.1/tests/test_extensions.py0000644000076500000240000012401213440325655020675 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). Python-Markdown Extension Regression Tests ========================================== A collection of regression tests to confirm that the included extensions continue to work as advertised. This used to be accomplished by doctests. """ from __future__ import unicode_literals import unittest import markdown class TestCaseWithAssertStartsWith(unittest.TestCase): def assertStartsWith(self, expectedPrefix, text, msg=None): if not text.startswith(expectedPrefix): if len(expectedPrefix) + 5 < len(text): text = text[:len(expectedPrefix) + 5] + '...' standardMsg = '%s not found at the start of %s' % (repr(expectedPrefix), repr(text)) self.fail(self._formatMessage(msg, standardMsg)) class TestExtensionClass(unittest.TestCase): """ Test markdown.extensions.Extension. """ def setUp(self): class TestExtension(markdown.extensions.Extension): config = { 'foo': ['bar', 'Description of foo'], 'bar': ['baz', 'Description of bar'] } self.ext = TestExtension() self.ExtKlass = TestExtension def testGetConfig(self): self.assertEqual(self.ext.getConfig('foo'), 'bar') def testGetConfigDefault(self): self.assertEqual(self.ext.getConfig('baz'), '') self.assertEqual(self.ext.getConfig('baz', default='missing'), 'missing') def testGetConfigs(self): self.assertEqual(self.ext.getConfigs(), {'foo': 'bar', 'bar': 'baz'}) def testGetConfigInfo(self): self.assertEqual( dict(self.ext.getConfigInfo()), dict([ ('foo', 'Description of foo'), ('bar', 'Description of bar') ]) ) def testSetConfig(self): self.ext.setConfig('foo', 'baz') self.assertEqual(self.ext.getConfigs(), {'foo': 'baz', 'bar': 'baz'}) def testSetConfigWithBadKey(self): # self.ext.setConfig('bad', 'baz) ==> KeyError self.assertRaises(KeyError, self.ext.setConfig, 'bad', 'baz') def testConfigAsKwargsOnInit(self): ext = self.ExtKlass(foo='baz', bar='blah') self.assertEqual(ext.getConfigs(), {'foo': 'baz', 'bar': 'blah'}) class TestAbbr(unittest.TestCase): """ Test abbr extension. """ def setUp(self): self.md = markdown.Markdown(extensions=['abbr']) def testSimpleAbbr(self): """ Test Abbreviations. """ text = 'Some text with an ABBR and a REF. Ignore REFERENCE and ref.' + \ '\n\n*[ABBR]: Abbreviation\n' + \ '*[REF]: Abbreviation Reference' self.assertEqual( self.md.convert(text), '

Some text with an ABBR ' 'and a REF. Ignore ' 'REFERENCE and ref.

' ) def testNestedAbbr(self): """ Test Nested Abbreviations. """ text = '[ABBR](/foo) and _ABBR_\n\n' + \ '*[ABBR]: Abreviation' self.assertEqual( self.md.convert(text), '

ABBR ' 'and ABBR

' ) class TestCodeHilite(TestCaseWithAssertStartsWith): """ Test codehilite extension. """ def setUp(self): self.has_pygments = True try: import pygments # noqa except ImportError: self.has_pygments = False def testBasicCodeHilite(self): text = '\t# A Code Comment' md = markdown.Markdown(extensions=['codehilite']) if self.has_pygments: # Pygments can use random lexer here as we did not specify the language self.assertStartsWith('
', md.convert(text))
        else:
            self.assertEqual(
                md.convert(text),
                '
# A Code Comment'
                '
' ) def testLinenumsTrue(self): text = '\t# A Code Comment' md = markdown.Markdown( extensions=[markdown.extensions.codehilite.CodeHiliteExtension(linenums=True)]) if self.has_pygments: # Different versions of pygments output slightly different markup. # So we use 'startwith' and test just enough to confirm that # pygments received and processed linenums. self.assertStartsWith( '
', md.convert(text) ) else: self.assertEqual( md.convert(text), '
# A Code Comment'
                '
' ) def testLinenumsFalse(self): text = '\t#!Python\n\t# A Code Comment' md = markdown.Markdown( extensions=[markdown.extensions.codehilite.CodeHiliteExtension(linenums=False)]) if self.has_pygments: self.assertStartsWith('
# A Code Comment'
                '
' ) def testLinenumsNone(self): text = '\t# A Code Comment' md = markdown.Markdown( extensions=[markdown.extensions.codehilite.CodeHiliteExtension(linenums=None)]) if self.has_pygments: # Pygments can use random lexer here as we did not specify the language self.assertStartsWith('
', md.convert(text))
        else:
            self.assertEqual(
                md.convert(text),
                '
# A Code Comment'
                '
' ) def testLinenumsNoneWithShebang(self): text = '\t#!Python\n\t# A Code Comment' md = markdown.Markdown( extensions=[markdown.extensions.codehilite.CodeHiliteExtension(linenums=None)]) if self.has_pygments: # Differant versions of pygments output slightly different markup. # So we use 'startwith' and test just enough to confirm that # pygments received and processed linenums. self.assertStartsWith( '
', md.convert(text) ) else: self.assertEqual( md.convert(text), '
# A Code Comment'
                '
' ) def testLinenumsNoneWithColon(self): text = '\t:::Python\n\t# A Code Comment' md = markdown.Markdown( extensions=[markdown.extensions.codehilite.CodeHiliteExtension(linenums=None)] ) if self.has_pygments: self.assertStartsWith('
# A Code Comment'
                '
' ) def testHighlightLinesWithColon(self): # Test with hl_lines delimited by single or double quotes. text0 = '\t:::Python hl_lines="1"\n\t#line 1\n\t#line 2\n\t#line 3' text1 = "\t:::Python hl_lines='1'\n\t#line 1\n\t#line 2\n\t#line 3" for text in (text0, text1): md = markdown.Markdown(extensions=['codehilite']) if self.has_pygments: self.assertStartsWith( '
', '')
                )
            else:
                self.assertEqual(
                    md.convert(text),
                    '
'
                    '#line 1\n'
                    '#line 2\n'
                    '#line 3
' ) def testUsePygmentsFalse(self): text = '\t:::Python\n\t# A Code Comment' md = markdown.Markdown( extensions=[markdown.extensions.codehilite.CodeHiliteExtension(use_pygments=False)] ) self.assertEqual( md.convert(text), '
# A Code Comment'
            '
' ) def testDoubleEscape(self): """ Test entity escape logic in indented code blocks. """ text = '\t:::html\n\tThis&That' md = markdown.Markdown( extensions=[markdown.extensions.codehilite.CodeHiliteExtension()] ) if self.has_pygments: self.assertEqual( md.convert(text), '
'
                ''
                '<span>'
                'This&amp;That'
                '</span>'
                '\n
' ) else: self.assertEqual( md.convert(text), '
'
                '<span>This&amp;That</span>'
                '
' ) def testHighlightAmps(self): """ Test amp conversion logic. """ text = '\t:::text\n\t&\n\t&\n\t&amp;' md = markdown.Markdown( extensions=[markdown.extensions.codehilite.CodeHiliteExtension()] ) if self.has_pygments: self.assertEqual( md.convert(text), '
&\n&amp;\n&amp;amp;\n
' ) else: self.assertEqual( md.convert(text), '
&\n&amp;\n&amp;amp;
' ) class TestFencedCode(TestCaseWithAssertStartsWith): """ Test fenced_code extension. """ def setUp(self): self.md = markdown.Markdown(extensions=['fenced_code']) self.has_pygments = True try: import pygments # noqa except ImportError: self.has_pygments = False def testBasicFence(self): """ Test Fenced Code Blocks. """ text = ''' A paragraph before a fenced code block: ~~~ Fenced code block ~~~''' self.assertEqual( self.md.convert(text), '

A paragraph before a fenced code block:

\n' '
Fenced code block\n'
            '
' ) def testSafeFence(self): """ Test Fenced Code with safe_mode. """ text = '~~~\nCode\n~~~' self.md.safeMode = 'replace' self.assertEqual( self.md.convert(text), '
Code\n'
            '
' ) def testNestedFence(self): """ Test nested fence. """ text = ''' ~~~~~~~~ ~~~~ ~~~~~~~~''' self.assertEqual( self.md.convert(text), '
\n'
            '~~~~\n'
            '
' ) def testFencedLanguage(self): """ Test Language Tags. """ text = ''' ~~~~{.python} # Some python code ~~~~''' self.assertEqual( self.md.convert(text), '
# Some python code\n'
            '
' ) def testFencedBackticks(self): """ Test Code Fenced with Backticks. """ text = ''' ````` # Arbitrary code ~~~~~ # these tildes will not close the block `````''' self.assertEqual( self.md.convert(text), '
# Arbitrary code\n'
            '~~~~~ # these tildes will not close the block\n'
            '
' ) def testFencedCodeWithHighlightLines(self): """ Test Fenced Code with Highlighted Lines. """ text = ''' ```hl_lines="1 3" line 1 line 2 line 3 ```''' md = markdown.Markdown( extensions=[ markdown.extensions.codehilite.CodeHiliteExtension(linenums=None, guess_lang=False), 'fenced_code' ] ) if self.has_pygments: self.assertStartsWith( '
', '')
            )
        else:
            self.assertEqual(
                md.convert(text),
                '
line 1\n'
                'line 2\n'
                'line 3
' ) def testFencedLanguageAndHighlightLines(self): """ Test Fenced Code with Highlighted Lines. """ text0 = ''' ```.python hl_lines="1 3" #line 1 #line 2 #line 3 ```''' text1 = ''' ~~~{.python hl_lines='1 3'} #line 1 #line 2 #line 3 ~~~''' for text in (text0, text1): md = markdown.Markdown( extensions=[ markdown.extensions.codehilite.CodeHiliteExtension(linenums=None, guess_lang=False), 'fenced_code' ] ) if self.has_pygments: self.assertStartsWith( '
', '')
                )
            else:
                self.assertEqual(
                    md.convert(text),
                    '
#line 1\n'
                    '#line 2\n'
                    '#line 3
' ) def testFencedLanguageAndPygmentsDisabled(self): """ Test if fenced_code honors CodeHilite option use_pygments=False. """ text = '```python\nfrom __future__ import braces\n```' md = markdown.Markdown( extensions=[ markdown.extensions.codehilite.CodeHiliteExtension(use_pygments=False), 'fenced_code' ] ) self.assertTrue('' in md.convert(text)) def testFencedLanguageDoubleEscape(self): """ Test entity escape logic in fences. """ text = '```html\nThis&That\n```' md = markdown.Markdown( extensions=[ markdown.extensions.codehilite.CodeHiliteExtension(), 'fenced_code' ] ) if self.has_pygments: self.assertEqual( md.convert(text), '
'
                ''
                '<span>'
                'This&amp;That'
                '</span>'
                '\n
' ) else: self.assertEqual( md.convert(text), '
'
                '<span>This&amp;That</span>'
                '
' ) def testFencedAmps(self): """ Test amp conversion. """ text = '```text\n&\n&\n&amp;\n```' md = markdown.Markdown( extensions=[ markdown.extensions.codehilite.CodeHiliteExtension(), 'fenced_code' ] ) if self.has_pygments: self.assertEqual( md.convert(text), '
&\n&amp;\n&amp;amp;\n
' ) else: self.assertEqual( md.convert(text), '
&\n&amp;\n&amp;amp;
' ) class TestMetaData(unittest.TestCase): """ Test MetaData extension. """ def setUp(self): self.md = markdown.Markdown(extensions=['meta']) def testBasicMetaData(self): """ Test basic metadata. """ text = '''Title: A Test Doc. Author: Waylan Limberg John Doe Blank_Data: The body. This is paragraph one.''' self.assertEqual( self.md.convert(text), '

The body. This is paragraph one.

' ) self.assertEqual( self.md.Meta, { 'author': ['Waylan Limberg', 'John Doe'], 'blank_data': [''], 'title': ['A Test Doc.'] } ) def testYamlMetaData(self): """ Test metadata specified as simple YAML. """ text = '''--- Title: A Test Doc. Author: [Waylan Limberg, John Doe] Blank_Data: --- The body. This is paragraph one.''' self.assertEqual( self.md.convert(text), '

The body. This is paragraph one.

' ) self.assertEqual( self.md.Meta, { 'author': ['[Waylan Limberg, John Doe]'], 'blank_data': [''], 'title': ['A Test Doc.'] } ) def testMissingMetaData(self): """ Test document without Meta Data. """ text = ' Some Code - not extra lines of meta data.' self.assertEqual( self.md.convert(text), '
Some Code - not extra lines of meta data.\n'
            '
' ) self.assertEqual(self.md.Meta, {}) def testMetaDataWithoutNewline(self): """ Test doocument with only metadata and no newline at end.""" text = 'title: No newline' self.assertEqual(self.md.convert(text), '') self.assertEqual(self.md.Meta, {'title': ['No newline']}) def testMetaDataReset(self): """ Test that reset call remove Meta entirely """ text = '''Title: A Test Doc. Author: Waylan Limberg John Doe Blank_Data: The body. This is paragraph one.''' self.md.convert(text) self.md.reset() self.assertEqual(self.md.Meta, {}) class TestWikiLinks(unittest.TestCase): """ Test Wikilinks Extension. """ def setUp(self): self.md = markdown.Markdown(extensions=['wikilinks']) self.text = "Some text with a [[WikiLink]]." def testBasicWikilinks(self): """ Test [[wikilinks]]. """ self.assertEqual( self.md.convert(self.text), '

Some text with a ' 'WikiLink.

' ) def testWikilinkWhitespace(self): """ Test whitespace in wikilinks. """ self.assertEqual( self.md.convert('[[ foo bar_baz ]]'), '

foo bar_baz

' ) self.assertEqual( self.md.convert('foo [[ ]] bar'), '

foo bar

' ) def testSimpleSettings(self): """ Test Simple Settings. """ self.assertEqual(markdown.markdown( self.text, extensions=[ markdown.extensions.wikilinks.WikiLinkExtension( base_url='/wiki/', end_url='.html', html_class='foo') ] ), '

Some text with a ' 'WikiLink.

') def testComplexSettings(self): """ Test Complex Settings. """ md = markdown.Markdown( extensions=['wikilinks'], extension_configs={ 'wikilinks': [ ('base_url', 'http://example.com/'), ('end_url', '.html'), ('html_class', '') ] }, safe_mode=True ) self.assertEqual( md.convert(self.text), '

Some text with a ' 'WikiLink.

' ) def testWikilinksMetaData(self): """ test MetaData with Wikilinks Extension. """ text = """wiki_base_url: http://example.com/ wiki_end_url: .html wiki_html_class: Some text with a [[WikiLink]].""" md = markdown.Markdown(extensions=['meta', 'wikilinks']) self.assertEqual( md.convert(text), '

Some text with a ' 'WikiLink.

' ) # MetaData should not carry over to next document: self.assertEqual( md.convert("No [[MetaData]] here."), '

No MetaData ' 'here.

' ) def testURLCallback(self): """ Test used of a custom URL builder. """ from markdown.extensions.wikilinks import WikiLinkExtension def my_url_builder(label, base, end): return '/bar/' md = markdown.Markdown(extensions=[WikiLinkExtension(build_url=my_url_builder)]) self.assertEqual( md.convert('[[foo]]'), '

foo

' ) class TestAdmonition(unittest.TestCase): """ Test Admonition Extension. """ def setUp(self): self.md = markdown.Markdown(extensions=['admonition']) def testRE(self): RE = self.md.parser.blockprocessors['admonition'].RE tests = [ ('!!! note', ('note', None)), ('!!! note "Please Note"', ('note', 'Please Note')), ('!!! note ""', ('note', '')), ] for test, expected in tests: self.assertEqual(RE.match(test).groups(), expected) class TestTOC(TestCaseWithAssertStartsWith): """ Test TOC Extension. """ def setUp(self): self.md = markdown.Markdown(extensions=['toc']) def testMarker(self): """ Test TOC with a Marker. """ text = '[TOC]\n\n# Header 1\n\n## Header 2' self.assertEqual( self.md.convert(text), '
\n' '
    \n' # noqa '
  • Header 1' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' '

Header 1

\n' '

Header 2

' ) def testNoMarker(self): """ Test TOC without a Marker. """ text = '# Header 1\n\n## Header 2' self.assertEqual( self.md.convert(text), '

Header 1

\n' '

Header 2

' ) self.assertEqual( self.md.toc, '
\n' '
    \n' # noqa '
  • Header 1' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' ) def testAlternateMarker(self): """ Test TOC with user defined marker. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(marker='{{marker}}')] ) text = '{{marker}}\n\n# Header 1\n\n## Header 2' self.assertEqual( md.convert(text), '
\n' '
    \n' # noqa '
  • Header 1' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' '

Header 1

\n' '

Header 2

' ) def testDisabledMarker(self): """ Test TOC with disabled marker. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(marker='')] ) text = '[TOC]\n\n# Header 1\n\n## Header 2' self.assertEqual( md.convert(text), '

[TOC]

\n' '

Header 1

\n' '

Header 2

' ) self.assertStartsWith('
', md.toc) def testReset(self): """ Test TOC Reset. """ self.assertEqual(self.md.toc, '') self.md.convert('# Header 1\n\n## Header 2') self.assertStartsWith('
', self.md.toc) self.md.reset() self.assertEqual(self.md.toc, '') def testUniqueIds(self): """ Test Unique IDs. """ text = '#Header\n#Header\n#Header' self.assertEqual( self.md.convert(text), '

Header

\n' '

Header

\n' '

Header

' ) def testHtmlEntities(self): """ Test Headers with HTML Entities. """ text = '# Foo & bar' self.assertEqual( self.md.convert(text), '

Foo & bar

' ) def testRawHtml(self): """ Test Headers with raw HTML. """ text = '# Foo Bar Baz.' self.assertEqual( self.md.convert(text), '

Foo Bar Baz.

' ) def testBaseLevel(self): """ Test Header Base Level. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(baselevel=5)] ) text = '# Some Header\n\n## Next Level\n\n### Too High' self.assertEqual( md.convert(text), '
Some Header
\n' '
Next Level
\n' '
Too High
' ) self.assertEqual( md.toc, '
\n' '\n' # noqa '
\n' ) def testHeaderInlineMarkup(self): """ Test Headers with inline markup. """ text = '#Some *Header* with [markup](http://example.com).' self.assertEqual( self.md.convert(text), '

Some Header with ' 'markup.

' ) def testAnchorLink(self): """ Test TOC Anchorlink. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(anchorlink=True)] ) text = '# Header 1\n\n## Header *2*' self.assertEqual( md.convert(text), '

Header 1

\n' '

Header 2

' ) def testAnchorLinkWithSingleInlineCode(self): """ Test TOC Anchorlink with single inline code. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(anchorlink=True)] ) text = '# This is `code`.' self.assertEqual( md.convert(text), '

' # noqa '' # noqa 'This is code.' # noqa '' # noqa '

' # noqa ) def testAnchorLinkWithDoubleInlineCode(self): """ Test TOC Anchorlink with double inline code. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(anchorlink=True)] ) text = '# This is `code` and `this` too.' self.assertEqual( md.convert(text), '

' # noqa '' # noqa 'This is code and this too.' # noqa '' # noqa '

' # noqa ) def testPermalink(self): """ Test TOC Permalink. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(permalink=True)] ) text = '# Header' self.assertEqual( md.convert(text), '

' # noqa 'Header' # noqa '' # noqa '

' # noqa ) def testPermalinkWithSingleInlineCode(self): """ Test TOC Permalink with single inline code. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(permalink=True)] ) text = '# This is `code`.' self.assertEqual( md.convert(text), '

' # noqa 'This is code.' # noqa '' # noqa '

' # noqa ) def testPermalinkWithDoubleInlineCode(self): """ Test TOC Permalink with double inline code. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(permalink=True)] ) text = '# This is `code` and `this` too.' self.assertEqual( md.convert(text), '

' # noqa 'This is code and this too.' # noqa '' # noqa '

' # noqa ) def testTitle(self): """ Test TOC Title. """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(title='Table of Contents')] ) md.convert('# Header 1\n\n## Header 2') self.assertStartsWith( '
Table of Contents
    ', md.toc ) def testWithAttrList(self): """ Test TOC with attr_list Extension. """ md = markdown.Markdown(extensions=['toc', 'attr_list']) text = '# Header 1\n\n## Header 2 { #foo }\n\n## Header 3 { data-toc-label="Foo Bar"}' self.assertEqual( md.convert(text), '

    Header 1

    \n' '

    Header 2

    \n' '

    Header 3

    ' ) self.assertEqual( md.toc, '
    \n' '\n' # noqa '
    \n' ) self.assertEqual( md.toc_tokens, [ { 'level': 1, 'id': 'header-1', 'name': 'Header 1', 'children': [ {'level': 2, 'id': 'foo', 'name': 'Header 2', 'children': []}, {'level': 2, 'id': 'header-3', 'name': 'Foo Bar', 'children': []} ] } ] ) def testUniqueFunc(self): """ Test 'unique' function. """ from markdown.extensions.toc import unique ids = set(['foo']) self.assertEqual(unique('foo', ids), 'foo_1') self.assertEqual(ids, set(['foo', 'foo_1'])) def testTocInHeaders(self): text = '[TOC]\n#[TOC]' self.assertEqual( self.md.convert(text), '
    \n' # noqa '
      \n' # noqa '
    • [TOC]
    • \n' # noqa '
    \n' # noqa '
    \n' # noqa '

    [TOC]

    ' # noqa ) text = '#[TOC]\n[TOC]' self.assertEqual( self.md.convert(text), '

    [TOC]

    \n' # noqa '
    \n' # noqa '
      \n' # noqa '
    • [TOC]
    • \n' # noqa '
    \n' # noqa '
    ' # noqa ) text = '[TOC]\n# *[TOC]*' self.assertEqual( self.md.convert(text), '
    \n' # noqa '
      \n' # noqa '
    • [TOC]
    • \n' # noqa '
    \n' # noqa '
    \n' # noqa '

    [TOC]

    ' # noqa ) def testMinMaxLevel(self): """ Test toc_height setting """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(toc_depth='3-4')] ) text = '# Header 1 not in TOC\n\n## Header 2 not in TOC\n\n### Header 3\n\n####Header 4' self.assertEqual( md.convert(text), '

    Header 1 not in TOC

    \n' '

    Header 2 not in TOC

    \n' '

    Header 3

    \n' '

    Header 4

    ' ) self.assertEqual( md.toc, '
    \n' '
      \n' # noqa '
    • Header 3' # noqa '\n' # noqa '
    • \n' # noqa '
    \n' # noqa '
    \n' ) self.assertNotIn("Header 1", md.toc) def testMaxLevel(self): """ Test toc_depth setting """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(toc_depth=2)] ) text = '# Header 1\n\n## Header 2\n\n###Header 3 not in TOC' self.assertEqual( md.convert(text), '

    Header 1

    \n' '

    Header 2

    \n' '

    Header 3 not in TOC

    ' ) self.assertEqual( md.toc, '
    \n' '
      \n' # noqa '
    • Header 1' # noqa '\n' # noqa '
    • \n' # noqa '
    \n' # noqa '
    \n' ) self.assertNotIn("Header 3", md.toc) def testMinMaxLevelwithBaseLevel(self): """ Test toc_height setting together with baselevel """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(toc_depth='4-6', baselevel=3)] ) text = '# First Header\n\n## Second Level\n\n### Third Level' self.assertEqual( md.convert(text), '

    First Header

    \n' '

    Second Level

    \n' '
    Third Level
    ' ) self.assertEqual( md.toc, '
    \n' '\n' # noqa '
    \n' ) self.assertNotIn("First Header", md.toc) def testMaxLevelwithBaseLevel(self): """ Test toc_depth setting together with baselevel """ md = markdown.Markdown( extensions=[markdown.extensions.toc.TocExtension(toc_depth=3, baselevel=2)] ) text = '# Some Header\n\n## Next Level\n\n### Too High' self.assertEqual( md.convert(text), '

    Some Header

    \n' '

    Next Level

    \n' '

    Too High

    ' ) self.assertEqual( md.toc, '
    \n' '\n' # noqa '
    \n' ) self.assertNotIn("Too High", md.toc) class TestSmarty(unittest.TestCase): def setUp(self): config = { 'smarty': [ ('smart_angled_quotes', True), ('substitutions', { 'ndash': '\u2013', 'mdash': '\u2014', 'ellipsis': '\u2026', 'left-single-quote': '‚', # sb is not a typo! 'right-single-quote': '‘', 'left-double-quote': '„', 'right-double-quote': '“', 'left-angle-quote': '[', 'right-angle-quote': ']', }), ] } self.md = markdown.Markdown( extensions=['smarty'], extension_configs=config ) def testCustomSubstitutions(self): text = """<< The "Unicode char of the year 2014" is the 'mdash': --- Must not be confused with 'ndash' (--) ... >> """ correct = """

    [ The „Unicode char of the year 2014“ is the ‚mdash‘: \u2014 Must not be confused with ‚ndash‘ (\u2013) \u2026 ]

    """ self.assertEqual(self.md.convert(text), correct) Markdown-3.1.1/tests/test_legacy.py0000644000076500000240000001314613446263314017746 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from markdown.test_tools import LegacyTestCase, Kwargs import os import warnings # Warnings should cause tests to fail... warnings.simplefilter('error') # Except for the warnings that shouldn't warnings.filterwarnings('default', category=PendingDeprecationWarning) warnings.filterwarnings('default', category=DeprecationWarning, module='markdown') parent_test_dir = os.path.abspath(os.path.dirname(__file__)) class TestBasic(LegacyTestCase): location = os.path.join(parent_test_dir, 'basic') class TestMisc(LegacyTestCase): location = os.path.join(parent_test_dir, 'misc') class TestPhp(LegacyTestCase): """ Notes on "excluded" tests: Quotes in attributes: attributes get output in differant order Inline HTML (Span): Backtick in raw HTML attribute TODO: fixme Backslash escapes: Weird whitespace issue in output Ins & del: Our behavior follows markdown.pl I think PHP is wrong here Auto Links: TODO: fix raw HTML so is doesn't match as a
    . Empty List Item: We match markdown.pl here. Maybe someday we'll support this Headers: TODO: fix headers to not require blank line before Mixed OLs and ULs: We match markdown.pl here. I think PHP is wrong here Emphasis: We have various minor differances in combined & incorrect em markup. Maybe fix a few of them - but most aren't too important Code block in a list item: We match markdown.pl - not sure how php gets that output?? PHP-Specific Bugs: Not sure what to make of the escaping stuff here. Why is PHP not removing a blackslash? """ location = os.path.join(parent_test_dir, 'php') normalize = True input_ext = '.text' output_ext = '.xhtml' exclude = [ 'Quotes_in_attributes', 'Inline_HTML_(Span)', 'Backslash_escapes', 'Ins_&_del', 'Auto_Links', 'Empty_List_Item', 'Headers', 'Mixed_OLs_and_ULs', 'Emphasis', 'Code_block_in_a_list_item', 'PHP_Specific_Bugs' ] # class TestPhpExtra(LegacyTestCase): # location = os.path.join(parent_test_dir, 'php/extra') # normalize = True # input_ext = '.text' # output_ext = '.xhtml' # default_kwargs = Kwargs(extensions=['extra']) class TestPl2004(LegacyTestCase): location = os.path.join(parent_test_dir, 'pl/Tests_2004') normalize = True input_ext = '.text' exclude = ['Yuri_Footnotes', 'Yuri_Attributes'] class TestPl2007(LegacyTestCase): """ Notes on "excluded" tests: Images: the attributes don't get ordered the same so we skip this Code Blocks: some weird whitespace issue Links, reference style: weird issue with nested brackets TODO: fixme Backslash escapes: backticks in raw html attributes TODO: fixme Code Spans: more backticks in raw html attributes TODO: fixme """ location = os.path.join(parent_test_dir, 'pl/Tests_2007') normalize = True input_ext = '.text' exclude = [ 'Images', 'Code_Blocks', 'Links,_reference_style', 'Backslash_escapes', 'Code_Spans' ] class TestExtensions(LegacyTestCase): location = os.path.join(parent_test_dir, 'extensions') exclude = ['codehilite'] attr_list = Kwargs(extensions=['attr_list', 'def_list', 'smarty']) codehilite = Kwargs(extensions=['codehilite']) toc = Kwargs(extensions=['toc']) toc_invalid = Kwargs(extensions=['toc']) toc_out_of_order = Kwargs(extensions=['toc']) toc_nested = Kwargs( extensions=['toc'], extension_configs={'toc': {'permalink': True}} ) toc_nested2 = Kwargs( extensions=['toc'], extension_configs={'toc': {'permalink': "[link]"}} ) toc_nested_list = Kwargs(extensions=['toc']) wikilinks = Kwargs(extensions=['wikilinks']) fenced_code = Kwargs(extensions=['fenced_code']) github_flavored = Kwargs(extensions=['fenced_code']) sane_lists = Kwargs(extensions=['sane_lists']) nl2br_w_attr_list = Kwargs(extensions=['nl2br', 'attr_list']) admonition = Kwargs(extensions=['admonition']) smarty = Kwargs( extensions=['smarty'], extension_configs={'smarty': {'smart_angled_quotes': True}} ) class TestExtensionsExtra(LegacyTestCase): location = os.path.join(parent_test_dir, 'extensions/extra') default_kwargs = Kwargs(extensions=['extra']) loose_def_list = Kwargs(extensions=['def_list']) simple_def_lists = Kwargs(extensions=['def_list']) abbr = Kwargs(extensions=['abbr']) footnotes = Kwargs(extensions=['footnotes']) tables = Kwargs(extensions=['tables']) tables_and_attr_list = Kwargs(extensions=['tables', 'attr_list']) extra_config = Kwargs( extensions=['extra'], extension_configs={ 'extra': { 'footnotes': { 'PLACE_MARKER': '~~~placemarker~~~' } } } ) Markdown-3.1.1/tests/test_syntax/0000755000076500000240000000000013470647777017471 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/test_syntax/__init__.py0000644000076500000240000000137113330711640021554 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ Markdown-3.1.1/tests/test_syntax/blocks/0000755000076500000240000000000013470647777020746 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/test_syntax/blocks/__init__.py0000644000076500000240000000137113330711640023031 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ Markdown-3.1.1/tests/test_syntax/blocks/test_code_blocks.py0000644000076500000240000000433113330711640024577 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from markdown.test_tools import TestCase class TestCodeBlocks(TestCase): def test_spaced_codeblock(self): self.assertMarkdownRenders( ' # A code block.', self.dedent( """
    # A code block.
                    
    """ ) ) def test_tabbed_codeblock(self): self.assertMarkdownRenders( '\t# A code block.', self.dedent( """
    # A code block.
                    
    """ ) ) def test_multiline_codeblock(self): self.assertMarkdownRenders( ' # Line 1\n # Line 2\n', self.dedent( """
    # Line 1
                    # Line 2
                    
    """ ) ) def test_codeblock_with_blankline(self): self.assertMarkdownRenders( ' # Line 1\n\n # Line 2\n', self.dedent( """
    # Line 1
    
                    # Line 2
                    
    """ ) ) def test_codeblock_escape(self): self.assertMarkdownRenders( ' ', self.dedent( """
    <foo & bar>
                    
    """ ) ) Markdown-3.1.1/tests/test_syntax/blocks/test_headers.py0000644000076500000240000004431713432642364023764 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ import unittest from markdown.test_tools import TestCase class TestSetextHeaders(TestCase): def test_setext_h1(self): self.assertMarkdownRenders( self.dedent( """ This is an H1 ============= """ ), '

    This is an H1

    ' ) def test_setext_h2(self): self.assertMarkdownRenders( self.dedent( """ This is an H2 ------------- """ ), '

    This is an H2

    ' ) def test_setext_h1_mismatched_length(self): self.assertMarkdownRenders( self.dedent( """ This is an H1 === """ ), '

    This is an H1

    ' ) def test_setext_h2_mismatched_length(self): self.assertMarkdownRenders( self.dedent( """ This is an H2 --- """ ), '

    This is an H2

    ' ) def test_setext_h1_followed_by_p(self): self.assertMarkdownRenders( self.dedent( """ This is an H1 ============= Followed by a Paragraph with no blank line. """ ), self.dedent( """

    This is an H1

    Followed by a Paragraph with no blank line.

    """ ) ) def test_setext_h2_followed_by_p(self): self.assertMarkdownRenders( self.dedent( """ This is an H2 ------------- Followed by a Paragraph with no blank line. """ ), self.dedent( """

    This is an H2

    Followed by a Paragraph with no blank line.

    """ ) ) # TODO: fix this # see http://johnmacfarlane.net/babelmark2/?normalize=1&text=Paragraph%0AAn+H1%0A%3D%3D%3D%3D%3D @unittest.skip('This is broken in Python-Markdown') def test_p_followed_by_setext_h1(self): self.assertMarkdownRenders( self.dedent( """ This is a Paragraph. Followed by an H1 with no blank line. ===================================== """ ), self.dedent( """

    This is a Paragraph.

    Followed by an H1 with no blank line.

    """ ) ) # TODO: fix this # see http://johnmacfarlane.net/babelmark2/?normalize=1&text=Paragraph%0AAn+H2%0A----- @unittest.skip('This is broken in Python-Markdown') def test_p_followed_by_setext_h2(self): self.assertMarkdownRenders( self.dedent( """ This is a Paragraph. Followed by an H2 with no blank line. ------------------------------------- """ ), self.dedent( """

    This is a Paragraph.

    Followed by an H2 with no blank line.

    """ ) ) class TestHashHeaders(TestCase): def test_hash_h1_open(self): self.assertMarkdownRenders( '# This is an H1', '

    This is an H1

    ' ) def test_hash_h2_open(self): self.assertMarkdownRenders( '## This is an H2', '

    This is an H2

    ' ) def test_hash_h3_open(self): self.assertMarkdownRenders( '### This is an H3', '

    This is an H3

    ' ) def test_hash_h4_open(self): self.assertMarkdownRenders( '#### This is an H4', '

    This is an H4

    ' ) def test_hash_h5_open(self): self.assertMarkdownRenders( '##### This is an H5', '
    This is an H5
    ' ) def test_hash_h6_open(self): self.assertMarkdownRenders( '###### This is an H6', '
    This is an H6
    ' ) def test_hash_gt6_open(self): self.assertMarkdownRenders( '####### This is an H6', '
    # This is an H6
    ' ) def test_hash_h1_open_missing_space(self): self.assertMarkdownRenders( '#This is an H1', '

    This is an H1

    ' ) def test_hash_h2_open_missing_space(self): self.assertMarkdownRenders( '##This is an H2', '

    This is an H2

    ' ) def test_hash_h3_open_missing_space(self): self.assertMarkdownRenders( '###This is an H3', '

    This is an H3

    ' ) def test_hash_h4_open_missing_space(self): self.assertMarkdownRenders( '####This is an H4', '

    This is an H4

    ' ) def test_hash_h5_open_missing_space(self): self.assertMarkdownRenders( '#####This is an H5', '
    This is an H5
    ' ) def test_hash_h6_open_missing_space(self): self.assertMarkdownRenders( '######This is an H6', '
    This is an H6
    ' ) def test_hash_gt6_open_missing_space(self): self.assertMarkdownRenders( '#######This is an H6', '
    #This is an H6
    ' ) def test_hash_h1_closed(self): self.assertMarkdownRenders( '# This is an H1 #', '

    This is an H1

    ' ) def test_hash_h2_closed(self): self.assertMarkdownRenders( '## This is an H2 ##', '

    This is an H2

    ' ) def test_hash_h3_closed(self): self.assertMarkdownRenders( '### This is an H3 ###', '

    This is an H3

    ' ) def test_hash_h4_closed(self): self.assertMarkdownRenders( '#### This is an H4 ####', '

    This is an H4

    ' ) def test_hash_h5_closed(self): self.assertMarkdownRenders( '##### This is an H5 #####', '
    This is an H5
    ' ) def test_hash_h6_closed(self): self.assertMarkdownRenders( '###### This is an H6 ######', '
    This is an H6
    ' ) def test_hash_gt6_closed(self): self.assertMarkdownRenders( '####### This is an H6 #######', '
    # This is an H6
    ' ) def test_hash_h1_closed_missing_space(self): self.assertMarkdownRenders( '#This is an H1#', '

    This is an H1

    ' ) def test_hash_h2_closed_missing_space(self): self.assertMarkdownRenders( '##This is an H2##', '

    This is an H2

    ' ) def test_hash_h3_closed_missing_space(self): self.assertMarkdownRenders( '###This is an H3###', '

    This is an H3

    ' ) def test_hash_h4_closed_missing_space(self): self.assertMarkdownRenders( '####This is an H4####', '

    This is an H4

    ' ) def test_hash_h5_closed_missing_space(self): self.assertMarkdownRenders( '#####This is an H5#####', '
    This is an H5
    ' ) def test_hash_h6_closed_missing_space(self): self.assertMarkdownRenders( '######This is an H6######', '
    This is an H6
    ' ) def test_hash_gt6_closed_missing_space(self): self.assertMarkdownRenders( '#######This is an H6#######', '
    #This is an H6
    ' ) def test_hash_h1_closed_mismatch(self): self.assertMarkdownRenders( '# This is an H1 ##', '

    This is an H1

    ' ) def test_hash_h2_closed_mismatch(self): self.assertMarkdownRenders( '## This is an H2 #', '

    This is an H2

    ' ) def test_hash_h3_closed_mismatch(self): self.assertMarkdownRenders( '### This is an H3 #', '

    This is an H3

    ' ) def test_hash_h4_closed_mismatch(self): self.assertMarkdownRenders( '#### This is an H4 #', '

    This is an H4

    ' ) def test_hash_h5_closed_mismatch(self): self.assertMarkdownRenders( '##### This is an H5 #', '
    This is an H5
    ' ) def test_hash_h6_closed_mismatch(self): self.assertMarkdownRenders( '###### This is an H6 #', '
    This is an H6
    ' ) def test_hash_gt6_closed_mismatch(self): self.assertMarkdownRenders( '####### This is an H6 ##################', '
    # This is an H6
    ' ) def test_hash_h1_followed_by_p(self): self.assertMarkdownRenders( self.dedent( """ # This is an H1 Followed by a Paragraph with no blank line. """ ), self.dedent( """

    This is an H1

    Followed by a Paragraph with no blank line.

    """ ) ) def test_hash_h2_followed_by_p(self): self.assertMarkdownRenders( self.dedent( """ ## This is an H2 Followed by a Paragraph with no blank line. """ ), self.dedent( """

    This is an H2

    Followed by a Paragraph with no blank line.

    """ ) ) def test_hash_h3_followed_by_p(self): self.assertMarkdownRenders( self.dedent( """ ### This is an H3 Followed by a Paragraph with no blank line. """ ), self.dedent( """

    This is an H3

    Followed by a Paragraph with no blank line.

    """ ) ) def test_hash_h4_followed_by_p(self): self.assertMarkdownRenders( self.dedent( """ #### This is an H4 Followed by a Paragraph with no blank line. """ ), self.dedent( """

    This is an H4

    Followed by a Paragraph with no blank line.

    """ ) ) def test_hash_h5_followed_by_p(self): self.assertMarkdownRenders( self.dedent( """ ##### This is an H5 Followed by a Paragraph with no blank line. """ ), self.dedent( """
    This is an H5

    Followed by a Paragraph with no blank line.

    """ ) ) def test_hash_h6_followed_by_p(self): self.assertMarkdownRenders( self.dedent( """ ###### This is an H6 Followed by a Paragraph with no blank line. """ ), self.dedent( """
    This is an H6

    Followed by a Paragraph with no blank line.

    """ ) ) def test_hash_h1_leading_space(self): self.assertMarkdownRenders( ' # This is an H1', '

    # This is an H1

    ' ) def test_hash_h2_leading_space(self): self.assertMarkdownRenders( ' ## This is an H2', '

    ## This is an H2

    ' ) def test_hash_h3_leading_space(self): self.assertMarkdownRenders( ' ### This is an H3', '

    ### This is an H3

    ' ) def test_hash_h4_leading_space(self): self.assertMarkdownRenders( ' #### This is an H4', '

    #### This is an H4

    ' ) def test_hash_h5_leading_space(self): self.assertMarkdownRenders( ' ##### This is an H5', '

    ##### This is an H5

    ' ) def test_hash_h6_leading_space(self): self.assertMarkdownRenders( ' ###### This is an H6', '

    ###### This is an H6

    ' ) def test_hash_h1_open_trailing_space(self): self.assertMarkdownRenders( '# This is an H1 ', '

    This is an H1

    ' ) def test_hash_h2_open_trailing_space(self): self.assertMarkdownRenders( '## This is an H2 ', '

    This is an H2

    ' ) def test_hash_h3_open_trailing_space(self): self.assertMarkdownRenders( '### This is an H3 ', '

    This is an H3

    ' ) def test_hash_h4_open_trailing_space(self): self.assertMarkdownRenders( '#### This is an H4 ', '

    This is an H4

    ' ) def test_hash_h5_open_trailing_space(self): self.assertMarkdownRenders( '##### This is an H5 ', '
    This is an H5
    ' ) def test_hash_h6_open_trailing_space(self): self.assertMarkdownRenders( '###### This is an H6 ', '
    This is an H6
    ' ) def test_hash_gt6_open_trailing_space(self): self.assertMarkdownRenders( '####### This is an H6 ', '
    # This is an H6
    ' ) # TODO: Possibly change the following behavior. While this follows the behavior # of markdown.pl, it is rather uncommon and not nessecarily intuitive. # See: http://johnmacfarlane.net/babelmark2/?normalize=1&text=%23+This+is+an+H1+%23+ def test_hash_h1_closed_trailing_space(self): self.assertMarkdownRenders( '# This is an H1 # ', '

    This is an H1 #

    ' ) def test_hash_h2_closed_trailing_space(self): self.assertMarkdownRenders( '## This is an H2 ## ', '

    This is an H2 ##

    ' ) def test_hash_h3_closed_trailing_space(self): self.assertMarkdownRenders( '### This is an H3 ### ', '

    This is an H3 ###

    ' ) def test_hash_h4_closed_trailing_space(self): self.assertMarkdownRenders( '#### This is an H4 #### ', '

    This is an H4 ####

    ' ) def test_hash_h5_closed_trailing_space(self): self.assertMarkdownRenders( '##### This is an H5 ##### ', '
    This is an H5 #####
    ' ) def test_hash_h6_closed_trailing_space(self): self.assertMarkdownRenders( '###### This is an H6 ###### ', '
    This is an H6 ######
    ' ) def test_hash_gt6_closed_trailing_space(self): self.assertMarkdownRenders( '####### This is an H6 ####### ', '
    # This is an H6 #######
    ' ) def test_no_blank_lines_between_hashs(self): self.assertMarkdownRenders( self.dedent( """ # This is an H1 ## This is an H2 """ ), self.dedent( """

    This is an H1

    This is an H2

    """ ) ) def test_random_hash_levels(self): self.assertMarkdownRenders( self.dedent( """ ### H3 ###### H6 # H1 ##### H5 #### H4 ## H2 ### H3 """ ), self.dedent( """

    H3

    H6

    H1

    H5

    H4

    H2

    H3

    """ ) ) def test_hash_followed_by_p(self): self.assertMarkdownRenders( self.dedent( """ # This is an H1 Followed by a Paragraph with no blank line. """ ), self.dedent( """

    This is an H1

    Followed by a Paragraph with no blank line.

    """ ) ) def test_p_followed_by_hash(self): self.assertMarkdownRenders( self.dedent( """ This is a Paragraph. # Followed by an H1 with no blank line. """ ), self.dedent( """

    This is a Paragraph.

    Followed by an H1 with no blank line.

    """ ) ) def test_escaped_hash(self): self.assertMarkdownRenders( "### H3 \\###", self.dedent( """

    H3 #

    """ ) ) def test_unescaped_hash(self): self.assertMarkdownRenders( "### H3 \\\\###", self.dedent( """

    H3 \\

    """ ) ) Markdown-3.1.1/tests/test_syntax/blocks/test_hr.py0000644000076500000240000001671013330711640022745 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from markdown.test_tools import TestCase class TestHorizontalRules(TestCase): def test_hr_asterisks(self): self.assertMarkdownRenders( '***', '
    ' ) def test_hr_asterisks_spaces(self): self.assertMarkdownRenders( '* * *', '
    ' ) def test_hr_asterisks_long(self): self.assertMarkdownRenders( '*******', '
    ' ) def test_hr_asterisks_spaces_long(self): self.assertMarkdownRenders( '* * * * * * *', '
    ' ) def test_hr_asterisks_1_indent(self): self.assertMarkdownRenders( ' ***', '
    ' ) def test_hr_asterisks_spaces_1_indent(self): self.assertMarkdownRenders( ' * * *', '
    ' ) def test_hr_asterisks_2_indent(self): self.assertMarkdownRenders( ' ***', '
    ' ) def test_hr_asterisks_spaces_2_indent(self): self.assertMarkdownRenders( ' * * *', '
    ' ) def test_hr_asterisks_3_indent(self): self.assertMarkdownRenders( ' ***', '
    ' ) def test_hr_asterisks_spaces_3_indent(self): self.assertMarkdownRenders( ' * * *', '
    ' ) def test_hr_asterisks_trailing_space(self): self.assertMarkdownRenders( '*** ', '
    ' ) def test_hr_asterisks_spaces_trailing_space(self): self.assertMarkdownRenders( '* * * ', '
    ' ) def test_hr_hyphens(self): self.assertMarkdownRenders( '---', '
    ' ) def test_hr_hyphens_spaces(self): self.assertMarkdownRenders( '- - -', '
    ' ) def test_hr_hyphens_long(self): self.assertMarkdownRenders( '-------', '
    ' ) def test_hr_hyphens_spaces_long(self): self.assertMarkdownRenders( '- - - - - - -', '
    ' ) def test_hr_hyphens_1_indent(self): self.assertMarkdownRenders( ' ---', '
    ' ) def test_hr_hyphens_spaces_1_indent(self): self.assertMarkdownRenders( ' - - -', '
    ' ) def test_hr_hyphens_2_indent(self): self.assertMarkdownRenders( ' ---', '
    ' ) def test_hr_hyphens_spaces_2_indent(self): self.assertMarkdownRenders( ' - - -', '
    ' ) def test_hr_hyphens_3_indent(self): self.assertMarkdownRenders( ' ---', '
    ' ) def test_hr_hyphens_spaces_3_indent(self): self.assertMarkdownRenders( ' - - -', '
    ' ) def test_hr_hyphens_trailing_space(self): self.assertMarkdownRenders( '--- ', '
    ' ) def test_hr_hyphens_spaces_trailing_space(self): self.assertMarkdownRenders( '- - - ', '
    ' ) def test_hr_underscores(self): self.assertMarkdownRenders( '___', '
    ' ) def test_hr_underscores_spaces(self): self.assertMarkdownRenders( '_ _ _', '
    ' ) def test_hr_underscores_long(self): self.assertMarkdownRenders( '_______', '
    ' ) def test_hr_underscores_spaces_long(self): self.assertMarkdownRenders( '_ _ _ _ _ _ _', '
    ' ) def test_hr_underscores_1_indent(self): self.assertMarkdownRenders( ' ___', '
    ' ) def test_hr_underscores_spaces_1_indent(self): self.assertMarkdownRenders( ' _ _ _', '
    ' ) def test_hr_underscores_2_indent(self): self.assertMarkdownRenders( ' ___', '
    ' ) def test_hr_underscores_spaces_2_indent(self): self.assertMarkdownRenders( ' _ _ _', '
    ' ) def test_hr_underscores_3_indent(self): self.assertMarkdownRenders( ' ___', '
    ' ) def test_hr_underscores_spaces_3_indent(self): self.assertMarkdownRenders( ' _ _ _', '
    ' ) def test_hr_underscores_trailing_space(self): self.assertMarkdownRenders( '___ ', '
    ' ) def test_hr_underscores_spaces_trailing_space(self): self.assertMarkdownRenders( '_ _ _ ', '
    ' ) def test_hr_before_paragraph(self): self.assertMarkdownRenders( self.dedent( """ *** An HR followed by a paragraph with no blank line. """ ), self.dedent( """

    An HR followed by a paragraph with no blank line.

    """ ) ) def test_hr_after_paragraph(self): self.assertMarkdownRenders( self.dedent( """ A paragraph followed by an HR with no blank line. *** """ ), self.dedent( """

    A paragraph followed by an HR with no blank line.


    """ ) ) def test_not_hr_2_asterisks(self): self.assertMarkdownRenders( '**', '

    **

    ' ) def test_not_hr_2_asterisks_spaces(self): self.assertMarkdownRenders( '* *', self.dedent( """
    • *
    """ ) ) def test_not_hr_2_hyphens(self): self.assertMarkdownRenders( '--', '

    --

    ' ) def test_not_hr_2_hyphens_spaces(self): self.assertMarkdownRenders( '- -', self.dedent( """
    • -
    """ ) ) def test_not_hr_2_underscores(self): self.assertMarkdownRenders( '__', '

    __

    ' ) def test_not_hr_2_underscores_spaces(self): self.assertMarkdownRenders( '_ _', '

    _ _

    ' ) Markdown-3.1.1/tests/test_syntax/blocks/test_paragraphs.py0000644000076500000240000001627013330711640024465 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from markdown.test_tools import TestCase class TestParagraphBlocks(TestCase): def test_simple_paragraph(self): self.assertMarkdownRenders( 'A simple paragraph.', '

    A simple paragraph.

    ' ) def test_blank_line_before_paragraph(self): self.assertMarkdownRenders( '\nA paragraph preceded by a blank line.', '

    A paragraph preceded by a blank line.

    ' ) def test_multiline_paragraph(self): self.assertMarkdownRenders( self.dedent( """ This is a paragraph on multiple lines with hard returns. """ ), self.dedent( """

    This is a paragraph on multiple lines with hard returns.

    """ ) ) def test_paragraph_long_line(self): self.assertMarkdownRenders( 'A very long long long long long long long long long long long long long long long long long long long ' 'long long long long long long long long long long long long long paragraph on 1 line.', '

    A very long long long long long long long long long long long long long long long long long long ' 'long long long long long long long long long long long long long long paragraph on 1 line.

    ' ) def test_2_paragraphs_long_line(self): self.assertMarkdownRenders( 'A very long long long long long long long long long long long long long long long long long long long ' 'long long long long long long long long long long long long long paragraph on 1 line.\n\n' 'A new long long long long long long long long long long long long long long long ' 'long paragraph on 1 line.', '

    A very long long long long long long long long long long long long long long long long long long ' 'long long long long long long long long long long long long long long paragraph on 1 line.

    \n' '

    A new long long long long long long long long long long long long long long long ' 'long paragraph on 1 line.

    ' ) def test_consecutive_paragraphs(self): self.assertMarkdownRenders( self.dedent( """ Paragraph 1. Paragraph 2. """ ), self.dedent( """

    Paragraph 1.

    Paragraph 2.

    """ ) ) def test_consecutive_paragraphs_tab(self): self.assertMarkdownRenders( self.dedent( """ Paragraph followed by a line with a tab only. \t Paragraph after a line with a tab only. """ ), self.dedent( """

    Paragraph followed by a line with a tab only.

    Paragraph after a line with a tab only.

    """ ) ) def test_consecutive_paragraphs_space(self): self.assertMarkdownRenders( self.dedent( """ Paragraph followed by a line with a space only. Paragraph after a line with a space only. """ ), self.dedent( """

    Paragraph followed by a line with a space only.

    Paragraph after a line with a space only.

    """ ) ) def test_consecutive_multiline_paragraphs(self): self.assertMarkdownRenders( self.dedent( """ Paragraph 1, line 1. Paragraph 1, line 2. Paragraph 2, line 1. Paragraph 2, line 2. """ ), self.dedent( """

    Paragraph 1, line 1. Paragraph 1, line 2.

    Paragraph 2, line 1. Paragraph 2, line 2.

    """ ) ) def test_paragraph_leading_space(self): self.assertMarkdownRenders( ' A paragraph with 1 leading space.', '

    A paragraph with 1 leading space.

    ' ) def test_paragraph_2_leading_spaces(self): self.assertMarkdownRenders( ' A paragraph with 2 leading spaces.', '

    A paragraph with 2 leading spaces.

    ' ) def test_paragraph_3_leading_spaces(self): self.assertMarkdownRenders( ' A paragraph with 3 leading spaces.', '

    A paragraph with 3 leading spaces.

    ' ) def test_paragraph_trailing_leading_space(self): self.assertMarkdownRenders( ' A paragraph with 1 trailing and 1 leading space. ', '

    A paragraph with 1 trailing and 1 leading space.

    ' ) def test_paragraph_trailing_tab(self): self.assertMarkdownRenders( 'A paragraph with 1 trailing tab.\t', '

    A paragraph with 1 trailing tab.

    ' ) def test_paragraphs_CR(self): self.assertMarkdownRenders( 'Paragraph 1, line 1.\rParagraph 1, line 2.\r\rParagraph 2, line 1.\rParagraph 2, line 2.\r', self.dedent( """

    Paragraph 1, line 1. Paragraph 1, line 2.

    Paragraph 2, line 1. Paragraph 2, line 2.

    """ ) ) def test_paragraphs_LF(self): self.assertMarkdownRenders( 'Paragraph 1, line 1.\nParagraph 1, line 2.\n\nParagraph 2, line 1.\nParagraph 2, line 2.\n', self.dedent( """

    Paragraph 1, line 1. Paragraph 1, line 2.

    Paragraph 2, line 1. Paragraph 2, line 2.

    """ ) ) def test_paragraphs_CR_LF(self): self.assertMarkdownRenders( 'Paragraph 1, line 1.\r\nParagraph 1, line 2.\r\n\r\nParagraph 2, line 1.\r\nParagraph 2, line 2.\r\n', self.dedent( """

    Paragraph 1, line 1. Paragraph 1, line 2.

    Paragraph 2, line 1. Paragraph 2, line 2.

    """ ) ) Markdown-3.1.1/tests/test_syntax/extensions/0000755000076500000240000000000013470647777021670 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/test_syntax/extensions/__init__.py0000644000076500000240000000137113330711640023753 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ Markdown-3.1.1/tests/test_syntax/extensions/test_fenced_code.py0000644000076500000240000000272013432642377025505 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from __future__ import unicode_literals from markdown.test_tools import TestCase class TestFencedCode(TestCase): # TODO: Move the rest of the fenced code tests here. def test_fenced_code_in_raw_html(self): self.assertMarkdownRenders( self.dedent( """
    ``` Begone placeholders! ```
    """ ), self.dedent( """
    Begone placeholders!
                    
    """ ), extensions=['fenced_code'] ) Markdown-3.1.1/tests/test_syntax/extensions/test_footnotes.py0000644000076500000240000000440013432642364025300 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from __future__ import unicode_literals from markdown.test_tools import TestCase class TestFootnotes(TestCase): def test_backlink_text(self): """Test backlink configuration.""" self.assertMarkdownRenders( 'paragraph[^1]\n\n[^1]: A Footnote', '

    paragraph1

    \n' '
    \n' '
    \n' '
      \n' '
    1. \n' '

      A Footnote back

      \n' '
    2. \n' '
    \n' '
    ', extensions=['footnotes'], extension_configs={'footnotes': {'BACKLINK_TEXT': 'back'}} ) def test_footnote_separator(self): """Test separator configuration.""" self.assertMarkdownRenders( 'paragraph[^1]\n\n[^1]: A Footnote', '

    paragraph1

    \n' '
    \n' '
    \n' '
      \n' '
    1. \n' '

      A Footnote 

      \n' '
    2. \n' '
    \n' '
    ', extensions=['footnotes'], extension_configs={'footnotes': {'SEPARATOR': '-'}} ) Markdown-3.1.1/tests/test_syntax/extensions/test_legacy_attrs.py0000644000076500000240000000455513330711640025743 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from __future__ import unicode_literals from markdown.test_tools import TestCase class TestLegacyAtrributes(TestCase): maxDiff = None def testLegacyAttrs(self): self.assertMarkdownRenders( self.dedent(""" # Header {@id=inthebeginning} Now, let's try something *inline{@class=special}*, to see if it works @id=TABLE.OF.CONTENTS} * {@id=TABLEOFCONTENTS} Or in the middle of the text {@id=TABLEOFCONTENTS} {@id=tableofcontents} [![{@style=float: left; margin: 10px; border: none;}](http://fourthought.com/images/ftlogo.png "Fourthought logo")](http://fourthought.com/) ![img{@id=foo}][img] [img]: http://example.com/i.jpg """), self.dedent("""

    Header

    Now, let's try something inline, to see if it works

    @id=TABLE.OF.CONTENTS}

    Or in the middle of the text

    img

    """), # noqa: E501 extensions=['legacy_attrs'] ) Markdown-3.1.1/tests/test_syntax/extensions/test_legacy_em.py0000644000076500000240000000240413432642364025207 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from __future__ import unicode_literals from markdown.test_tools import TestCase class TestLegacyEm(TestCase): def test_legacy_emphasis(self): self.assertMarkdownRenders( '_connected_words_', '

    connectedwords_

    ', extensions=['legacy_em'] ) def test_legacy_strong(self): self.assertMarkdownRenders( '__connected__words__', '

    connectedwords__

    ', extensions=['legacy_em'] ) Markdown-3.1.1/tests/test_syntax/extensions/test_tables.py0000644000076500000240000000325713330711640024532 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from __future__ import unicode_literals from markdown.test_tools import TestCase class TestTableBlocks(TestCase): def test_empty_cells(self): """Empty cells (nbsp).""" text = """   | Second Header ------------- | -------------   | Content Cell Content Cell |   """ self.assertMarkdownRenders( text, self.dedent( """
      Second Header
      Content Cell
    Content Cell  
    """ ), extensions=['tables'] ) Markdown-3.1.1/tests/test_syntax/inline/0000755000076500000240000000000013470647777020747 5ustar waylanstaff00000000000000Markdown-3.1.1/tests/test_syntax/inline/__init__.py0000644000076500000240000000137113330711640023032 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ Markdown-3.1.1/tests/test_syntax/inline/test_emphasis.py0000644000076500000240000000452413432642377024163 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2019 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from markdown.test_tools import TestCase class TestNotEmphasis(TestCase): def test_standalone_asterisk(self): self.assertMarkdownRenders( '*', '

    *

    ' ) def test_standalone_understore(self): self.assertMarkdownRenders( '_', '

    _

    ' ) def test_standalone_asterisk_in_text(self): self.assertMarkdownRenders( 'foo * bar', '

    foo * bar

    ' ) def test_standalone_understore_in_text(self): self.assertMarkdownRenders( 'foo _ bar', '

    foo _ bar

    ' ) def test_standalone_asterisks_in_text(self): self.assertMarkdownRenders( 'foo * bar * baz', '

    foo * bar * baz

    ' ) def test_standalone_understores_in_text(self): self.assertMarkdownRenders( 'foo _ bar _ baz', '

    foo _ bar _ baz

    ' ) def test_standalone_asterisks_with_newlines(self): self.assertMarkdownRenders( 'foo\n* bar *\nbaz', '

    foo\n* bar *\nbaz

    ' ) def test_standalone_understores_with_newlines(self): self.assertMarkdownRenders( 'foo\n_ bar _\nbaz', '

    foo\n_ bar _\nbaz

    ' ) def test_standalone_asterisks_at_end(self): self.assertMarkdownRenders( 'foo * bar *', '

    foo * bar *

    ' ) def test_standalone_understores_at_begin_end(self): self.assertMarkdownRenders( '_ bar _', '

    _ bar _

    ' ) Markdown-3.1.1/tests/test_syntax/inline/test_entities.py0000644000076500000240000000316113432642364024166 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from markdown.test_tools import TestCase class TestEntities(TestCase): def test_named_entities(self): self.assertMarkdownRenders("&", "

    &

    ") self.assertMarkdownRenders("²", "

    ²

    ") self.assertMarkdownRenders("Á", "

    Á

    ") def test_decimal_entities(self): self.assertMarkdownRenders("&", "

    &

    ") self.assertMarkdownRenders("²", "

    ²

    ") def test_hexadecimal_entities(self): self.assertMarkdownRenders("&", "

    &

    ") self.assertMarkdownRenders("²", "

    ²

    ") def test_false_entities(self): self.assertMarkdownRenders("¬ an entity;", "

    &not an entity;

    ") self.assertMarkdownRenders("&#B2;", "

    &#B2;

    ") self.assertMarkdownRenders("&#xnothex;", "

    &#xnothex;

    ") Markdown-3.1.1/tests/test_syntax/inline/test_images.py0000644000076500000240000001434213424435527023614 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from markdown.test_tools import TestCase class TestAdvancedImages(TestCase): def test_nested_square_brackets(self): self.assertMarkdownRenders( """![Text[[[[[[[]]]]]]][]](http://link.com/image.png) more text""", """

    Text[[[[[[[]]]]]]][] more text

    """ ) def test_nested_round_brackets(self): self.assertMarkdownRenders( """![Text](http://link.com/(((((((()))))))()).png) more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles1(self): self.assertMarkdownRenders( """![Text](http://link.com/(.png"title") more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles2(self): self.assertMarkdownRenders( """![Text](http://link.com/('.png"title") more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles3(self): self.assertMarkdownRenders( """![Text](http://link.com/(.png"title)") more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles4(self): self.assertMarkdownRenders( """![Text](http://link.com/(.png "title") more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles5(self): self.assertMarkdownRenders( """![Text](http://link.com/(.png "title)") more text""", """

    Text more text

    """ ) def test_mixed_title_quotes1(self): self.assertMarkdownRenders( """![Text](http://link.com/'.png"title") more text""", """

    Text more text

    """ ) def test_mixed_title_quotes2(self): self.assertMarkdownRenders( """![Text](http://link.com/".png'title') more text""", """

    Text more text

    """ ) def test_mixed_title_quotes3(self): self.assertMarkdownRenders( """![Text](http://link.com/with spaces.png'"and quotes" 'and title') more text""", """

    Text""" """ more text

    """ ) def test_mixed_title_quotes4(self): self.assertMarkdownRenders( """![Text](http://link.com/with spaces'.png"and quotes" 'and title") more text""", """

    Text""" """ more text

    """ ) def test_mixed_title_quotes5(self): self.assertMarkdownRenders( """![Text](http://link.com/with spaces .png'"and quotes" 'and title') more text""", """

    Text more text

    """ ) def test_mixed_title_quotes6(self): self.assertMarkdownRenders( """![Text](http://link.com/with spaces "and quotes".png 'and title') more text""", """

    Text""" """ more text

    """ ) def test_single_quote(self): self.assertMarkdownRenders( """![test](link"notitle.png)""", """

    test

    """ ) def test_angle_with_mixed_title_quotes(self): self.assertMarkdownRenders( """![Text]( 'and title') more text""", """

    Text""" """ more text

    """ ) def test_misc(self): self.assertMarkdownRenders( """![Poster](http://humane_man.jpg "The most humane man.")""", """

    Poster

    """ ) def test_misc_ref(self): self.assertMarkdownRenders( self.dedent( """ ![Poster][] [Poster]:http://humane_man.jpg "The most humane man." """ ), self.dedent( """

    Poster

    """ ) ) def test_misc_blank(self): self.assertMarkdownRenders( """![Blank]()""", """

    Blank

    """ ) def test_misc_img_title(self): self.assertMarkdownRenders( """![Image](http://humane man.jpg "The most humane man.")""", """

    Image

    """ ) def test_misc_img(self): self.assertMarkdownRenders( """![Image](http://humane man.jpg)""", """

    Image

    """ ) Markdown-3.1.1/tests/test_syntax/inline/test_links.py0000644000076500000240000001521113432642364023461 0ustar waylanstaff00000000000000# -*- coding: utf-8 -*- """ Python Markdown A Python implementation of John Gruber's Markdown. Documentation: https://python-markdown.github.io/ GitHub: https://github.com/Python-Markdown/markdown/ PyPI: https://pypi.org/project/Markdown/ Started by Manfred Stienstra (http://www.dwerg.net/). Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). Currently maintained by Waylan Limberg (https://github.com/waylan), Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) License: BSD (see LICENSE.md for details). """ from markdown.test_tools import TestCase class TestAdvancedLinks(TestCase): def test_nested_square_brackets(self): self.assertMarkdownRenders( """[Text[[[[[[[]]]]]]][]](http://link.com) more text""", """

    Text[[[[[[[]]]]]]][] more text

    """ ) def test_nested_round_brackets(self): self.assertMarkdownRenders( """[Text](http://link.com/(((((((()))))))())) more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles1(self): self.assertMarkdownRenders( """[Text](http://link.com/("title") more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles2(self): self.assertMarkdownRenders( """[Text](http://link.com/('"title") more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles3(self): self.assertMarkdownRenders( """[Text](http://link.com/("title)") more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles4(self): self.assertMarkdownRenders( """[Text](http://link.com/( "title") more text""", """

    Text more text

    """ ) def test_uneven_brackets_with_titles5(self): self.assertMarkdownRenders( """[Text](http://link.com/( "title)") more text""", """

    Text more text

    """ ) def test_mixed_title_quotes1(self): self.assertMarkdownRenders( """[Text](http://link.com/'"title") more text""", """

    Text more text

    """ ) def test_mixed_title_quotes2(self): self.assertMarkdownRenders( """[Text](http://link.com/"'title') more text""", """

    Text more text

    """ ) def test_mixed_title_quotes3(self): self.assertMarkdownRenders( """[Text](http://link.com/with spaces'"and quotes" 'and title') more text""", """

    """ """Text more text

    """ ) def test_mixed_title_quotes4(self): self.assertMarkdownRenders( """[Text](http://link.com/with spaces'"and quotes" 'and title") more text""", """

    Text more text

    """ ) def test_mixed_title_quotes5(self): self.assertMarkdownRenders( """[Text](http://link.com/with spaces '"and quotes" 'and title') more text""", """

    """ """Text more text

    """ ) def test_mixed_title_quotes6(self): self.assertMarkdownRenders( """[Text](http://link.com/with spaces "and quotes" 'and title') more text""", """

    """ """Text more text

    """ ) def test_single_quote(self): self.assertMarkdownRenders( """[test](link"notitle)""", """

    test

    """ ) def test_angle_with_mixed_title_quotes(self): self.assertMarkdownRenders( """[Text]( 'and title') more text""", """

    """ """Text more text

    """ ) def test_amp_in_url(self): """Test amp in URLs.""" self.assertMarkdownRenders( '[link](http://www.freewisdom.org/this&that)', '

    link

    ' ) self.assertMarkdownRenders( '[title](http://example.com/?a=1&b=2)', '

    title

    ' ) self.assertMarkdownRenders( '[title](http://example.com/?a=1&b=2)', '

    title

    ' ) def test_reference_newlines(self): """Test reference id whitespace cleanup.""" self.assertMarkdownRenders( self.dedent( """ Two things: - I would like to tell you about the [code of conduct][] we are using in this project. - Only one in fact. [code of conduct]: https://github.com/Python-Markdown/markdown/blob/master/CODE_OF_CONDUCT.md """ ), '

    Two things:

    \n
      \n
    • I would like to tell you about the ' 'code of\n' ' conduct we are using in this project.
    • \n
    • Only one in fact.
    • \n
    ' ) def test_reference_across_blocks(self): """Test references across blocks.""" self.assertMarkdownRenders( self.dedent( """ I would like to tell you about the [code of conduct][] we are using in this project. [code of conduct]: https://github.com/Python-Markdown/markdown/blob/master/CODE_OF_CONDUCT.md """ ), '

    I would like to tell you about the [code of

    \n' '

    conduct][] we are using in this project.

    ' ) Markdown-3.1.1/tox.ini0000644000076500000240000000122113470641027015227 0ustar waylanstaff00000000000000[tox] envlist = py27, py35, py36, py37, pypy, pypy3, flake8, checkspelling, pep517check requires = setuptools>=36 isolated_build = True [testenv] extras = testing deps = pytidylib commands = coverage run --source=markdown -m unittest discover {toxinidir}/tests coverage report --show-missing [testenv:flake8] deps = flake8 commands = flake8 {toxinidir}/markdown {toxinidir}/tests {toxinidir}/setup.py [testenv:checkspelling] deps = mkdocs mkdocs_nature commands = {toxinidir}/checkspelling.sh [testenv:pep517check] deps = pep517 commands = python -m pep517.check {toxinidir} [flake8] max-line-length = 119 exclude=markdown/pep562.py