././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.1037383 markdown-3.7/0000755000175100001770000000000014657673141012630 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/INSTALL.md0000644000175100001770000000041514657673134014262 0ustar00runnerdockerInstalling 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 . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/LICENSE.md0000644000175100001770000000316214657673134014240 0ustar00runnerdockerBSD 3-Clause License Copyright 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) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. Neither the name of the copyright holder 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/MANIFEST.in0000644000175100001770000000042014657673134014364 0ustar00runnerdockerrecursive-include markdown *.py recursive-include docs * recursive-include tests *.txt *.html *.py include makefile include LICENSE.md include README.md include INSTALL.md include MANIFEST include *-requirements.txt include mkdocs.yml include tox.ini include scripts/*.py ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.1037383 markdown-3.7/Markdown.egg-info/0000755000175100001770000000000014657673141016104 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823713.0 markdown-3.7/Markdown.egg-info/PKG-INFO0000644000175100001770000001556214657673141017212 0ustar00runnerdockerMetadata-Version: 2.1 Name: Markdown Version: 3.7 Summary: Python implementation of John Gruber's Markdown. Author: Manfred Stienstra, Yuri Takhteyev Author-email: Waylan limberg Maintainer: Isaac Muse Maintainer-email: Waylan Limberg License: BSD 3-Clause License Copyright 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) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. Neither the name of the copyright holder 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 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. Project-URL: Homepage, https://Python-Markdown.github.io/ Project-URL: Documentation, https://Python-Markdown.github.io/ Project-URL: Repository, https://github.com/Python-Markdown/markdown Project-URL: Issue Tracker, https://github.com/Python-Markdown/markdown/issues Project-URL: Changelog, https://python-markdown.github.io/changelog/ Keywords: markdown,markdown-parser,python-markdown,markdown-to-html 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 :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy 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 Classifier: Topic :: Text Processing :: Markup :: Markdown Requires-Python: >=3.8 Description-Content-Type: text/markdown License-File: LICENSE.md Requires-Dist: importlib-metadata>=4.4; python_version < "3.10" Provides-Extra: testing Requires-Dist: coverage; extra == "testing" Requires-Dist: pyyaml; extra == "testing" Provides-Extra: docs Requires-Dist: mkdocs>=1.5; extra == "docs" Requires-Dist: mkdocs-nature>=0.6; extra == "docs" Requires-Dist: mdx_gh_links>=0.2; extra == "docs" Requires-Dist: mkdocstrings[python]; extra == "docs" Requires-Dist: mkdocs-gen-files; extra == "docs" Requires-Dist: mkdocs-section-index; extra == "docs" Requires-Dist: mkdocs-literate-nav; extra == "docs" [Python-Markdown][] =================== [![Build Status][build-button]][build] [![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] [build-button]: https://github.com/Python-Markdown/markdown/workflows/CI/badge.svg?event=push [build]: https://github.com/Python-Markdown/markdown/actions?query=workflow%3ACI+event%3Apush [codecov-button]: https://codecov.io/gh/Python-Markdown/markdown/branch/master/graph/badge.svg [codecov]: https://codecov.io/gh/Python-Markdown/markdown [mdversion-button]: https://img.shields.io/pypi/v/Markdown.svg [md-pypi]: https://pypi.org/project/Markdown/ [pyversion-button]: https://img.shields.io/pypi/pyversions/Markdown.svg [bsdlicense-button]: https://img.shields.io/badge/license-BSD-yellow.svg [bsdlicense]: https://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]: https://daringfireball.net/projects/markdown/ [Features]: https://Python-Markdown.github.io#Features [Available Extensions]: https://Python-Markdown.github.io/extensions Documentation ------------- ```bash pip install markdown ``` ```python import markdown html = markdown.markdown(your_text_string) ``` For more advanced [installation] and [usage] documentation, see the `docs/` directory of the distribution or the project website at . [installation]: https://python-markdown.github.io/install/ [usage]: https://python-markdown.github.io/reference/ See the change log at . Support ------- You may report bugs, ask for help, and discuss various other issues on the [bug tracker][]. [bug tracker]: https://github.com/Python-Markdown/markdown/issues Code of Conduct --------------- Everyone interacting in the Python-Markdown project's code bases, issue trackers, and mailing lists is expected to follow the [Code of Conduct]. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823713.0 markdown-3.7/Markdown.egg-info/SOURCES.txt0000644000175100001770000003050014657673141017766 0ustar00runnerdockerINSTALL.md LICENSE.md MANIFEST.in README.md makefile mkdocs.yml pyproject.toml 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/changelog.md docs/cli.md docs/contributing.md docs/custom.css docs/favicon.ico docs/index.md docs/install.md docs/mkdocstrings.css 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/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_attrs.md docs/extensions/legacy_em.md docs/extensions/md_in_html.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 docs/templates/python/nature/attribute.html docs/templates/python/nature/class.html docs/templates/python/nature/function.html docs/templates/python/nature/module.html docs/templates/python/nature/docstring/admonition.html markdown/__init__.py markdown/__main__.py markdown/__meta__.py markdown/blockparser.py markdown/blockprocessors.py markdown/core.py markdown/htmlparser.py markdown/inlinepatterns.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/md_in_html.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 scripts/gen_ref_nav.py scripts/griffe_extensions.py tests/__init__.py tests/test_apis.py tests/test_extensions.py tests/test_legacy.py tests/test_meta.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/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/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/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/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/misc/CRLF_line_ends.html tests/misc/CRLF_line_ends.txt tests/misc/adjacent-headers.html tests/misc/adjacent-headers.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/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/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_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/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/missing-link-def.html tests/misc/missing-link-def.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/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/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_blockquotes.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_html_blocks.py tests/test_syntax/blocks/test_paragraphs.py tests/test_syntax/blocks/test_ul.py tests/test_syntax/extensions/__init__.py tests/test_syntax/extensions/test_abbr.py tests/test_syntax/extensions/test_admonition.py tests/test_syntax/extensions/test_attr_list.py tests/test_syntax/extensions/test_code_hilite.py tests/test_syntax/extensions/test_def_list.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_md_in_html.py tests/test_syntax/extensions/test_smarty.py tests/test_syntax/extensions/test_tables.py tests/test_syntax/extensions/test_toc.py tests/test_syntax/inline/__init__.py tests/test_syntax/inline/test_autolinks.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.py tests/test_syntax/inline/test_raw_html.py././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823713.0 markdown-3.7/Markdown.egg-info/dependency_links.txt0000644000175100001770000000000114657673141022152 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823713.0 markdown-3.7/Markdown.egg-info/entry_points.txt0000644000175100001770000000211614657673141021402 0ustar00runnerdocker[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 md_in_html = markdown.extensions.md_in_html:MarkdownInHtmlExtension 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823713.0 markdown-3.7/Markdown.egg-info/requires.txt0000644000175100001770000000032714657673141020506 0ustar00runnerdocker [:python_version < "3.10"] importlib-metadata>=4.4 [docs] mkdocs>=1.5 mkdocs-nature>=0.6 mdx_gh_links>=0.2 mkdocstrings[python] mkdocs-gen-files mkdocs-section-index mkdocs-literate-nav [testing] coverage pyyaml ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823713.0 markdown-3.7/Markdown.egg-info/top_level.txt0000644000175100001770000000001114657673141020626 0ustar00runnerdockermarkdown ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.1037383 markdown-3.7/PKG-INFO0000644000175100001770000001556214657673141013736 0ustar00runnerdockerMetadata-Version: 2.1 Name: Markdown Version: 3.7 Summary: Python implementation of John Gruber's Markdown. Author: Manfred Stienstra, Yuri Takhteyev Author-email: Waylan limberg Maintainer: Isaac Muse Maintainer-email: Waylan Limberg License: BSD 3-Clause License Copyright 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) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. Neither the name of the copyright holder 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 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. Project-URL: Homepage, https://Python-Markdown.github.io/ Project-URL: Documentation, https://Python-Markdown.github.io/ Project-URL: Repository, https://github.com/Python-Markdown/markdown Project-URL: Issue Tracker, https://github.com/Python-Markdown/markdown/issues Project-URL: Changelog, https://python-markdown.github.io/changelog/ Keywords: markdown,markdown-parser,python-markdown,markdown-to-html 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 :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy 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 Classifier: Topic :: Text Processing :: Markup :: Markdown Requires-Python: >=3.8 Description-Content-Type: text/markdown License-File: LICENSE.md Requires-Dist: importlib-metadata>=4.4; python_version < "3.10" Provides-Extra: testing Requires-Dist: coverage; extra == "testing" Requires-Dist: pyyaml; extra == "testing" Provides-Extra: docs Requires-Dist: mkdocs>=1.5; extra == "docs" Requires-Dist: mkdocs-nature>=0.6; extra == "docs" Requires-Dist: mdx_gh_links>=0.2; extra == "docs" Requires-Dist: mkdocstrings[python]; extra == "docs" Requires-Dist: mkdocs-gen-files; extra == "docs" Requires-Dist: mkdocs-section-index; extra == "docs" Requires-Dist: mkdocs-literate-nav; extra == "docs" [Python-Markdown][] =================== [![Build Status][build-button]][build] [![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] [build-button]: https://github.com/Python-Markdown/markdown/workflows/CI/badge.svg?event=push [build]: https://github.com/Python-Markdown/markdown/actions?query=workflow%3ACI+event%3Apush [codecov-button]: https://codecov.io/gh/Python-Markdown/markdown/branch/master/graph/badge.svg [codecov]: https://codecov.io/gh/Python-Markdown/markdown [mdversion-button]: https://img.shields.io/pypi/v/Markdown.svg [md-pypi]: https://pypi.org/project/Markdown/ [pyversion-button]: https://img.shields.io/pypi/pyversions/Markdown.svg [bsdlicense-button]: https://img.shields.io/badge/license-BSD-yellow.svg [bsdlicense]: https://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]: https://daringfireball.net/projects/markdown/ [Features]: https://Python-Markdown.github.io#Features [Available Extensions]: https://Python-Markdown.github.io/extensions Documentation ------------- ```bash pip install markdown ``` ```python import markdown html = markdown.markdown(your_text_string) ``` For more advanced [installation] and [usage] documentation, see the `docs/` directory of the distribution or the project website at . [installation]: https://python-markdown.github.io/install/ [usage]: https://python-markdown.github.io/reference/ See the change log at . Support ------- You may report bugs, ask for help, and discuss various other issues on the [bug tracker][]. [bug tracker]: https://github.com/Python-Markdown/markdown/issues Code of Conduct --------------- Everyone interacting in the Python-Markdown project's code bases, issue trackers, and mailing lists is expected to follow the [Code of Conduct]. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/README.md0000644000175100001770000000505314657673134014114 0ustar00runnerdocker[Python-Markdown][] =================== [![Build Status][build-button]][build] [![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] [build-button]: https://github.com/Python-Markdown/markdown/workflows/CI/badge.svg?event=push [build]: https://github.com/Python-Markdown/markdown/actions?query=workflow%3ACI+event%3Apush [codecov-button]: https://codecov.io/gh/Python-Markdown/markdown/branch/master/graph/badge.svg [codecov]: https://codecov.io/gh/Python-Markdown/markdown [mdversion-button]: https://img.shields.io/pypi/v/Markdown.svg [md-pypi]: https://pypi.org/project/Markdown/ [pyversion-button]: https://img.shields.io/pypi/pyversions/Markdown.svg [bsdlicense-button]: https://img.shields.io/badge/license-BSD-yellow.svg [bsdlicense]: https://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]: https://daringfireball.net/projects/markdown/ [Features]: https://Python-Markdown.github.io#Features [Available Extensions]: https://Python-Markdown.github.io/extensions Documentation ------------- ```bash pip install markdown ``` ```python import markdown html = markdown.markdown(your_text_string) ``` For more advanced [installation] and [usage] documentation, see the `docs/` directory of the distribution or the project website at . [installation]: https://python-markdown.github.io/install/ [usage]: https://python-markdown.github.io/reference/ See the change log at . Support ------- You may report bugs, ask for help, and discuss various other issues on the [bug tracker][]. [bug tracker]: https://github.com/Python-Markdown/markdown/issues Code of Conduct --------------- Everyone interacting in the Python-Markdown project's code bases, issue trackers, and mailing lists is expected to follow the [Code of Conduct]. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0477371 markdown-3.7/docs/0000755000175100001770000000000014657673141013560 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/docs/authors.md0000644000175100001770000000431414657673134015573 0ustar00runnerdockertitle: 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, including 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 Takhteyev](https://github.com/yuri)__ 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__ 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 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0477371 markdown-3.7/docs/change_log/0000755000175100001770000000000014657673141015646 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/docs/change_log/index.md0000644000175100001770000002100514657673134017277 0ustar00runnerdockertitle: Change Log Python-Markdown Change Log ========================= !!! note This is an archive of the changelog prior to the release of version 3.0. See the [current changelog](../changelog.md) for up-to-date details. 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 `', start)) != -1: text = f'{text[:start]}{text[end + 3:]}' while (start := text.find('<')) != -1 and (end := text.find('>', start)) != -1: text = f'{text[:start]}{text[end + 1:]}' # Collapse whitespace text = ' '.join(text.split()) return text def escape_cdata(text: str) -> str: """ Escape character data. """ if "&" in text: # Only replace & when not part of an entity text = RE_AMP.sub('&', text) if "<" in text: text = text.replace("<", "<") if ">" in text: text = text.replace(">", ">") return text def run_postprocessors(text: str, md: Markdown) -> str: """ Run postprocessors from Markdown instance on text. """ for pp in md.postprocessors: text = pp.run(text) return text.strip() def render_inner_html(el: etree.Element, md: Markdown) -> str: """ Fully render inner html of an `etree` element as a string. """ # The `UnescapeTreeprocessor` runs after `toc` extension so run here. text = unescape(md.serializer(el)) # strip parent tag start = text.index('>') + 1 end = text.rindex('<') text = text[start:end].strip() return run_postprocessors(text, md) def remove_fnrefs(root: etree.Element) -> etree.Element: """ Remove footnote references from a copy of the element, if any are present. """ # Remove footnote references, which look like this: `...`. # If there are no `sup` elements, then nothing to do. if next(root.iter('sup'), None) is None: return root root = deepcopy(root) # Find parent elements that contain `sup` elements. for parent in root.findall('.//sup/..'): carry_text = "" for child in reversed(parent): # Reversed for the ability to mutate during iteration. # Remove matching footnote references but carry any `tail` text to preceding elements. if child.tag == 'sup' and child.get('id', '').startswith('fnref'): carry_text = f'{child.tail or ""}{carry_text}' parent.remove(child) elif carry_text: child.tail = f'{child.tail or ""}{carry_text}' carry_text = "" if carry_text: parent.text = f'{parent.text or ""}{carry_text}' return root def nest_toc_tokens(toc_list): """Given an unsorted list with errors and skips, return a nested one. [{'level': 1}, {'level': 2}] => [{'level': 1, 'children': [{'level': 2, 'children': []}]}] A wrong list is also converted: [{'level': 2}, {'level': 1}] => [{'level': 2, 'children': []}, {'level': 1, 'children': []}] """ ordered_list = [] if len(toc_list): # Initialize everything by processing the first entry last = toc_list.pop(0) last['children'] = [] levels = [last['level']] ordered_list.append(last) parents = [] # Walk the rest nesting the entries properly while toc_list: t = toc_list.pop(0) current_level = t['level'] t['children'] = [] # Reduce depth if current level < last item's level if current_level < levels[-1]: # Pop last level since we know we are less than it levels.pop() # Pop parents and levels we are less than or equal to to_pop = 0 for p in reversed(parents): if current_level <= p['level']: to_pop += 1 else: # pragma: no cover break if to_pop: levels = levels[:-to_pop] parents = parents[:-to_pop] # Note current level as last levels.append(current_level) # Level is the same, so append to # the current parent (if available) if current_level == levels[-1]: (parents[-1]['children'] if parents else ordered_list).append(t) # Current level is > last item's level, # So make last item a parent and append current as child else: last['children'].append(t) parents.append(last) levels.append(current_level) last = t return ordered_list class TocTreeprocessor(Treeprocessor): """ Step through document and build TOC. """ def __init__(self, md: Markdown, config: dict[str, Any]): super().__init__(md) self.marker: str = config["marker"] self.title: str = config["title"] self.base_level = int(config["baselevel"]) - 1 self.slugify = config["slugify"] self.sep = config["separator"] self.toc_class = config["toc_class"] self.title_class: str = config["title_class"] self.use_anchors: bool = parseBoolValue(config["anchorlink"]) self.anchorlink_class: str = config["anchorlink_class"] self.use_permalinks = parseBoolValue(config["permalink"], False) if self.use_permalinks is None: self.use_permalinks = config["permalink"] self.permalink_class: str = config["permalink_class"] self.permalink_title: str = config["permalink_title"] self.permalink_leading: bool | None = parseBoolValue(config["permalink_leading"], False) self.header_rgx = re.compile("[Hh][123456]") if isinstance(config["toc_depth"], str) and '-' in config["toc_depth"]: self.toc_top, self.toc_bottom = [int(x) for x in config["toc_depth"].split('-')] else: self.toc_top = 1 self.toc_bottom = int(config["toc_depth"]) def iterparent(self, node: etree.Element) -> Iterator[tuple[etree.Element, etree.Element]]: """ Iterator wrapper to get allowed parent and child all at once. """ # We do not allow the marker inside a header as that # would causes an endless loop of placing a new TOC # inside previously generated TOC. for child in node: if not self.header_rgx.match(child.tag) and child.tag not in ['pre', 'code']: yield node, child yield from self.iterparent(child) def replace_marker(self, root: etree.Element, elem: etree.Element) -> None: """ Replace marker with elem. """ for (p, c) in self.iterparent(root): text = ''.join(c.itertext()).strip() if not text: continue # To keep the output from screwing up the # validation by putting a `
` inside of a `

` # we actually replace the `

` in its entirety. # The `

` element may contain more than a single text content # (`nl2br` can introduce a `
`). In this situation, `c.text` returns # the very first content, ignore children contents or tail content. # `len(c) == 0` is here to ensure there is only text in the `

`. if c.text and c.text.strip() == self.marker and len(c) == 0: for i in range(len(p)): if p[i] == c: p[i] = elem break def set_level(self, elem: etree.Element) -> None: """ Adjust header level according to base level. """ level = int(elem.tag[-1]) + self.base_level if level > 6: level = 6 elem.tag = 'h%d' % level def add_anchor(self, c: etree.Element, elem_id: str) -> None: anchor = etree.Element("a") anchor.text = c.text anchor.attrib["href"] = "#" + elem_id anchor.attrib["class"] = self.anchorlink_class c.text = "" for elem in c: anchor.append(elem) while len(c): c.remove(c[0]) c.append(anchor) def add_permalink(self, c: etree.Element, elem_id: str) -> None: permalink = etree.Element("a") permalink.text = ("%spara;" % AMP_SUBSTITUTE if self.use_permalinks is True else self.use_permalinks) permalink.attrib["href"] = "#" + elem_id permalink.attrib["class"] = self.permalink_class if self.permalink_title: permalink.attrib["title"] = self.permalink_title if self.permalink_leading: permalink.tail = c.text c.text = "" c.insert(0, permalink) else: c.append(permalink) def build_toc_div(self, toc_list: list) -> etree.Element: """ Return a string div given a toc list. """ div = etree.Element("div") div.attrib["class"] = self.toc_class # Add title to the div if self.title: header = etree.SubElement(div, "span") if self.title_class: header.attrib["class"] = self.title_class header.text = self.title def build_etree_ul(toc_list: list, parent: etree.Element) -> etree.Element: ul = etree.SubElement(parent, "ul") for item in toc_list: # List item link, to be inserted into the toc div li = etree.SubElement(ul, "li") link = etree.SubElement(li, "a") link.text = item.get('name', '') link.attrib["href"] = '#' + item.get('id', '') if item['children']: build_etree_ul(item['children'], li) return ul build_etree_ul(toc_list, div) if 'prettify' in self.md.treeprocessors: self.md.treeprocessors['prettify'].run(div) return div def run(self, doc: etree.Element) -> None: # Get a list of id attributes used_ids = set() for el in doc.iter(): if "id" in el.attrib: used_ids.add(el.attrib["id"]) toc_tokens = [] for el in doc.iter(): if isinstance(el.tag, str) and self.header_rgx.match(el.tag): self.set_level(el) innerhtml = render_inner_html(remove_fnrefs(el), self.md) name = strip_tags(innerhtml) # Do not override pre-existing ids if "id" not in el.attrib: el.attrib["id"] = unique(self.slugify(html.unescape(name), self.sep), used_ids) data_toc_label = '' if 'data-toc-label' in el.attrib: data_toc_label = run_postprocessors(unescape(el.attrib['data-toc-label']), self.md) # Overwrite name with sanitized value of `data-toc-label`. name = escape_cdata(strip_tags(data_toc_label)) # Remove the data-toc-label attribute as it is no longer needed del el.attrib['data-toc-label'] if int(el.tag[-1]) >= self.toc_top and int(el.tag[-1]) <= self.toc_bottom: toc_tokens.append({ 'level': int(el.tag[-1]), 'id': el.attrib["id"], 'name': name, 'html': innerhtml, 'data-toc-label': data_toc_label }) if self.use_anchors: self.add_anchor(el, el.attrib["id"]) if self.use_permalinks not in [False, None]: self.add_permalink(el, el.attrib["id"]) toc_tokens = nest_toc_tokens(toc_tokens) div = self.build_toc_div(toc_tokens) if self.marker: self.replace_marker(doc, div) # serialize and attach to markdown instance. toc = self.md.serializer(div) for pp in self.md.postprocessors: toc = pp.run(toc) self.md.toc_tokens = toc_tokens self.md.toc = toc class TocExtension(Extension): TreeProcessorClass = TocTreeprocessor def __init__(self, **kwargs): self.config = { 'marker': [ '[TOC]', 'Text to find and replace with Table of Contents. Set to an empty string to disable. ' 'Default: `[TOC]`.' ], 'title': [ '', 'Title to insert into TOC `

`. Default: an empty string.' ], 'title_class': [ 'toctitle', 'CSS class used for the title. Default: `toctitle`.' ], 'toc_class': [ 'toc', 'CSS class(es) used for the link. Default: `toclink`.' ], 'anchorlink': [ False, 'True if header should be a self link. Default: `False`.' ], 'anchorlink_class': [ 'toclink', 'CSS class(es) used for the link. Defaults: `toclink`.' ], 'permalink': [ 0, 'True or link text if a Sphinx-style permalink should be added. Default: `False`.' ], 'permalink_class': [ 'headerlink', 'CSS class(es) used for the link. Default: `headerlink`.' ], 'permalink_title': [ 'Permanent link', 'Title attribute of the permalink. Default: `Permanent link`.' ], 'permalink_leading': [ False, 'True if permalinks should be placed at start of the header, rather than end. Default: False.' ], 'baselevel': ['1', 'Base level for headers. Default: `1`.'], 'slugify': [ slugify, 'Function to generate anchors based on header text. Default: `slugify`.' ], 'separator': ['-', 'Word separator. Default: `-`.'], 'toc_depth': [ 6, 'Define the range of section levels to include in the Table of Contents. A single integer ' '(b) defines the bottom section level (

..) only. A string consisting of two digits ' 'separated by a hyphen in between (`2-5`) defines the top (t) and the bottom (b) (..). ' 'Default: `6` (bottom).' ], } """ Default configuration options. """ super().__init__(**kwargs) def extendMarkdown(self, md): """ Add TOC tree processor to Markdown. """ md.registerExtension(self) self.md = md self.reset() tocext = self.TreeProcessorClass(md, self.getConfigs()) md.treeprocessors.register(tocext, 'toc', 5) def reset(self) -> None: self.md.toc = '' self.md.toc_tokens = [] def makeExtension(**kwargs): # pragma: no cover return TocExtension(**kwargs) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/markdown/extensions/wikilinks.py0000644000175100001770000000632514657673134021237 0ustar00runnerdocker# WikiLinks Extension for Python-Markdown # ====================================== # Converts [[WikiLinks]] to relative links. # See https://Python-Markdown.github.io/extensions/wikilinks # for documentation. # Original code Copyright [Waylan Limberg](http://achinghead.com/). # All changes Copyright The Python Markdown Project # License: [BSD](https://opensource.org/licenses/bsd-license.php) """ Converts `[[WikiLinks]]` to relative links. See the [documentation](https://Python-Markdown.github.io/extensions/wikilinks) for details. """ from __future__ import annotations from . import Extension from ..inlinepatterns import InlineProcessor import xml.etree.ElementTree as etree import re from typing import Any def build_url(label: str, base: str, end: str) -> str: """ Build a URL from the label, a base, and an end. """ clean_label = re.sub(r'([ ]+_)|(_[ ]+)|([ ]+)', '_', label) return '{}{}{}'.format(base, clean_label, end) class WikiLinkExtension(Extension): """ Add inline processor to Markdown. """ def __init__(self, **kwargs): self.config = { 'base_url': ['/', 'String to append to beginning or URL.'], 'end_url': ['/', 'String to append to end of URL.'], 'html_class': ['wikilink', 'CSS hook. Leave blank for none.'], 'build_url': [build_url, 'Callable formats URL from label.'], } """ Default configuration options. """ super().__init__(**kwargs) def extendMarkdown(self, md): self.md = md # append to end of inline patterns WIKILINK_RE = r'\[\[([\w0-9_ -]+)\]\]' wikilinkPattern = WikiLinksInlineProcessor(WIKILINK_RE, self.getConfigs()) wikilinkPattern.md = md md.inlinePatterns.register(wikilinkPattern, 'wikilink', 75) class WikiLinksInlineProcessor(InlineProcessor): """ Build link from `wikilink`. """ def __init__(self, pattern: str, config: dict[str, Any]): super().__init__(pattern) self.config = config def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str, int, int]: if m.group(1).strip(): base_url, end_url, html_class = self._getMeta() label = m.group(1).strip() url = self.config['build_url'](label, base_url, end_url) a = etree.Element('a') a.text = label a.set('href', url) if html_class: a.set('class', html_class) else: a = '' return a, m.start(0), m.end(0) def _getMeta(self) -> tuple[str, str, str]: """ Return meta data or `config` data. """ base_url = self.config['base_url'] end_url = self.config['end_url'] html_class = self.config['html_class'] if hasattr(self.md, 'Meta'): if 'wiki_base_url' in self.md.Meta: base_url = self.md.Meta['wiki_base_url'][0] if 'wiki_end_url' in self.md.Meta: end_url = self.md.Meta['wiki_end_url'][0] if 'wiki_html_class' in self.md.Meta: html_class = self.md.Meta['wiki_html_class'][0] return base_url, end_url, html_class def makeExtension(**kwargs): # pragma: no cover return WikiLinkExtension(**kwargs) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/markdown/htmlparser.py0000644000175100001770000003377414657673134017225 0ustar00runnerdocker# 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-2023 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). """ This module imports a copy of [`html.parser.HTMLParser`][] and modifies it heavily through monkey-patches. A copy is imported rather than the module being directly imported as this ensures that the user can import and use the unmodified library for their own needs. """ from __future__ import annotations import re import importlib.util import sys from typing import TYPE_CHECKING, Sequence if TYPE_CHECKING: # pragma: no cover from markdown import Markdown # Import a copy of the html.parser lib as `htmlparser` so we can monkeypatch it. # Users can still do `from html import parser` and get the default behavior. spec = importlib.util.find_spec('html.parser') htmlparser = importlib.util.module_from_spec(spec) spec.loader.exec_module(htmlparser) sys.modules['htmlparser'] = htmlparser # Monkeypatch `HTMLParser` to only accept `?>` to close Processing Instructions. htmlparser.piclose = re.compile(r'\?>') # Monkeypatch `HTMLParser` to only recognize entity references with a closing semicolon. htmlparser.entityref = re.compile(r'&([a-zA-Z][-.a-zA-Z0-9]*);') # Monkeypatch `HTMLParser` to no longer support partial entities. We are always feeding a complete block, # so the 'incomplete' functionality is unnecessary. As the `entityref` regex is run right before incomplete, # and the two regex are the same, then incomplete will simply never match and we avoid the logic within. htmlparser.incomplete = htmlparser.entityref # Monkeypatch `HTMLParser` to not accept a backtick in a tag name, attribute name, or bare value. htmlparser.locatestarttagend_tolerant = re.compile(r""" <[a-zA-Z][^`\t\n\r\f />\x00]* # tag name <= added backtick here (?:[\s/]* # optional whitespace before attribute name (?:(?<=['"\s/])[^`\s/>][^\s/=>]* # attribute name <= added backtick here (?:\s*=+\s* # value indicator (?:'[^']*' # LITA-enclosed value |"[^"]*" # LIT-enclosed value |(?!['"])[^`>\s]* # bare value <= added backtick here ) (?:\s*,)* # possibly followed by a comma )?(?:\s|/(?!>))* )* )? \s* # trailing whitespace """, re.VERBOSE) # Match a blank line at the start of a block of text (two newlines). # The newlines may be preceded by additional whitespace. blank_line_re = re.compile(r'^([ ]*\n){2}') class HTMLExtractor(htmlparser.HTMLParser): """ Extract raw HTML from text. The raw HTML is stored in the [`htmlStash`][markdown.util.HtmlStash] of the [`Markdown`][markdown.Markdown] instance passed to `md` and the remaining text is stored in `cleandoc` as a list of strings. """ def __init__(self, md: Markdown, *args, **kwargs): if 'convert_charrefs' not in kwargs: kwargs['convert_charrefs'] = False # Block tags that should contain no content (self closing) self.empty_tags = set(['hr']) self.lineno_start_cache = [0] # This calls self.reset super().__init__(*args, **kwargs) self.md = md def reset(self): """Reset this instance. Loses all unprocessed data.""" self.inraw = False self.intail = False self.stack: list[str] = [] # When `inraw==True`, stack contains a list of tags self._cache: list[str] = [] self.cleandoc: list[str] = [] self.lineno_start_cache = [0] super().reset() def close(self): """Handle any buffered data.""" super().close() if len(self.rawdata): # Temp fix for https://bugs.python.org/issue41989 # TODO: remove this when the bug is fixed in all supported Python versions. if self.convert_charrefs and not self.cdata_elem: # pragma: no cover self.handle_data(htmlparser.unescape(self.rawdata)) else: self.handle_data(self.rawdata) # Handle any unclosed tags. if len(self._cache): self.cleandoc.append(self.md.htmlStash.store(''.join(self._cache))) self._cache = [] @property def line_offset(self) -> int: """Returns char index in `self.rawdata` for the start of the current line. """ for ii in range(len(self.lineno_start_cache)-1, self.lineno-1): last_line_start_pos = self.lineno_start_cache[ii] lf_pos = self.rawdata.find('\n', last_line_start_pos) if lf_pos == -1: # No more newlines found. Use end of raw data as start of line beyond end. lf_pos = len(self.rawdata) self.lineno_start_cache.append(lf_pos+1) return self.lineno_start_cache[self.lineno-1] def at_line_start(self) -> bool: """ Returns True if current position is at start of line. Allows for up to three blank spaces at start of line. """ if self.offset == 0: return True if self.offset > 3: return False # Confirm up to first 3 chars are whitespace return self.rawdata[self.line_offset:self.line_offset + self.offset].strip() == '' def get_endtag_text(self, tag: str) -> str: """ Returns the text of the end tag. If it fails to extract the actual text from the raw data, it builds a closing tag with `tag`. """ # Attempt to extract actual tag from raw source text start = self.line_offset + self.offset m = htmlparser.endendtag.search(self.rawdata, start) if m: return self.rawdata[start:m.end()] else: # pragma: no cover # Failed to extract from raw data. Assume well formed and lowercase. return ''.format(tag) def handle_starttag(self, tag: str, attrs: Sequence[tuple[str, str]]): # Handle tags that should always be empty and do not specify a closing tag if tag in self.empty_tags: self.handle_startendtag(tag, attrs) return if self.md.is_block_level(tag) and (self.intail or (self.at_line_start() and not self.inraw)): # Started a new raw block. Prepare stack. self.inraw = True self.cleandoc.append('\n') text = self.get_starttag_text() if self.inraw: self.stack.append(tag) self._cache.append(text) else: self.cleandoc.append(text) if tag in self.CDATA_CONTENT_ELEMENTS: # This is presumably a standalone tag in a code span (see #1036). self.clear_cdata_mode() def handle_endtag(self, tag: str): text = self.get_endtag_text(tag) if self.inraw: self._cache.append(text) if tag in self.stack: # Remove tag from stack while self.stack: if self.stack.pop() == tag: break if len(self.stack) == 0: # End of raw block. if blank_line_re.match(self.rawdata[self.line_offset + self.offset + len(text):]): # Preserve blank line and end of raw block. self._cache.append('\n') else: # More content exists after `endtag`. self.intail = True # Reset stack. self.inraw = False self.cleandoc.append(self.md.htmlStash.store(''.join(self._cache))) # Insert blank line between this and next line. self.cleandoc.append('\n\n') self._cache = [] else: self.cleandoc.append(text) def handle_data(self, data: str): if self.intail and '\n' in data: self.intail = False if self.inraw: self._cache.append(data) else: self.cleandoc.append(data) def handle_empty_tag(self, data: str, is_block: bool): """ Handle empty tags (``). """ if self.inraw or self.intail: # Append this to the existing raw block self._cache.append(data) elif self.at_line_start() and is_block: # Handle this as a standalone raw block if blank_line_re.match(self.rawdata[self.line_offset + self.offset + len(data):]): # Preserve blank line after tag in raw block. data += '\n' else: # More content exists after tag. self.intail = True item = self.cleandoc[-1] if self.cleandoc else '' # If we only have one newline before block element, add another if not item.endswith('\n\n') and item.endswith('\n'): self.cleandoc.append('\n') self.cleandoc.append(self.md.htmlStash.store(data)) # Insert blank line between this and next line. self.cleandoc.append('\n\n') else: self.cleandoc.append(data) def handle_startendtag(self, tag: str, attrs): self.handle_empty_tag(self.get_starttag_text(), is_block=self.md.is_block_level(tag)) def handle_charref(self, name: str): self.handle_empty_tag('&#{};'.format(name), is_block=False) def handle_entityref(self, name: str): self.handle_empty_tag('&{};'.format(name), is_block=False) def handle_comment(self, data: str): self.handle_empty_tag(''.format(data), is_block=True) def handle_decl(self, data: str): self.handle_empty_tag(''.format(data), is_block=True) def handle_pi(self, data: str): self.handle_empty_tag(''.format(data), is_block=True) def unknown_decl(self, data: str): end = ']]>' if data.startswith('CDATA[') else ']>' self.handle_empty_tag(' int: if self.at_line_start() or self.intail: return super().parse_pi(i) # This is not the beginning of a raw block so treat as plain data # and avoid consuming any tags which may follow (see #1066). self.handle_data(' int: if self.at_line_start() or self.intail: return super().parse_html_declaration(i) # This is not the beginning of a raw block so treat as plain data # and avoid consuming any tags which may follow (see #1066). self.handle_data(' int: # Override the default behavior so that bogus comments get passed # through unaltered by setting `report` to `0` (see #1425). pos = super().parse_bogus_comment(i, report) if pos == -1: # pragma: no cover return -1 self.handle_empty_tag(self.rawdata[i:pos], is_block=False) return pos # The rest has been copied from base class in standard lib to address #1036. # As `__startag_text` is private, all references to it must be in this subclass. # The last few lines of `parse_starttag` are reversed so that `handle_starttag` # can override `cdata_mode` in certain situations (in a code span). __starttag_text: str | None = None def get_starttag_text(self) -> str: """Return full source of start tag: `<...>`.""" return self.__starttag_text def parse_starttag(self, i: int) -> int: # pragma: no cover self.__starttag_text = None endpos = self.check_for_whole_start_tag(i) if endpos < 0: return endpos rawdata = self.rawdata self.__starttag_text = rawdata[i:endpos] # Now parse the data between `i+1` and `j` into a tag and `attrs` attrs = [] match = htmlparser.tagfind_tolerant.match(rawdata, i+1) assert match, 'unexpected call to parse_starttag()' k = match.end() self.lasttag = tag = match.group(1).lower() while k < endpos: m = htmlparser.attrfind_tolerant.match(rawdata, k) if not m: break attrname, rest, attrvalue = m.group(1, 2, 3) if not rest: attrvalue = None elif attrvalue[:1] == '\'' == attrvalue[-1:] or \ attrvalue[:1] == '"' == attrvalue[-1:]: # noqa: E127 attrvalue = attrvalue[1:-1] if attrvalue: attrvalue = htmlparser.unescape(attrvalue) attrs.append((attrname.lower(), attrvalue)) k = m.end() end = rawdata[k:endpos].strip() if end not in (">", "/>"): lineno, offset = self.getpos() if "\n" in self.__starttag_text: lineno = lineno + self.__starttag_text.count("\n") offset = len(self.__starttag_text) \ - self.__starttag_text.rfind("\n") # noqa: E127 else: offset = offset + len(self.__starttag_text) self.handle_data(rawdata[i:endpos]) return endpos if end.endswith('/>'): # XHTML-style empty tag: `` self.handle_startendtag(tag, attrs) else: # *** set `cdata_mode` first so we can override it in `handle_starttag` (see #1036) *** if tag in self.CDATA_CONTENT_ELEMENTS: self.set_cdata_mode(tag) self.handle_starttag(tag, attrs) return endpos ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/markdown/inlinepatterns.py0000644000175100001770000011256014657673134020072 0ustar00runnerdocker# 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-2023 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). """ In version 3.0, a new, more flexible inline processor was added, [`markdown.inlinepatterns.InlineProcessor`][]. The original inline patterns, which inherit from [`markdown.inlinepatterns.Pattern`][] or one of its children are still supported, though users are encouraged to migrate. The new `InlineProcessor` provides two major enhancements to `Patterns`: 1. Inline Processors no longer need to match the entire block, so regular expressions no longer need to start with `r'^(.*?)'` and end with `r'(.*?)%'`. This runs faster. The returned [`Match`][re.Match] object will only contain what is explicitly matched in the pattern, and extension pattern groups now start with `m.group(1)`. 2. The `handleMatch` method now takes an additional input called `data`, which is the entire block under analysis, not just what is matched with the specified pattern. The method now returns the element *and* the indexes relative to `data` that the return element is replacing (usually `m.start(0)` and `m.end(0)`). If the boundaries are returned as `None`, it is assumed that the match did not take place, and nothing will be altered in `data`. This allows handling of more complex constructs than regular expressions can handle, e.g., matching nested brackets, and explicit control of the span "consumed" by the processor. """ from __future__ import annotations from . import util from typing import TYPE_CHECKING, Any, Collection, NamedTuple import re import xml.etree.ElementTree as etree from html import entities if TYPE_CHECKING: # pragma: no cover from markdown import Markdown def build_inlinepatterns(md: Markdown, **kwargs: Any) -> util.Registry[InlineProcessor]: """ Build the default set of inline patterns for Markdown. The order in which processors and/or patterns are applied is very important - e.g. if we first replace `http://.../` links with `` tags and _then_ try to replace inline HTML, we would end up with a mess. So, we apply the expressions in the following order: * backticks and escaped characters have to be handled before everything else so that we can preempt any markdown patterns by escaping them; * then we handle the various types of links (auto-links must be handled before inline HTML); * then we handle inline HTML. At this point we will simply replace all inline HTML strings with a placeholder and add the actual HTML to a stash; * finally we apply strong, emphasis, etc. """ inlinePatterns = util.Registry() inlinePatterns.register(BacktickInlineProcessor(BACKTICK_RE), 'backtick', 190) inlinePatterns.register(EscapeInlineProcessor(ESCAPE_RE, md), 'escape', 180) inlinePatterns.register(ReferenceInlineProcessor(REFERENCE_RE, md), 'reference', 170) inlinePatterns.register(LinkInlineProcessor(LINK_RE, md), 'link', 160) inlinePatterns.register(ImageInlineProcessor(IMAGE_LINK_RE, md), 'image_link', 150) inlinePatterns.register( ImageReferenceInlineProcessor(IMAGE_REFERENCE_RE, md), 'image_reference', 140 ) inlinePatterns.register( ShortReferenceInlineProcessor(REFERENCE_RE, md), 'short_reference', 130 ) inlinePatterns.register( ShortImageReferenceInlineProcessor(IMAGE_REFERENCE_RE, md), 'short_image_ref', 125 ) inlinePatterns.register(AutolinkInlineProcessor(AUTOLINK_RE, md), 'autolink', 120) inlinePatterns.register(AutomailInlineProcessor(AUTOMAIL_RE, md), 'automail', 110) inlinePatterns.register(SubstituteTagInlineProcessor(LINE_BREAK_RE, 'br'), 'linebreak', 100) inlinePatterns.register(HtmlInlineProcessor(HTML_RE, md), 'html', 90) inlinePatterns.register(HtmlInlineProcessor(ENTITY_RE, md), 'entity', 80) inlinePatterns.register(SimpleTextInlineProcessor(NOT_STRONG_RE), 'not_strong', 70) inlinePatterns.register(AsteriskProcessor(r'\*'), 'em_strong', 60) inlinePatterns.register(UnderscoreProcessor(r'_'), 'em_strong2', 50) return inlinePatterns # The actual regular expressions for patterns # ----------------------------------------------------------------------------- NOIMG = r'(?)` or `[text](url "title")`). """ IMAGE_LINK_RE = r'\!\[' """ Match start of in-line image link (`![alttxt](url)` or `![alttxt]()`). """ REFERENCE_RE = LINK_RE """ Match start of reference link (`[Label][3]`). """ IMAGE_REFERENCE_RE = IMAGE_LINK_RE """ Match start of image reference (`![alt text][2]`). """ NOT_STRONG_RE = r'((^|(?<=\s))(\*{1,3}|_{1,3})(?=\s|$))' """ Match a stand-alone `*` or `_`. """ AUTOLINK_RE = r'<((?:[Ff]|[Hh][Tt])[Tt][Pp][Ss]?://[^<>]*)>' """ Match an automatic link (``). """ AUTOMAIL_RE = r'<([^<> !]+@[^@<> ]+)>' """ Match an automatic email link (``). """ HTML_RE = r'(<(\/?[a-zA-Z][^<>@ ]*( [^<>]*)?|!--(?:(?!).)*--)>)' """ Match an HTML tag (`<...>`). """ ENTITY_RE = r'(&(?:\#[0-9]+|\#x[0-9a-fA-F]+|[a-zA-Z0-9]+);)' """ Match an HTML entity (`&` (decimal) or `&` (hex) or `&` (named)). """ LINE_BREAK_RE = r' \n' """ Match two spaces at end of line. """ def dequote(string: str) -> str: """Remove quotes from around a string.""" if ((string.startswith('"') and string.endswith('"')) or (string.startswith("'") and string.endswith("'"))): return string[1:-1] else: return string class EmStrongItem(NamedTuple): """Emphasis/strong pattern item.""" pattern: re.Pattern[str] builder: str tags: str # The pattern classes # ----------------------------------------------------------------------------- class Pattern: # pragma: no cover """ Base class that inline patterns subclass. Inline patterns are handled by means of `Pattern` subclasses, one per regular expression. Each pattern object uses a single regular expression and must support the following methods: [`getCompiledRegExp`][markdown.inlinepatterns.Pattern.getCompiledRegExp] and [`handleMatch`][markdown.inlinepatterns.Pattern.handleMatch]. All the regular expressions used by `Pattern` subclasses must capture the whole block. For this reason, they all start with `^(.*)` and end with `(.*)!`. When passing a regular expression on class initialization, the `^(.*)` and `(.*)!` are added automatically and the regular expression is pre-compiled. It is strongly suggested that the newer style [`markdown.inlinepatterns.InlineProcessor`][] that use a more efficient and flexible search approach be used instead. However, the older style `Pattern` remains for backward compatibility with many existing third-party extensions. """ ANCESTOR_EXCLUDES: Collection[str] = tuple() """ A collection of elements which are undesirable ancestors. The processor will be skipped if it would cause the content to be a descendant of one of the listed tag names. """ compiled_re: re.Pattern[str] md: Markdown | None def __init__(self, pattern: str, md: Markdown | None = None): """ Create an instant of an inline pattern. Arguments: pattern: A regular expression that matches a pattern. md: An optional pointer to the instance of `markdown.Markdown` and is available as `self.md` on the class instance. """ self.pattern = pattern self.compiled_re = re.compile(r"^(.*?)%s(.*)$" % pattern, re.DOTALL | re.UNICODE) self.md = md def getCompiledRegExp(self) -> re.Pattern: """ Return a compiled regular expression. """ return self.compiled_re def handleMatch(self, m: re.Match[str]) -> etree.Element | str: """Return a ElementTree element from the given match. Subclasses should override this method. Arguments: m: A match object containing a match of the pattern. Returns: An ElementTree Element object. """ pass # pragma: no cover def type(self) -> str: """ Return class name, to define pattern type """ return self.__class__.__name__ def unescape(self, text: str) -> str: """ Return unescaped text given text with an inline placeholder. """ try: stash = self.md.treeprocessors['inline'].stashed_nodes except KeyError: # pragma: no cover return text def get_stash(m): id = m.group(1) if id in stash: value = stash.get(id) if isinstance(value, str): return value else: # An `etree` Element - return text content only return ''.join(value.itertext()) return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text) class InlineProcessor(Pattern): """ Base class that inline processors subclass. This is the newer style inline processor that uses a more efficient and flexible search approach. """ def __init__(self, pattern: str, md: Markdown | None = None): """ Create an instant of an inline processor. Arguments: pattern: A regular expression that matches a pattern. md: An optional pointer to the instance of `markdown.Markdown` and is available as `self.md` on the class instance. """ self.pattern = pattern self.compiled_re = re.compile(pattern, re.DOTALL | re.UNICODE) # API for Markdown to pass `safe_mode` into instance self.safe_mode = False self.md = md def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str | None, int | None, int | None]: """Return a ElementTree element from the given match and the start and end index of the matched text. If `start` and/or `end` are returned as `None`, it will be assumed that the processor did not find a valid region of text. Subclasses should override this method. Arguments: m: A re match object containing a match of the pattern. data: The buffer currently under analysis. Returns: el: The ElementTree element, text or None. start: The start of the region that has been matched or None. end: The end of the region that has been matched or None. """ pass # pragma: no cover class SimpleTextPattern(Pattern): # pragma: no cover """ Return a simple text of `group(2)` of a Pattern. """ def handleMatch(self, m: re.Match[str]) -> str: """ Return string content of `group(2)` of a matching pattern. """ return m.group(2) class SimpleTextInlineProcessor(InlineProcessor): """ Return a simple text of `group(1)` of a Pattern. """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[str, int, int]: """ Return string content of `group(1)` of a matching pattern. """ return m.group(1), m.start(0), m.end(0) class EscapeInlineProcessor(InlineProcessor): """ Return an escaped character. """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[str | None, int, int]: """ If the character matched by `group(1)` of a pattern is in [`ESCAPED_CHARS`][markdown.Markdown.ESCAPED_CHARS] then return the integer representing the character's Unicode code point (as returned by [`ord`][]) wrapped in [`util.STX`][markdown.util.STX] and [`util.ETX`][markdown.util.ETX]. If the matched character is not in [`ESCAPED_CHARS`][markdown.Markdown.ESCAPED_CHARS], then return `None`. """ char = m.group(1) if char in self.md.ESCAPED_CHARS: return '{}{}{}'.format(util.STX, ord(char), util.ETX), m.start(0), m.end(0) else: return None, m.start(0), m.end(0) class SimpleTagPattern(Pattern): # pragma: no cover """ Return element of type `tag` with a text attribute of `group(3)` of a Pattern. """ def __init__(self, pattern: str, tag: str): """ Create an instant of an simple tag pattern. Arguments: pattern: A regular expression that matches a pattern. tag: Tag of element. """ Pattern.__init__(self, pattern) self.tag = tag """ The tag of the rendered element. """ def handleMatch(self, m: re.Match[str]) -> etree.Element: """ Return [`Element`][xml.etree.ElementTree.Element] of type `tag` with the string in `group(3)` of a matching pattern as the Element's text. """ el = etree.Element(self.tag) el.text = m.group(3) return el class SimpleTagInlineProcessor(InlineProcessor): """ Return element of type `tag` with a text attribute of `group(2)` of a Pattern. """ def __init__(self, pattern: str, tag: str): """ Create an instant of an simple tag processor. Arguments: pattern: A regular expression that matches a pattern. tag: Tag of element. """ InlineProcessor.__init__(self, pattern) self.tag = tag """ The tag of the rendered element. """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element, int, int]: # pragma: no cover """ Return [`Element`][xml.etree.ElementTree.Element] of type `tag` with the string in `group(2)` of a matching pattern as the Element's text. """ el = etree.Element(self.tag) el.text = m.group(2) return el, m.start(0), m.end(0) class SubstituteTagPattern(SimpleTagPattern): # pragma: no cover """ Return an element of type `tag` with no children. """ def handleMatch(self, m: re.Match[str]) -> etree.Element: """ Return empty [`Element`][xml.etree.ElementTree.Element] of type `tag`. """ return etree.Element(self.tag) class SubstituteTagInlineProcessor(SimpleTagInlineProcessor): """ Return an element of type `tag` with no children. """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element, int, int]: """ Return empty [`Element`][xml.etree.ElementTree.Element] of type `tag`. """ return etree.Element(self.tag), m.start(0), m.end(0) class BacktickInlineProcessor(InlineProcessor): """ Return a `` element containing the escaped matching text. """ def __init__(self, pattern: str): InlineProcessor.__init__(self, pattern) self.ESCAPED_BSLASH = '{}{}{}'.format(util.STX, ord('\\'), util.ETX) self.tag = 'code' """ The tag of the rendered element. """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str, int, int]: """ If the match contains `group(3)` of a pattern, then return a `code` [`Element`][xml.etree.ElementTree.Element] which contains HTML escaped text (with [`code_escape`][markdown.util.code_escape]) as an [`AtomicString`][markdown.util.AtomicString]. If the match does not contain `group(3)` then return the text of `group(1)` backslash escaped. """ if m.group(3): el = etree.Element(self.tag) el.text = util.AtomicString(util.code_escape(m.group(3).strip())) return el, m.start(0), m.end(0) else: return m.group(1).replace('\\\\', self.ESCAPED_BSLASH), m.start(0), m.end(0) class DoubleTagPattern(SimpleTagPattern): # pragma: no cover """Return a ElementTree element nested in tag2 nested in tag1. Useful for strong emphasis etc. """ def handleMatch(self, m: re.Match[str]) -> etree.Element: """ Return [`Element`][xml.etree.ElementTree.Element] in following format: `group(3)group(4)` where `group(4)` is optional. """ tag1, tag2 = self.tag.split(",") el1 = etree.Element(tag1) el2 = etree.SubElement(el1, tag2) el2.text = m.group(3) if len(m.groups()) == 5: el2.tail = m.group(4) return el1 class DoubleTagInlineProcessor(SimpleTagInlineProcessor): """Return a ElementTree element nested in tag2 nested in tag1. Useful for strong emphasis etc. """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element, int, int]: # pragma: no cover """ Return [`Element`][xml.etree.ElementTree.Element] in following format: `group(2)group(3)` where `group(3)` is optional. """ tag1, tag2 = self.tag.split(",") el1 = etree.Element(tag1) el2 = etree.SubElement(el1, tag2) el2.text = m.group(2) if len(m.groups()) == 3: el2.tail = m.group(3) return el1, m.start(0), m.end(0) class HtmlInlineProcessor(InlineProcessor): """ Store raw inline html and return a placeholder. """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[str, int, int]: """ Store the text of `group(1)` of a pattern and return a placeholder string. """ rawhtml = self.backslash_unescape(self.unescape(m.group(1))) place_holder = self.md.htmlStash.store(rawhtml) return place_holder, m.start(0), m.end(0) def unescape(self, text: str) -> str: """ Return unescaped text given text with an inline placeholder. """ try: stash = self.md.treeprocessors['inline'].stashed_nodes except KeyError: # pragma: no cover return text def get_stash(m: re.Match[str]) -> str: id = m.group(1) value = stash.get(id) if value is not None: try: return self.md.serializer(value) except Exception: return r'\%s' % value return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text) def backslash_unescape(self, text: str) -> str: """ Return text with backslash escapes undone (backslashes are restored). """ try: RE = self.md.treeprocessors['unescape'].RE except KeyError: # pragma: no cover return text def _unescape(m: re.Match[str]) -> str: return chr(int(m.group(1))) return RE.sub(_unescape, text) class AsteriskProcessor(InlineProcessor): """Emphasis processor for handling strong and em matches inside asterisks.""" PATTERNS = [ EmStrongItem(re.compile(EM_STRONG_RE, re.DOTALL | re.UNICODE), 'double', 'strong,em'), EmStrongItem(re.compile(STRONG_EM_RE, re.DOTALL | re.UNICODE), 'double', 'em,strong'), EmStrongItem(re.compile(STRONG_EM3_RE, re.DOTALL | re.UNICODE), 'double2', 'strong,em'), EmStrongItem(re.compile(STRONG_RE, re.DOTALL | re.UNICODE), 'single', 'strong'), EmStrongItem(re.compile(EMPHASIS_RE, re.DOTALL | re.UNICODE), 'single', 'em') ] """ The various strong and emphasis patterns handled by this processor. """ def build_single(self, m: re.Match[str], tag: str, idx: int) -> etree.Element: """Return single tag.""" el1 = etree.Element(tag) text = m.group(2) self.parse_sub_patterns(text, el1, None, idx) return el1 def build_double(self, m: re.Match[str], tags: str, idx: int) -> etree.Element: """Return double tag.""" tag1, tag2 = tags.split(",") el1 = etree.Element(tag1) el2 = etree.Element(tag2) text = m.group(2) self.parse_sub_patterns(text, el2, None, idx) el1.append(el2) if len(m.groups()) == 3: text = m.group(3) self.parse_sub_patterns(text, el1, el2, idx) return el1 def build_double2(self, m: re.Match[str], tags: str, idx: int) -> etree.Element: """Return double tags (variant 2): `text text`.""" tag1, tag2 = tags.split(",") el1 = etree.Element(tag1) el2 = etree.Element(tag2) text = m.group(2) self.parse_sub_patterns(text, el1, None, idx) text = m.group(3) el1.append(el2) self.parse_sub_patterns(text, el2, None, idx) return el1 def parse_sub_patterns( self, data: str, parent: etree.Element, last: etree.Element | None, idx: int ) -> None: """ Parses sub patterns. `data`: text to evaluate. `parent`: Parent to attach text and sub elements to. `last`: Last appended child to parent. Can also be None if parent has no children. `idx`: Current pattern index that was used to evaluate the parent. """ offset = 0 pos = 0 length = len(data) while pos < length: # Find the start of potential emphasis or strong tokens if self.compiled_re.match(data, pos): matched = False # See if the we can match an emphasis/strong pattern for index, item in enumerate(self.PATTERNS): # Only evaluate patterns that are after what was used on the parent if index <= idx: continue m = item.pattern.match(data, pos) if m: # Append child nodes to parent # Text nodes should be appended to the last # child if present, and if not, it should # be added as the parent's text node. text = data[offset:m.start(0)] if text: if last is not None: last.tail = text else: parent.text = text el = self.build_element(m, item.builder, item.tags, index) parent.append(el) last = el # Move our position past the matched hunk offset = pos = m.end(0) matched = True if not matched: # We matched nothing, move on to the next character pos += 1 else: # Increment position as no potential emphasis start was found. pos += 1 # Append any leftover text as a text node. text = data[offset:] if text: if last is not None: last.tail = text else: parent.text = text def build_element(self, m: re.Match[str], builder: str, tags: str, index: int) -> etree.Element: """Element builder.""" if builder == 'double2': return self.build_double2(m, tags, index) elif builder == 'double': return self.build_double(m, tags, index) else: return self.build_single(m, tags, index) def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | None, int | None, int | None]: """Parse patterns.""" el = None start = None end = None for index, item in enumerate(self.PATTERNS): m1 = item.pattern.match(data, m.start(0)) if m1: start = m1.start(0) end = m1.end(0) el = self.build_element(m1, item.builder, item.tags, index) break return el, start, end class UnderscoreProcessor(AsteriskProcessor): """Emphasis processor for handling strong and em matches inside underscores.""" PATTERNS = [ EmStrongItem(re.compile(EM_STRONG2_RE, re.DOTALL | re.UNICODE), 'double', 'strong,em'), EmStrongItem(re.compile(STRONG_EM2_RE, re.DOTALL | re.UNICODE), 'double', 'em,strong'), EmStrongItem(re.compile(SMART_STRONG_EM_RE, re.DOTALL | re.UNICODE), 'double2', 'strong,em'), EmStrongItem(re.compile(SMART_STRONG_RE, re.DOTALL | re.UNICODE), 'single', 'strong'), EmStrongItem(re.compile(SMART_EMPHASIS_RE, re.DOTALL | re.UNICODE), 'single', 'em') ] """ The various strong and emphasis patterns handled by this processor. """ class LinkInlineProcessor(InlineProcessor): """ Return a link element from the given match. """ RE_LINK = re.compile(r'''\(\s*(?:(<[^<>]*>)\s*(?:('[^']*'|"[^"]*")\s*)?\))?''', re.DOTALL | re.UNICODE) RE_TITLE_CLEAN = re.compile(r'\s') def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | None, int | None, int | None]: """ Return an `a` [`Element`][xml.etree.ElementTree.Element] or `(None, None, None)`. """ text, index, handled = self.getText(data, m.end(0)) if not handled: return None, None, None href, title, index, handled = self.getLink(data, index) if not handled: return None, None, None el = etree.Element("a") el.text = text el.set("href", href) if title is not None: el.set("title", title) return el, m.start(0), index def getLink(self, data: str, index: int) -> tuple[str, str | None, int, bool]: """Parse data between `()` of `[Text]()` allowing recursive `()`. """ href = '' title: str | None = None handled = False m = self.RE_LINK.match(data, pos=index) if m and m.group(1): # Matches [Text]( "title") href = m.group(1)[1:-1].strip() if m.group(2): title = m.group(2)[1:-1] index = m.end(0) handled = True elif m: # Track bracket nesting and index in string bracket_count = 1 backtrack_count = 1 start_index = m.end() index = start_index last_bracket = -1 # Primary (first found) quote tracking. quote: str | None = None start_quote = -1 exit_quote = -1 ignore_matches = False # Secondary (second found) quote tracking. alt_quote = None start_alt_quote = -1 exit_alt_quote = -1 # Track last character last = '' for pos in range(index, len(data)): c = data[pos] if c == '(': # Count nested ( # Don't increment the bracket count if we are sure we're in a title. if not ignore_matches: bracket_count += 1 elif backtrack_count > 0: backtrack_count -= 1 elif c == ')': # Match nested ) to ( # Don't decrement if we are sure we are in a title that is unclosed. if ((exit_quote != -1 and quote == last) or (exit_alt_quote != -1 and alt_quote == last)): bracket_count = 0 elif not ignore_matches: bracket_count -= 1 elif backtrack_count > 0: backtrack_count -= 1 # We've found our backup end location if the title doesn't resolve. if backtrack_count == 0: last_bracket = index + 1 elif c in ("'", '"'): # Quote has started if not quote: # We'll assume we are now in a title. # Brackets are quoted, so no need to match them (except for the final one). ignore_matches = True backtrack_count = bracket_count bracket_count = 1 start_quote = index + 1 quote = c # Secondary quote (in case the first doesn't resolve): [text](link'"title") elif c != quote and not alt_quote: start_alt_quote = index + 1 alt_quote = c # Update primary quote match elif c == quote: exit_quote = index + 1 # Update secondary quote match elif alt_quote and c == alt_quote: exit_alt_quote = index + 1 index += 1 # Link is closed, so let's break out of the loop if bracket_count == 0: # Get the title if we closed a title string right before link closed if exit_quote >= 0 and quote == last: href = data[start_index:start_quote - 1] title = ''.join(data[start_quote:exit_quote - 1]) elif exit_alt_quote >= 0 and alt_quote == last: href = data[start_index:start_alt_quote - 1] title = ''.join(data[start_alt_quote:exit_alt_quote - 1]) else: href = data[start_index:index - 1] break if c != ' ': last = c # We have a scenario: `[test](link"notitle)` # When we enter a string, we stop tracking bracket resolution in the main counter, # but we do keep a backup counter up until we discover where we might resolve all brackets # if the title string fails to resolve. if bracket_count != 0 and backtrack_count == 0: href = data[start_index:last_bracket - 1] index = last_bracket bracket_count = 0 handled = bracket_count == 0 if title is not None: title = self.RE_TITLE_CLEAN.sub(' ', dequote(self.unescape(title.strip()))) href = self.unescape(href).strip() return href, title, index, handled def getText(self, data: str, index: int) -> tuple[str, int, bool]: """Parse the content between `[]` of the start of an image or link resolving nested square brackets. """ bracket_count = 1 text = [] for pos in range(index, len(data)): c = data[pos] if c == ']': bracket_count -= 1 elif c == '[': bracket_count += 1 index += 1 if bracket_count == 0: break text.append(c) return ''.join(text), index, bracket_count == 0 class ImageInlineProcessor(LinkInlineProcessor): """ Return a `img` element from the given match. """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | None, int | None, int | None]: """ Return an `img` [`Element`][xml.etree.ElementTree.Element] or `(None, None, None)`. """ text, index, handled = self.getText(data, m.end(0)) if not handled: return None, None, None src, title, index, handled = self.getLink(data, index) if not handled: return None, None, None el = etree.Element("img") el.set("src", src) if title is not None: el.set("title", title) el.set('alt', self.unescape(text)) return el, m.start(0), index class ReferenceInlineProcessor(LinkInlineProcessor): """ Match to a stored reference and return link element. """ NEWLINE_CLEANUP_RE = re.compile(r'\s+', re.MULTILINE) RE_LINK = re.compile(r'\s?\[([^\]]*)\]', re.DOTALL | re.UNICODE) def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | None, int | None, int | None]: """ Return [`Element`][xml.etree.ElementTree.Element] returned by `makeTag` method or `(None, None, None)`. """ text, index, handled = self.getText(data, m.end(0)) if not handled: return None, None, None id, end, handled = self.evalId(data, index, text) if not handled: return None, None, None # Clean up line breaks in id id = self.NEWLINE_CLEANUP_RE.sub(' ', id) if id not in self.md.references: # ignore undefined refs return None, m.start(0), end href, title = self.md.references[id] return self.makeTag(href, title, text), m.start(0), end def evalId(self, data: str, index: int, text: str) -> tuple[str | None, int, bool]: """ Evaluate the id portion of `[ref][id]`. If `[ref][]` use `[ref]`. """ m = self.RE_LINK.match(data, pos=index) if not m: return None, index, False else: id = m.group(1).lower() end = m.end(0) if not id: id = text.lower() return id, end, True def makeTag(self, href: str, title: str, text: str) -> etree.Element: """ Return an `a` [`Element`][xml.etree.ElementTree.Element]. """ el = etree.Element('a') el.set('href', href) if title: el.set('title', title) el.text = text return el class ShortReferenceInlineProcessor(ReferenceInlineProcessor): """Short form of reference: `[google]`. """ def evalId(self, data: str, index: int, text: str) -> tuple[str, int, bool]: """Evaluate the id of `[ref]`. """ return text.lower(), index, True class ImageReferenceInlineProcessor(ReferenceInlineProcessor): """ Match to a stored reference and return `img` element. """ def makeTag(self, href: str, title: str, text: str) -> etree.Element: """ Return an `img` [`Element`][xml.etree.ElementTree.Element]. """ el = etree.Element("img") el.set("src", href) if title: el.set("title", title) el.set("alt", self.unescape(text)) return el class ShortImageReferenceInlineProcessor(ImageReferenceInlineProcessor): """ Short form of image reference: `![ref]`. """ def evalId(self, data: str, index: int, text: str) -> tuple[str, int, bool]: """Evaluate the id of `[ref]`. """ return text.lower(), index, True class AutolinkInlineProcessor(InlineProcessor): """ Return a link Element given an auto-link (``). """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element, int, int]: """ Return an `a` [`Element`][xml.etree.ElementTree.Element] of `group(1)`. """ el = etree.Element("a") el.set('href', self.unescape(m.group(1))) el.text = util.AtomicString(m.group(1)) return el, m.start(0), m.end(0) class AutomailInlineProcessor(InlineProcessor): """ Return a `mailto` link Element given an auto-mail link (``). """ def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element, int, int]: """ Return an [`Element`][xml.etree.ElementTree.Element] containing a `mailto` link of `group(1)`. """ el = etree.Element('a') email = self.unescape(m.group(1)) if email.startswith("mailto:"): email = email[len("mailto:"):] def codepoint2name(code: int) -> str: """Return entity definition by code, or the code if not defined.""" entity = entities.codepoint2name.get(code) if entity: return "{}{};".format(util.AMP_SUBSTITUTE, entity) else: return "%s#%d;" % (util.AMP_SUBSTITUTE, code) letters = [codepoint2name(ord(letter)) for letter in email] el.text = util.AtomicString(''.join(letters)) mailto = "mailto:" + email mailto = "".join([util.AMP_SUBSTITUTE + '#%d;' % ord(letter) for letter in mailto]) el.set('href', mailto) return el, m.start(0), m.end(0) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/markdown/postprocessors.py0000644000175100001770000001130714657673134020140 0ustar00runnerdocker# 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-2023 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). """ Post-processors run on the text of the entire document after is has been serialized into a string. Postprocessors should be used to work with the text just before output. Usually, they are used add back sections that were extracted in a preprocessor, fix up outgoing encodings, or wrap the whole document. """ from __future__ import annotations from collections import OrderedDict from typing import TYPE_CHECKING, Any from . import util import re if TYPE_CHECKING: # pragma: no cover from markdown import Markdown def build_postprocessors(md: Markdown, **kwargs: Any) -> util.Registry[Postprocessor]: """ Build the default postprocessors for Markdown. """ postprocessors = util.Registry() postprocessors.register(RawHtmlPostprocessor(md), 'raw_html', 30) postprocessors.register(AndSubstitutePostprocessor(), 'amp_substitute', 20) return postprocessors class Postprocessor(util.Processor): """ Postprocessors are run after the ElementTree it converted back into text. Each Postprocessor implements a `run` method that takes a pointer to a text string, modifies it as necessary and returns a text string. Postprocessors must extend `Postprocessor`. """ def run(self, text: str) -> str: """ Subclasses of `Postprocessor` should implement a `run` method, which takes the html document as a single text string and returns a (possibly modified) string. """ pass # pragma: no cover class RawHtmlPostprocessor(Postprocessor): """ Restore raw html to the document. """ BLOCK_LEVEL_REGEX = re.compile(r'^\<\/?([^ >]+)') def run(self, text: str) -> str: """ Iterate over html stash and restore html. """ replacements = OrderedDict() for i in range(self.md.htmlStash.html_counter): html = self.stash_to_string(self.md.htmlStash.rawHtmlBlocks[i]) if self.isblocklevel(html): replacements["

{}

".format( self.md.htmlStash.get_placeholder(i))] = html replacements[self.md.htmlStash.get_placeholder(i)] = html def substitute_match(m: re.Match[str]) -> str: key = m.group(0) if key not in replacements: if key[3:-4] in replacements: return f'

{ replacements[key[3:-4]] }

' else: return key return replacements[key] if replacements: base_placeholder = util.HTML_PLACEHOLDER % r'([0-9]+)' pattern = re.compile(f'

{ base_placeholder }

|{ base_placeholder }') processed_text = pattern.sub(substitute_match, text) else: return text if processed_text == text: return processed_text else: return self.run(processed_text) def isblocklevel(self, html: str) -> bool: """ Check is block of HTML is block-level. """ m = self.BLOCK_LEVEL_REGEX.match(html) if m: if m.group(1)[0] in ('!', '?', '@', '%'): # Comment, PHP etc... return True return self.md.is_block_level(m.group(1)) return False def stash_to_string(self, text: str) -> str: """ Convert a stashed object to a string. """ return str(text) class AndSubstitutePostprocessor(Postprocessor): """ Restore valid entities """ def run(self, text: str) -> str: text = text.replace(util.AMP_SUBSTITUTE, "&") return text @util.deprecated( "This class is deprecated and will be removed in the future; " "use [`UnescapeTreeprocessor`][markdown.treeprocessors.UnescapeTreeprocessor] instead." ) class UnescapePostprocessor(Postprocessor): """ Restore escaped chars. """ RE = re.compile(r'{}(\d+){}'.format(util.STX, util.ETX)) def unescape(self, m: re.Match[str]) -> str: return chr(int(m.group(1))) def run(self, text: str) -> str: return self.RE.sub(self.unescape, text) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/markdown/preprocessors.py0000644000175100001770000000623014657673134017740 0ustar00runnerdocker# 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-2023 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). """ Preprocessors work on source text before it is broken down into its individual parts. This is an excellent place to clean up bad characters or to extract portions for later processing that the parser may otherwise choke on. """ from __future__ import annotations from typing import TYPE_CHECKING, Any from . import util from .htmlparser import HTMLExtractor import re if TYPE_CHECKING: # pragma: no cover from markdown import Markdown def build_preprocessors(md: Markdown, **kwargs: Any) -> util.Registry[Preprocessor]: """ Build and return the default set of preprocessors used by Markdown. """ preprocessors = util.Registry() preprocessors.register(NormalizeWhitespace(md), 'normalize_whitespace', 30) preprocessors.register(HtmlBlockPreprocessor(md), 'html_block', 20) return preprocessors class Preprocessor(util.Processor): """ Preprocessors are run after the text is broken into lines. Each preprocessor implements a `run` method that takes a pointer to a list of lines of the document, modifies it as necessary and returns either the same pointer or a pointer to a new list. Preprocessors must extend `Preprocessor`. """ def run(self, lines: list[str]) -> list[str]: """ Each subclass of `Preprocessor` should override the `run` method, which takes the document as a list of strings split by newlines and returns the (possibly modified) list of lines. """ pass # pragma: no cover class NormalizeWhitespace(Preprocessor): """ Normalize whitespace for consistent parsing. """ def run(self, lines: list[str]) -> list[str]: source = '\n'.join(lines) source = source.replace(util.STX, "").replace(util.ETX, "") source = source.replace("\r\n", "\n").replace("\r", "\n") + "\n\n" source = source.expandtabs(self.md.tab_length) source = re.sub(r'(?<=\n) +\n', '\n', source) return source.split('\n') class HtmlBlockPreprocessor(Preprocessor): """ Remove html blocks from the text and store them for later retrieval. The raw HTML is stored in the [`htmlStash`][markdown.util.HtmlStash] of the [`Markdown`][markdown.Markdown] instance. """ def run(self, lines: list[str]) -> list[str]: source = '\n'.join(lines) parser = HTMLExtractor(self.md) parser.feed(source) parser.close() return ''.join(parser.cleandoc).split('\n') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/markdown/serializers.py0000644000175100001770000001600614657673134017365 0ustar00runnerdocker# Add x/html serialization to `Elementree` # Taken from ElementTree 1.3 preview with slight modifications # # Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # https://www.pythonware.com/ # # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2007 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you agree that you have read, understood, # and will comply with the following terms and conditions: # # Permission to use, copy, modify, and distribute this software and # its associated documentation for any purpose and without fee is # hereby granted, provided that the above copyright notice appears in # all copies, and that both that copyright notice and this permission # notice appear in supporting documentation, and that the name of # Secret Labs AB or the author not be used in advertising or publicity # pertaining to distribution of the software without specific, written # prior permission. # # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- # ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. # -------------------------------------------------------------------- """ Python-Markdown provides two serializers which render [`ElementTree.Element`][xml.etree.ElementTree.Element] objects to a string of HTML. Both functions wrap the same underlying code with only a few minor differences as outlined below: 1. Empty (self-closing) tags are rendered as `` for HTML and as `` for XHTML. 2. Boolean attributes are rendered as `attrname` for HTML and as `attrname="attrname"` for XHTML. """ from __future__ import annotations from xml.etree.ElementTree import ProcessingInstruction from xml.etree.ElementTree import Comment, ElementTree, Element, QName, HTML_EMPTY import re from typing import Callable, Literal, NoReturn __all__ = ['to_html_string', 'to_xhtml_string'] RE_AMP = re.compile(r'&(?!(?:\#[0-9]+|\#x[0-9a-f]+|[0-9a-z]+);)', re.I) def _raise_serialization_error(text: str) -> NoReturn: # pragma: no cover raise TypeError( "cannot serialize {!r} (type {})".format(text, type(text).__name__) ) def _escape_cdata(text) -> str: # escape character data try: # it's worth avoiding do-nothing calls for strings that are # shorter than 500 character, or so. assume that's, by far, # the most common case in most applications. if "&" in text: # Only replace & when not part of an entity text = RE_AMP.sub('&', text) if "<" in text: text = text.replace("<", "<") if ">" in text: text = text.replace(">", ">") return text except (TypeError, AttributeError): # pragma: no cover _raise_serialization_error(text) def _escape_attrib(text: str) -> str: # escape attribute value try: if "&" in text: # Only replace & when not part of an entity text = RE_AMP.sub('&', text) if "<" in text: text = text.replace("<", "<") if ">" in text: text = text.replace(">", ">") if "\"" in text: text = text.replace("\"", """) if "\n" in text: text = text.replace("\n", " ") return text except (TypeError, AttributeError): # pragma: no cover _raise_serialization_error(text) def _escape_attrib_html(text: str) -> str: # escape attribute value try: if "&" in text: # Only replace & when not part of an entity text = RE_AMP.sub('&', text) if "<" in text: text = text.replace("<", "<") if ">" in text: text = text.replace(">", ">") if "\"" in text: text = text.replace("\"", """) return text except (TypeError, AttributeError): # pragma: no cover _raise_serialization_error(text) def _serialize_html(write: Callable[[str], None], elem: Element, format: Literal["html", "xhtml"]) -> None: tag = elem.tag text = elem.text if tag is Comment: write("" % _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(' {}="{}"'.format(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: Element, format: Literal["html", "xhtml"] = "html") -> str: assert root is not None data: list[str] = [] write = data.append _serialize_html(write, root, format) return "".join(data) # -------------------------------------------------------------------- # public functions def to_html_string(element: Element) -> str: """ Serialize element and its children to a string of HTML5. """ return _write_html(ElementTree(element).getroot(), format="html") def to_xhtml_string(element: Element) -> str: """ Serialize element and its children to a string of XHTML. """ return _write_html(ElementTree(element).getroot(), format="xhtml") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/markdown/test_tools.py0000644000175100001770000002072614657673134017234 0ustar00runnerdocker# 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-2023 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). """ A collection of tools for testing the Markdown code base and extensions. """ from __future__ import annotations import os import sys import unittest import textwrap from typing import Any from . import markdown, Markdown, util 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 output and expected output 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: dict[str, Any] = {} """ Default options to pass to Markdown for each test. """ def assertMarkdownRenders(self, source, expected, expected_attrs=None, **kwargs): """ Test that source Markdown text renders to expected output with given keywords. `expected_attrs` accepts a `dict`. Each key should be the name of an attribute on the `Markdown` instance and the value should be the expected value after the source text is parsed by Markdown. After the expected output is tested, the expected value for each attribute is compared against the actual attribute of the `Markdown` instance using `TestCase.assertEqual`. """ expected_attrs = expected_attrs or {} kws = self.default_kwargs.copy() kws.update(kwargs) md = Markdown(**kws) output = md.convert(source) self.assertMultiLineEqual(output, expected) for key, value in expected_attrs.items(): self.assertEqual(getattr(md, key), value) 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() class recursionlimit: """ A context manager which temporarily modifies the Python recursion limit. The testing framework, coverage, etc. may add an arbitrary number of levels to the depth. To maintain consistency in the tests, the current stack depth is determined when called, then added to the provided limit. Example usage: ``` python with recursionlimit(20): # test code here ``` See . """ def __init__(self, limit): self.limit = util._get_stack_depth() + limit self.old_limit = sys.getrecursionlimit() def __enter__(self): sys.setrecursionlimit(self.limit) def __exit__(self, type, value, tb): sys.setrecursionlimit(self.old_limit) ######################### # 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 open(infile, encoding="utf-8") as f: input = f.read() with 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: try: expected = _normalize_whitespace(expected) output = _normalize_whitespace(output) except OSError: self.skipTest("Tidylib's c library not available.") 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) class LegacyTestCase(unittest.TestCase, metaclass=LegacyTestMeta): """ 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: Attributes: location (str): A path to the directory of test files. An absolute path is preferred. exclude (list[str]): A list of tests to exclude. Each test name should comprise the filename without an extension. normalize (bool): A boolean value indicating if the HTML should be normalized. Default: `False`. input_ext (str): A string containing the file extension of input files. Default: `.txt`. output_ext (str): A string containing the file extension of expected output files. Default: `html`. default_kwargs (Kwargs[str, Any]): 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 without 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/markdown/treeprocessors.py0000644000175100001770000004236314657673134020120 0ustar00runnerdocker# 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-2023 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). """ Tree processors manipulate the tree created by block processors. They can even create an entirely new `ElementTree` object. This is an excellent place for creating summaries, adding collected references, or last minute adjustments. """ from __future__ import annotations import re import xml.etree.ElementTree as etree from typing import TYPE_CHECKING, Any from . import util from . import inlinepatterns if TYPE_CHECKING: # pragma: no cover from markdown import Markdown def build_treeprocessors(md: Markdown, **kwargs: Any) -> util.Registry[Treeprocessor]: """ Build the default `treeprocessors` for Markdown. """ treeprocessors = util.Registry() treeprocessors.register(InlineProcessor(md), 'inline', 20) treeprocessors.register(PrettifyTreeprocessor(md), 'prettify', 10) treeprocessors.register(UnescapeTreeprocessor(md), 'unescape', 0) return treeprocessors def isString(s: object) -> bool: """ Return `True` if object is a string but not an [`AtomicString`][markdown.util.AtomicString]. """ if not isinstance(s, util.AtomicString): return isinstance(s, str) return False class Treeprocessor(util.Processor): """ `Treeprocessor`s are run on the `ElementTree` object before serialization. Each `Treeprocessor` implements a `run` method that takes a pointer to an `Element` and modifies it as necessary. `Treeprocessors` must extend `markdown.Treeprocessor`. """ def run(self, root: etree.Element) -> etree.Element | None: """ Subclasses of `Treeprocessor` should implement a `run` method, which takes a root `Element`. This method can return another `Element` object, and the existing root `Element` 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: Markdown): 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: list[str] = [] def __makePlaceholder(self, type: str) -> tuple[str, str]: """ Generate a placeholder """ id = "%04d" % len(self.stashed_nodes) hash = util.INLINE_PLACEHOLDER % id return hash, id def __findPlaceholder(self, data: str, index: int) -> tuple[str | None, int]: """ Extract id from data string, start from index. 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: etree.Element | str, type: str) -> str: """ Add node to stash. """ placeholder, id = self.__makePlaceholder(type) self.stashed_nodes[id] = node return placeholder def __handleInline(self, data: str, patternIndex: int = 0) -> str: """ Process string with inline patterns and replace it with placeholders. 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 count = len(self.inlinePatterns) while patternIndex < count: data, matched, startIndex = self.__applyPattern( self.inlinePatterns[patternIndex], data, patternIndex, startIndex ) if not matched: patternIndex += 1 return data def __processElementText(self, node: etree.Element, subnode: etree.Element, isText: bool = True) -> None: """ Process placeholders in `Element.text` or `Element.tail` of Elements popped from `self.stashed_nodes`. Arguments: node: Parent node. subnode: Processing node. isText: Boolean variable, True - it's text, False - it's a tail. """ 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: str | None, parent: etree.Element, isText: bool = True ) -> list[tuple[etree.Element, list[str]]]: """ Process string with placeholders and generate `ElementTree` tree. Arguments: data: String with placeholders instead of `ElementTree` elements. parent: Element, which contains processing inline data. isText: Boolean variable, True - it's text, False - it's a tail. Returns: List with `ElementTree` elements with applied inline patterns. """ def linkText(text: str | None) -> None: 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 isinstance(node, str): # 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: inlinepatterns.Pattern, data: str, patternIndex: int, startIndex: int = 0 ) -> tuple[str, bool, int]: """ Check if the line fits the pattern, create the necessary elements, add it to `stashed_nodes`. 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 isinstance(node, str): 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 "{}{}{}".format(data[:start], placeholder, data[end:]), True, 0 else: # pragma: no cover return "{}{}{}{}".format(leftData, match.group(1), placeholder, match.groups()[-1]), True, 0 def __build_ancestors(self, parent: etree.Element | None, parents: list[str]) -> None: """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: etree.Element, ancestors: list[str] | None = None) -> etree.Element: """Apply inline patterns to a parsed Markdown tree. Iterate over `Element`, find elements with inline tag, apply inline patterns and append newly created Elements to tree. To avoid further processing of string with inline patterns, instead of normal string, use subclass [`AtomicString`][markdown.util.AtomicString]: node.text = markdown.util.AtomicString("This will not be processed.") Arguments: tree: `Element` object, representing Markdown tree. ancestors: List of parent tag names that precede the tree node (if needed). Returns: An element tree object with applied inline patterns. """ self.stashed_nodes: dict[str, etree.Element | str] = {} # 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 = {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 item in lst: self.parent_map[item[0]] = child stack += lst insertQueue.append((child, lst)) self.ancestors.pop() if child.tail: tail = self.__handleInline(child.tail) dumby = 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 line breaks to the html document. """ def _prettifyETree(self, elem: etree.Element) -> None: """ Recursively add line breaks 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 def run(self, root: etree.Element) -> None: """ Add line breaks to `Element` object and its children. """ 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': code = pre[0] # Only prettify code containing text only if not len(code) and code.text is not None: code.text = util.AtomicString(code.text.rstrip() + '\n') class UnescapeTreeprocessor(Treeprocessor): """ Restore escaped chars """ RE = re.compile(r'{}(\d+){}'.format(util.STX, util.ETX)) def _unescape(self, m: re.Match[str]) -> str: return chr(int(m.group(1))) def unescape(self, text: str) -> str: return self.RE.sub(self._unescape, text) def run(self, root: etree.Element) -> None: """ Loop over all elements and unescape all text. """ for elem in root.iter(): # Unescape text content if elem.text and not elem.tag == 'code': elem.text = self.unescape(elem.text) # Unescape tail content if elem.tail: elem.tail = self.unescape(elem.tail) # Unescape attribute values for key, value in elem.items(): elem.set(key, self.unescape(value)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/markdown/util.py0000644000175100001770000003315114657673134016006 0ustar00runnerdocker# 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-2023 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). """ This module contains various contacts, classes and functions which get referenced and used throughout the code base. """ from __future__ import annotations import re import sys import warnings from functools import wraps, lru_cache from itertools import count from typing import TYPE_CHECKING, Generic, Iterator, NamedTuple, TypeVar, TypedDict, overload if TYPE_CHECKING: # pragma: no cover from markdown import Markdown import xml.etree.ElementTree as etree _T = TypeVar('_T') """ Constants you might want to modify ----------------------------------------------------------------------------- """ BLOCK_LEVEL_ELEMENTS: list[str] = [ # Elements which are invalid to wrap in a `

` tag. # See https://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', 'hgroup', 'hr', 'main', 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul', # Other elements which Markdown should not be mucking up the contents of. 'canvas', 'colgroup', 'dd', 'body', 'dt', 'group', 'html', 'iframe', 'li', 'legend', 'math', 'map', 'noscript', 'output', 'object', 'option', 'progress', 'script', 'style', 'summary', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'tr', 'video' ] """ List of HTML tags which get treated as block-level elements. Same as the `block_level_elements` attribute of the [`Markdown`][markdown.Markdown] class. Generally one should use the attribute on the class. This remains for compatibility with older extensions. """ # Placeholders STX = '\u0002' """ "Start of Text" marker for placeholder templates. """ ETX = '\u0003' """ "End of Text" marker for placeholder templates. """ INLINE_PLACEHOLDER_PREFIX = STX+"klzzwxh:" """ Prefix for inline placeholder template. """ INLINE_PLACEHOLDER = INLINE_PLACEHOLDER_PREFIX + "%s" + ETX """ Placeholder template for stashed inline text. """ INLINE_PLACEHOLDER_RE = re.compile(INLINE_PLACEHOLDER % r'([0-9]+)') """ Regular Expression which matches inline placeholders. """ AMP_SUBSTITUTE = STX+"amp"+ETX """ Placeholder template for HTML entities. """ HTML_PLACEHOLDER = STX + "wzxhzdk:%s" + ETX """ Placeholder template for raw HTML. """ HTML_PLACEHOLDER_RE = re.compile(HTML_PLACEHOLDER % r'([0-9]+)') """ Regular expression which matches HTML placeholders. """ TAG_PLACEHOLDER = STX + "hzzhzkh:%s" + ETX """ Placeholder template for tags. """ # 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 ) # AUXILIARY GLOBAL FUNCTIONS # ============================================================================= @lru_cache(maxsize=None) def get_installed_extensions(): """ Return all entry_points in the `markdown.extensions` group. """ if sys.version_info >= (3, 10): from importlib import metadata else: # ` bool | None: """Parses a string representing a boolean 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, str): 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: str) -> str: """HTML escape a string of code.""" if "&" in text: text = text.replace("&", "&") if "<" in text: text = text.replace("<", "<") if ">" in text: text = text.replace(">", ">") return text def _get_stack_depth(size: int = 2) -> int: """Get current stack depth, performantly. """ frame = sys._getframe(size) for size in count(size): frame = frame.f_back if not frame: return size def nearing_recursion_limit() -> bool: """Return true if current stack depth is within 100 of maximum limit.""" return sys.getrecursionlimit() - _get_stack_depth() < 100 # MISC AUXILIARY CLASSES # ============================================================================= class AtomicString(str): """A string which should not be further processed.""" pass class Processor: """ The base class for all processors. Attributes: Processor.md: The `Markdown` instance passed in an initialization. Arguments: md: The `Markdown` instance this processor is a part of. """ def __init__(self, md: Markdown | None = None): self.md = md if TYPE_CHECKING: # pragma: no cover class TagData(TypedDict): tag: str attrs: dict[str, str] left_index: int right_index: int class HtmlStash: """ This class is used for stashing HTML objects that we extract in the beginning and replace with place-holders. """ def __init__(self): """ Create an `HtmlStash`. """ self.html_counter = 0 # for counting inline html segments self.rawHtmlBlocks: list[str | etree.Element] = [] self.tag_counter = 0 self.tag_data: list[TagData] = [] # list of dictionaries in the order tags appear def store(self, html: str | etree.Element) -> str: """ 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) -> None: """ Clear the stash. """ self.html_counter = 0 self.rawHtmlBlocks = [] def get_placeholder(self, key: int) -> str: return HTML_PLACEHOLDER % key def store_tag(self, tag: str, attrs: dict[str, str], left_index: int, right_index: int) -> str: """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]`. class _PriorityItem(NamedTuple): name: str priority: float class Registry(Generic[_T]): """ 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: dict[str, _T] = {} self._priority: list[_PriorityItem] = [] self._is_sorted = False def __contains__(self, item: str | _T) -> bool: if isinstance(item, str): # 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) -> Iterator[_T]: self._sort() return iter([self._data[k] for k, p in self._priority]) @overload def __getitem__(self, key: str | int) -> _T: # pragma: no cover ... @overload def __getitem__(self, key: slice) -> Registry[_T]: # pragma: no cover ... def __getitem__(self, key: str | int | slice) -> _T | Registry[_T]: self._sort() if isinstance(key, slice): data: Registry[_T] = 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) -> int: return len(self._priority) def __repr__(self): return '<{}({})>'.format(self.__class__.__name__, list(self)) def get_index_for_name(self, name: str) -> int: """ 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 "{}" exists.'.format(name)) def register(self, item: _T, name: str, priority: float) -> None: """ Add an item to the registry with the given name and priority. Arguments: 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. Treat 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: str, strict: bool = True) -> None: """ Remove an item from the registry. Set `strict=False` to fail silently. Otherwise a [`ValueError`][] is raised for an unknown `name`. """ try: index = self.get_index_for_name(name) del self._priority[index] del self._data[name] except ValueError: if strict: raise def _sort(self) -> None: """ 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/mkdocs.yml0000644000175100001770000000673514657673134014650 0ustar00runnerdockersite_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-2023" use_directory_urls: true watch: [markdown, scripts] theme: name: nature icon: py.png release: !!python/name:markdown.__version__ issue_tracker: https://github.com/Python-Markdown/markdown/issues extra_css: - custom.css - mkdocstrings.css 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_attrs.md - Legacy Emphasis: extensions/legacy_em.md - Meta-Data: extensions/meta_data.md - New Line to Break: extensions/nl2br.md - Markdown in HTML: extensions/md_in_html.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 - API Reference: reference/ - Contributing to Python-Markdown: contributing.md - Changelog: changelog.md - Authors: authors.md not_in_nav: | change_log/ markdown_extensions: - extra - admonition - smarty - codehilite - toc: permalink: true - mdx_gh_links: user: Python-Markdown repo: markdown plugins: - search - gen-files: scripts: - scripts/gen_ref_nav.py - literate-nav: nav_file: SUMMARY.md - section-index - mkdocstrings: custom_templates: docs/templates handlers: python: import: - https://docs.python.org/3/objects.inv options: annotations_path: brief docstring_options: ignore_init_summary: true docstring_style: google docstring_section_style: list extensions: - scripts/griffe_extensions.py:DeprecatedExtension - scripts/griffe_extensions.py:PriorityTableExtension: paths: - markdown.preprocessors.build_preprocessors - markdown.blockprocessors.build_block_parser - markdown.treeprocessors.build_treeprocessors - markdown.inlinepatterns.build_inlinepatterns - markdown.postprocessors.build_postprocessors filters: ["!^_"] group_by_category: false heading_level: 1 inherited_members: true members_order: source merge_init_into_class: true separate_signature: false show_root_heading: true show_object_full_path: true show_signature_annotations: true show_source: false show_symbol_type_heading: true show_symbol_type_toc: false signature_crossrefs: false summary: true source: repo: https://github.com/Python-Markdown/markdown tag: !!python/name:markdown.__version__ title: "View source code on GitHub." ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/pyproject.toml0000644000175100001770000000730014657673134015546 0ustar00runnerdocker[build-system] # Minimum requirements for the build system to execute. requires = ["setuptools>=61.2"] build-backend = "setuptools.build_meta" [project] name = 'Markdown' dynamic = ['version'] description = "Python implementation of John Gruber's Markdown." readme = {file = 'README.md', content-type='text/markdown'} authors = [ {name = 'Manfred Stienstra'}, {name = 'Yuri Takhteyev'}, {name = 'Waylan limberg', email = 'python.markdown@gmail.com'} ] maintainers = [ {name = 'Waylan Limberg', email = 'python.markdown@gmail.com'}, {name = 'Isaac Muse'} ] license = {file = 'LICENSE.md'} requires-python = '>=3.8' dependencies = [ "importlib-metadata>=4.4;python_version<'3.10'" ] keywords = ['markdown', 'markdown-parser', 'python-markdown', 'markdown-to-html'] classifiers = [ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', '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', 'Topic :: Text Processing :: Markup :: Markdown' ] [project.optional-dependencies] testing = [ 'coverage', 'pyyaml' ] docs = [ 'mkdocs>=1.5', 'mkdocs-nature>=0.6', 'mdx_gh_links>=0.2', "mkdocstrings[python]", "mkdocs-gen-files", "mkdocs-section-index", "mkdocs-literate-nav", ] [project.urls] 'Homepage' = 'https://Python-Markdown.github.io/' 'Documentation' = 'https://Python-Markdown.github.io/' 'Repository' = 'https://github.com/Python-Markdown/markdown' 'Issue Tracker' = 'https://github.com/Python-Markdown/markdown/issues' 'Changelog' = 'https://python-markdown.github.io/changelog/' [project.scripts] markdown_py = 'markdown.__main__:run' [project.entry-points.'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' md_in_html = 'markdown.extensions.md_in_html:MarkdownInHtmlExtension' 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' [tool.setuptools] packages = ['markdown', 'markdown.extensions'] [tool.setuptools.dynamic] version = {attr = 'markdown.__meta__.__version__'} ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0597374 markdown-3.7/scripts/0000755000175100001770000000000014657673141014317 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/scripts/gen_ref_nav.py0000755000175100001770000000434714657673134017157 0ustar00runnerdocker"""Generate the code reference pages and navigation.""" import textwrap import yaml from pathlib import Path import mkdocs_gen_files nav = mkdocs_gen_files.Nav() per_module_options = { "markdown": {"summary": {"attributes": True, "functions": True, "classes": True}} } base_path = Path(__file__).resolve().parent.parent modules = [ base_path.joinpath("markdown", "__init__.py"), base_path.joinpath("markdown", "preprocessors.py"), base_path.joinpath("markdown", "blockparser.py"), base_path.joinpath("markdown", "blockprocessors.py"), base_path.joinpath("markdown", "treeprocessors.py"), base_path.joinpath("markdown", "inlinepatterns.py"), base_path.joinpath("markdown", "postprocessors.py"), base_path.joinpath("markdown", "serializers.py"), base_path.joinpath("markdown", "util.py"), base_path.joinpath("markdown", "htmlparser.py"), base_path.joinpath("markdown", "test_tools.py"), *sorted(base_path.joinpath("markdown", "extensions").rglob("*.py")), ] for src_path in modules: path = src_path.relative_to(base_path) module_path = path.with_suffix("") doc_path = path.with_suffix(".md") full_doc_path = Path("reference", doc_path) parts = tuple(module_path.parts) if parts[-1] == "__init__": parts = parts[:-1] doc_path = doc_path.with_name("index.md") full_doc_path = full_doc_path.with_name("index.md") elif parts[-1].startswith("_"): continue nav_parts = [f"{part}" for part in parts] nav[nav_parts] = doc_path.as_posix() with mkdocs_gen_files.open(full_doc_path, "w") as fd: ident = ".".join(parts) fd.write(f"::: {ident}") if ident in per_module_options: yaml_options = yaml.dump({"options": per_module_options[ident]}) fd.write(f"\n{textwrap.indent(yaml_options, prefix=' ')}") elif ident.startswith("markdown.extensions."): yaml_options = yaml.dump({"options": {"inherited_members": False}}) fd.write(f"\n{textwrap.indent(yaml_options, prefix=' ')}") mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path) with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: nav_file.writelines(nav.build_literate_nav()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/scripts/griffe_extensions.py0000644000175100001770000001003214657673134020410 0ustar00runnerdocker"""Griffe extensions.""" from __future__ import annotations import ast from typing import TYPE_CHECKING, Any import textwrap from griffe import Docstring, Extension, DocstringSectionAdmonition, DocstringSectionText, Visitor, Inspector if TYPE_CHECKING: from griffe import Class, Function, ObjectNode def _deprecated(obj: Class | Function) -> str | None: for decorator in obj.decorators: if decorator.callable_path == "markdown.util.deprecated": return ast.literal_eval(str(decorator.value.arguments[0])) return None class DeprecatedExtension(Extension): """Griffe extension for `@markdown.util.deprecated` decorator support.""" def _insert_message(self, obj: Function | Class, message: str) -> None: if not obj.docstring: obj.docstring = Docstring("", parent=obj) sections = obj.docstring.parsed sections.insert(0, DocstringSectionAdmonition(kind="warning", text=message, title="Deprecated")) def on_class_instance(self, node: ast.AST | ObjectNode, cls: Class, agent: Visitor | Inspector, **kwargs: Any) -> None: # noqa: ARG002 """Add section to docstrings of deprecated classes.""" if message := _deprecated(cls): self._insert_message(cls, message) cls.labels.add("deprecated") def on_function_instance(self, node: ast.AST | ObjectNode, func: Function, agent: Visitor | Inspector, **kwargs: Any) -> None: # noqa: ARG002 """Add section to docstrings of deprecated functions.""" if message := _deprecated(func): self._insert_message(func, message) func.labels.add("deprecated") class PriorityTableExtension(Extension): """ Griffe extension to insert a table of processor priority in specified functions. """ def __init__(self, paths: list[str] | None = None) -> None: super().__init__() self.paths = paths def linked_obj(self, value: str, path: str) -> str: """ Wrap object name in reference link. """ return f'[`{value}`][{path}.{value}]' def on_function_instance(self, node: ast.AST | ObjectNode, func: Function, agent: Visitor | Inspector, **kwargs: Any) -> None: # noqa: ARG002 """Add table to specified function docstrings.""" if self.paths and func.path not in self.paths: return # skip objects that were not selected # Table header data = [ 'Class Instance | Name | Priority', '-------------- | ---- | :------:' ] # Extract table body from source code of function. for obj in node.body: # Extract the arguments passed to `util.Registry.register`. if isinstance(obj, ast.Expr) and isinstance(obj.value, ast.Call) and obj.value.func.attr == 'register': _args = obj.value.args cls = self.linked_obj(_args[0].func.id, func.path.rsplit('.', 1)[0]) name = _args[1].value priority = str(_args[2].value) if func.name == ('build_inlinepatterns'): # Include Pattern: first arg passed to class if isinstance(_args[0].args[0], ast.Constant): # Pattern is a string value = f'`"{_args[0].args[0].value}"`' else: # Pattern is a variable value = self.linked_obj(_args[0].args[0].id, func.path.rsplit('.', 1)[0]) cls = f'{cls}({value})' data.append(f'{cls} | `{name}` | `{priority}`') table = '\n'.join(data) body = ( f"Return a [`{func.returns.canonical_name}`][{func.returns.canonical_path}] instance which contains " "the following collection of classes with their assigned names and priorities.\n\n" f"{table}" ) # Add to docstring. if not func.docstring: func.docstring = Docstring("", parent=func) sections = func.docstring.parsed sections.append(DocstringSectionText(body, title="Priority Table")) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.1077383 markdown-3.7/setup.cfg0000644000175100001770000000004614657673141014451 0ustar00runnerdocker[egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0597374 markdown-3.7/tests/0000755000175100001770000000000014657673141013772 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/__init__.py0000644000175100001770000000134114657673134016104 0ustar00runnerdocker""" 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-2023 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). """ ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0637374 markdown-3.7/tests/basic/0000755000175100001770000000000014657673141015053 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/amps-and-angle-encoding.html0000644000175100001770000000076314657673134022321 0ustar00runnerdocker

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 amersand in the link text: AT&T.

Here's an inline link.

Here's an inline link.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/amps-and-angle-encoding.txt0000644000175100001770000000057514657673134022175 0ustar00runnerdockerAT&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"././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/angle-links-and-img.html0000644000175100001770000000030314657673134021455 0ustar00runnerdocker

link image link image

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/angle-links-and-img.txt0000644000175100001770000000021114657673134021326 0ustar00runnerdocker[link]( "title") ![image]() [link]() ![image]() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/auto-links.html0000644000175100001770000000124614657673134020034 0ustar00runnerdocker

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/>
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/auto-links.txt0000644000175100001770000000051214657673134017702 0ustar00runnerdockerLink: . Https link: Ftp link: With an ampersand: * In a list? * * It should. > Blockquoted: Auto-links should not occur here: `` or here: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/backlash-escapes.html0000644000175100001770000000236514657673134021142 0ustar00runnerdocker

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: \-

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/backlash-escapes.txt0000644000175100001770000000157114657673134021013 0ustar00runnerdockerThese 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: `\-` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/blockquotes-with-code-blocks.html0000644000175100001770000000026014657673134023430 0ustar00runnerdocker

Example:

sub status {
    print "working";
}

Or:

sub status {
    return "working";
}
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/blockquotes-with-code-blocks.txt0000644000175100001770000000020714657673134023304 0ustar00runnerdocker> Example: > > sub status { > print "working"; > } > > Or: > > sub status { > return "working"; > } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/codeblock-in-list.html0000644000175100001770000000026514657673134021250 0ustar00runnerdocker
  • A list item with a code block

    Some *code*
    
  • Another list item

    More code
    
    And more code
    
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/codeblock-in-list.txt0000644000175100001770000000016514657673134021122 0ustar00runnerdocker* A list item with a code block Some *code* * Another list item More code And more code ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/hard-wrapped.html0000644000175100001770000000032114657673134020315 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/hard-wrapped.txt0000644000175100001770000000030514657673134020172 0ustar00runnerdockerIn 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/horizontal-rules.html0000644000175100001770000000062014657673134021262 0ustar00runnerdocker

Dashes:





---




- - -

Asterisks:





***




* * *

Underscores:





___




_ _ _
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/horizontal-rules.txt0000644000175100001770000000041614657673134021140 0ustar00runnerdockerDashes: --- --- --- --- --- - - - - - - - - - - - - - - - Asterisks: *** *** *** *** *** * * * * * * * * * * * * * * * Underscores: ___ ___ ___ ___ ___ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/links-inline.html0000644000175100001770000000042414657673134020337 0ustar00runnerdocker

Just a URL.

URL and title.

URL and title.

URL and title.

Empty.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/links-inline.txt0000644000175100001770000000025614657673134020215 0ustar00runnerdockerJust 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](). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/links-reference.html0000644000175100001770000000202714657673134021020 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/links-reference.txt0000644000175100001770000000134414657673134020674 0ustar00runnerdockerFoo [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." ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/literal-quotes.html0000644000175100001770000000024114657673134020712 0ustar00runnerdocker

Foo bar.

Foo bar.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/literal-quotes.txt0000644000175100001770000000015414657673134020570 0ustar00runnerdockerFoo [bar][]. Foo [bar](/url/ "Title with "quotes" inside"). [bar]: /url/ "Title with "quotes" inside" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/markdown-documentation-basics.html0000644000175100001770000002214314657673134023700 0ustar00runnerdocker

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 indented 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 entities 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
entities 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>
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/markdown-documentation-basics.txt0000644000175100001770000001760314657673134023560 0ustar00runnerdockerMarkdown: 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 indented 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 entities like `—`. Output:

I strongly recommend against using any <blink> tags.

I wish SmartyPants used named entities like &mdash; instead of decimal-encoded entities 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>
    
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/markdown-syntax.html0000644000175100001770000007554714657673134021133 0ustar00runnerdocker

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 indented with spaces or tabs.

The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a <br /> tag.

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

Yes, this takes a tad more effort to create a <br />, but a simplistic "every line break is a <br />" rule wouldn't work for Markdown. Markdown's email-style blockquoting 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 indented by either 4 spaces or one tab:

1.  This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
    sit amet velit.

2.  Suspendisse id sem consectetuer libero luctus adipiscing.

It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy:

*   This is a list item with two paragraphs.

    This is the second paragraph in the list item. You're
only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.

*   Another item in the same list.

To put a blockquote within a list item, the blockquote's > delimiters need to be indented:

*   A list item with a blockquote:

    > This is a blockquote
    > inside a list item.

To put a code block within a list item, the code block needs to be indented twice -- 8 spaces or two tabs:

*   A list item with a code block:

        <code goes here>

It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this:

1986. What a great season.

In other words, a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape the period:

1986\. What a great season.

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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/markdown-syntax.txt0000644000175100001770000006545014657673134020776 0ustar00runnerdockerMarkdown: 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 indented with spaces or tabs. The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a `
` 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 indented by either 4 spaces or one tab: 1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 2. Suspendisse id sem consectetuer libero luctus adipiscing. It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy: * This is a list item with two paragraphs. This is the second paragraph in the list item. You're only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. * Another item in the same list. To put a blockquote within a list item, the blockquote's `>` delimiters need to be indented: * A list item with a blockquote: > This is a blockquote > inside a list item. To put a code block within a list item, the code block needs to be indented *twice* -- 8 spaces or two tabs: * A list item with a code block: 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/nested-blockquotes.html0000644000175100001770000000012614657673134021555 0ustar00runnerdocker

foo

bar

foo

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/nested-blockquotes.txt0000644000175100001770000000003014657673134021422 0ustar00runnerdocker> foo > > > bar > > foo ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/ordered-and-unordered-list.html0000644000175100001770000000307214657673134023067 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/ordered-and-unordered-list.txt0000644000175100001770000000151114657673134022736 0ustar00runnerdocker## 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/strong-and-em-together.html0000644000175100001770000000032314657673134022233 0ustar00runnerdocker

This is strong and em.

So is this word.

This is strong and em.

So is this word.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/strong-and-em-together.txt0000644000175100001770000000015314657673134022107 0ustar00runnerdocker***This is strong and em.*** So is ***this*** word. ___This is strong and em.___ So is ___this___ word. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/tabs.html0000644000175100001770000000067414657673134016703 0ustar00runnerdocker
  • 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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/tabs.txt0000644000175100001770000000046714657673134016556 0ustar00runnerdocker+ 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/tidyness.html0000644000175100001770000000020414657673134017601 0ustar00runnerdocker

A list within a blockquote:

  • asterisk 1
  • asterisk 2
  • asterisk 3
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/basic/tidyness.txt0000644000175100001770000000011614657673134017456 0ustar00runnerdocker> A list within a blockquote: > > * asterisk 1 > * asterisk 2 > * asterisk 3 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0717375 markdown-3.7/tests/extensions/0000755000175100001770000000000014657673141016171 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/admonition.html0000644000175100001770000000255514657673134021231 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/admonition.txt0000644000175100001770000000153414657673134021100 0ustar00runnerdockerSome 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/attr_list.html0000644000175100001770000000416314657673134021072 0ustar00runnerdocker

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 }

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/attr_list.txt0000644000175100001770000000327514657673134020750 0ustar00runnerdockerThis 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 } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/codehilite.html0000644000175100001770000000250014657673134021167 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/codehilite.txt0000644000175100001770000000036414657673134021050 0ustar00runnerdocker 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 text././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0757377 markdown-3.7/tests/extensions/extra/0000755000175100001770000000000014657673141017314 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/def-in-list.html0000644000175100001770000000050014657673134022312 0ustar00runnerdocker

: 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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/def-in-list.txt0000644000175100001770000000031614657673134022172 0ustar00runnerdocker: 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/extra_config.html0000644000175100001770000000044414657673134022656 0ustar00runnerdocker

  1. A Footnote. 

Some text with a footnote1.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/extra_config.txt0000644000175100001770000000010514657673134022523 0ustar00runnerdocker~~~placemarker~~~ Some text with a footnote[^1]. [^1]: A Footnote. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/footnote.html0000644000175100001770000000763014657673134022047 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/footnote.txt0000644000175100001770000000242514657673134021717 0ustar00runnerdockerThis 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/footnote_many_footnotes.html0000644000175100001770000106770514657673134025205 0ustar00runnerdocker

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 

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/footnote_many_footnotes.txt0000644000175100001770000013602014657673134025042 0ustar00runnerdockerSomething[^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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/footnote_placeholder.html0000644000175100001770000000044414657673134024405 0ustar00runnerdocker

  1. A Footnote. 

Some text with a footnote1.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/footnote_placeholder.txt0000644000175100001770000000011314657673134024251 0ustar00runnerdocker///Footnotes Go Here/// Some text with a footnote[^1]. [^1]: A Footnote. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/footnote_placeholder_depth.html0000644000175100001770000000053214657673134025567 0ustar00runnerdocker

  1. A Footnote. 

Some text with a footnote1.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/footnote_placeholder_depth.txt0000644000175100001770000000012314657673134025436 0ustar00runnerdocker>> ///Footnotes Go Here/// >> >> Some text with a footnote[^1]. [^1]: A Footnote. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/loose_def_list.html0000644000175100001770000000055314657673134023201 0ustar00runnerdocker

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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/loose_def_list.txt0000644000175100001770000000032114657673134023045 0ustar00runnerdockersome 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/markdown-syntax.html0000644000175100001770000007554714657673134023374 0ustar00runnerdocker

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 indented with spaces or tabs.

The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a <br /> tag.

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

Yes, this takes a tad more effort to create a <br />, but a simplistic "every line break is a <br />" rule wouldn't work for Markdown. Markdown's email-style blockquoting 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 indented by either 4 spaces or one tab:

1.  This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
    sit amet velit.

2.  Suspendisse id sem consectetuer libero luctus adipiscing.

It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy:

*   This is a list item with two paragraphs.

    This is the second paragraph in the list item. You're
only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.

*   Another item in the same list.

To put a blockquote within a list item, the blockquote's > delimiters need to be indented:

*   A list item with a blockquote:

    > This is a blockquote
    > inside a list item.

To put a code block within a list item, the code block needs to be indented twice -- 8 spaces or two tabs:

*   A list item with a code block:

        <code goes here>

It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this:

1986. What a great season.

In other words, a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape the period:

1986\. What a great season.

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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/markdown-syntax.txt0000644000175100001770000006545014657673134023237 0ustar00runnerdockerMarkdown: 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 indented with spaces or tabs. The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a `
` 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 indented by either 4 spaces or one tab: 1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 2. Suspendisse id sem consectetuer libero luctus adipiscing. It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy: * This is a list item with two paragraphs. This is the second paragraph in the list item. You're only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. * Another item in the same list. To put a blockquote within a list item, the blockquote's `>` delimiters need to be indented: * A list item with a blockquote: > This is a blockquote > inside a list item. To put a code block within a list item, the code block needs to be indented *twice* -- 8 spaces or two tabs: * A list item with a code block: 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/named_markers.html0000644000175100001770000000207014657673134023013 0ustar00runnerdocker

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. 

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/named_markers.txt0000644000175100001770000000034714657673134022673 0ustar00runnerdockerThis 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/raw-html.html0000644000175100001770000000663414657673134021750 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/raw-html.txt0000644000175100001770000000601614657673134021615 0ustar00runnerdocker
_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]
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/simple_def-lists.html0000644000175100001770000000111414657673134023444 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/extra/simple_def-lists.txt0000644000175100001770000000050214657673134023317 0ustar00runnerdockerSome 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/github_flavored.html0000644000175100001770000000230314657673134022223 0ustar00runnerdocker

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>
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/github_flavored.txt0000644000175100001770000000206314657673134022101 0ustar00runnerdockerindex 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 %} ``` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/nl2br_w_attr_list.html0000644000175100001770000000003114657673134022505 0ustar00runnerdocker

Foo

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/nl2br_w_attr_list.txt0000644000175100001770000000001414657673134022361 0ustar00runnerdockerFoo {: #bar}././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/sane_lists.html0000644000175100001770000000063414657673134021230 0ustar00runnerdocker
  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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/sane_lists.txt0000644000175100001770000000034414657673134021101 0ustar00runnerdocker1. 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. Parish././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc.html0000644000175100001770000007471214657673134017661 0ustar00runnerdocker

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 indented with spaces or tabs.

The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a <br /> tag.

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

Yes, this takes a tad more effort to create a <br />, but a simplistic "every line break is a <br />" rule wouldn't work for Markdown. Markdown's email-style blockquoting 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 indented by either 4 spaces or one tab:

1.  This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
    sit amet velit.

2.  Suspendisse id sem consectetuer libero luctus adipiscing.

It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy:

*   This is a list item with two paragraphs.

    This is the second paragraph in the list item. You're
only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.

*   Another item in the same list.

To put a blockquote within a list item, the blockquote's > delimiters need to be indented:

*   A list item with a blockquote:

    > This is a blockquote
    > inside a list item.

To put a code block within a list item, the code block needs to be indented twice -- 8 spaces or two tabs:

*   A list item with a code block:

        <code goes here>

It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this:

1986. What a great season.

In other words, a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape the period:

1986\. What a great season.

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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc.txt0000644000175100001770000006233414657673134017531 0ustar00runnerdocker [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 indented with spaces or tabs. The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a `
` 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 indented by either 4 spaces or one tab: 1. This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 2. Suspendisse id sem consectetuer libero luctus adipiscing. It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy: * This is a list item with two paragraphs. This is the second paragraph in the list item. You're only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. * Another item in the same list. To put a blockquote within a list item, the blockquote's `>` delimiters need to be indented: * A list item with a blockquote: > This is a blockquote > inside a list item. To put a code block within a list item, the code block needs to be indented *twice* -- 8 spaces or two tabs: * A list item with a code block: 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_invalid.html0000644000175100001770000000050214657673134021351 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_invalid.txt0000644000175100001770000000041414657673134021226 0ustar00runnerdocker[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 `
`. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_nested.html0000644000175100001770000000121214657673134021204 0ustar00runnerdocker

Header A

Header 1

Header i

Header B

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_nested.txt0000644000175100001770000000007314657673134021063 0ustar00runnerdocker# Header A ## Header 1 ### Header i # Header *B* [TOC] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_nested2.html0000644000175100001770000000136614657673134021300 0ustar00runnerdocker

Start with header other than one.[link]

Header 3[link]

Header 4[link]

Header 3[link]

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_nested2.txt0000644000175100001770000000013114657673134021140 0ustar00runnerdocker[TOC] ### Start with header other than one. ### Header 3 #### Header 4 ### Header 3 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_nested_list.html0000644000175100001770000000120614657673134022242 0ustar00runnerdocker

Title

Section 1

  1. List Item 1

    Subsection 1

    Explanation 1

  2. List Item 2

    Subsection 2

    Explanation 2

Section 2

Section 3

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_nested_list.txt0000644000175100001770000000025014657673134022113 0ustar00runnerdocker# Title [TOC] ## Section 1 1. List Item 1 ### Subsection 1 Explanation 1 2. List Item 2 ### Subsection 2 Explanation 2 ## Section 2 ## Section 3././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_out_of_order.html0000644000175100001770000000026714657673134022421 0ustar00runnerdocker

Header 2

Header 1

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/toc_out_of_order.txt0000644000175100001770000000003714657673134022267 0ustar00runnerdocker[TOC] ## Header 2 # Header 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/wikilinks.html0000644000175100001770000000156114657673134021070 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/extensions/wikilinks.txt0000644000175100001770000000067414657673134020747 0ustar00runnerdockerSome 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. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1723823713.091738 markdown-3.7/tests/misc/0000755000175100001770000000000014657673141014725 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/CRLF_line_ends.html0000644000175100001770000000003314657673134020357 0ustar00runnerdocker

foo

bar
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/CRLF_line_ends.txt0000644000175100001770000000003314657673134020232 0ustar00runnerdockerfoo
bar
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/adjacent-headers.html0000644000175100001770000000010014657673134020766 0ustar00runnerdocker

this is a huge header

this is a smaller header

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/adjacent-headers.txt0000644000175100001770000000007114657673134020650 0ustar00runnerdocker# this is a huge header # ## this is a smaller header ## ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/arabic.html0000644000175100001770000000422514657673134017041 0ustar00runnerdocker

بايثون

بايثون لغة برمجة حديثة بسيطة، واضحة، سريعة ØŒ تستخدم أسلوب البرمجة الكائنية (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

وصلات خارجية

بذرة حاس

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/arabic.txt0000644000175100001770000000406714657673134016720 0ustar00runnerdocker بايثون ===== **بايثون** لغة برمجة حديثة بسيطة، واضحة، سريعة ØŒ تستخدم أسلوب البرمجة الكائنية (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) بذرة حاس ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/autolinks_with_asterisks.html0000644000175100001770000000012614657673134022750 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/autolinks_with_asterisks.txt0000644000175100001770000000004414657673134022622 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/autolinks_with_asterisks_russian.html0000644000175100001770000000020414657673134024511 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/autolinks_with_asterisks_russian.txt0000644000175100001770000000007414657673134024371 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/backtick-escape.html0000644000175100001770000000022614657673134020626 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/backtick-escape.txt0000644000175100001770000000021514657673134020477 0ustar00runnerdocker\`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.` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/bidi.html0000644000175100001770000001724214657673134016532 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/bidi.txt0000644000175100001770000001663114657673134016406 0ustar00runnerdocker**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._ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blank-block-quote.html0000644000175100001770000000007714657673134021133 0ustar00runnerdocker

aaaaaaaaaaa

bbbbbbbbbbb

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blank-block-quote.txt0000644000175100001770000000003614657673134021001 0ustar00runnerdocker aaaaaaaaaaa > bbbbbbbbbbb ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blank_lines_in_codeblocks.html0000644000175100001770000000065114657673134022756 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blank_lines_in_codeblocks.txt0000644000175100001770000000102414657673134022624 0ustar00runnerdockerPreserve 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././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blockquote-below-paragraph.html0000644000175100001770000000032614657673134023037 0ustar00runnerdocker

Paragraph

Block quote Yep

Paragraph

no space Nope

Paragraph one

blockquote More blockquote.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blockquote-below-paragraph.txt0000644000175100001770000000014614657673134022712 0ustar00runnerdockerParagraph > Block quote > Yep Paragraph >no space >Nope Paragraph one > blockquote More blockquote. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blockquote-hr.html0000644000175100001770000000062214657673134020374 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blockquote-hr.txt0000644000175100001770000000037614657673134020255 0ustar00runnerdockerThis 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blockquote.html0000644000175100001770000000121714657673134017766 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/blockquote.txt0000644000175100001770000000061314657673134017640 0ustar00runnerdocker> 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/bold_links.html0000644000175100001770000000010214657673134017726 0ustar00runnerdocker

bold link

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/bold_links.txt0000644000175100001770000000004414657673134017606 0ustar00runnerdocker**bold [link](http://example.com)** ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/br.html0000644000175100001770000000103714657673134016221 0ustar00runnerdocker

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:

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/br.txt0000644000175100001770000000064314657673134016076 0ustar00runnerdockerOutput:

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: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/bracket_re.html0000644000175100001770000000355114657673134017722 0ustar00runnerdocker

[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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/bracket_re.txt0000644000175100001770000000354414657673134017577 0ustar00runnerdocker [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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/brackets-in-img-title.html0000644000175100001770000000101214657673134021702 0ustar00runnerdocker

alt alt alt

alt alt

alt alt alt alt

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/brackets-in-img-title.txt0000644000175100001770000000047114657673134021565 0ustar00runnerdocker![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)") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/code-first-line.html0000644000175100001770000000006614657673134020603 0ustar00runnerdocker
print "This is a code block."
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/code-first-line.txt0000644000175100001770000000004214657673134020450 0ustar00runnerdocker print "This is a code block." ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/em-around-links.html0000644000175100001770000000126514657673134020626 0ustar00runnerdocker

Title

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/em-around-links.txt0000644000175100001770000000101014657673134020465 0ustar00runnerdocker# 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/em_strong.html0000644000175100001770000000043414657673134017613 0ustar00runnerdocker

One asterisk: *

One underscore: _

Two asterisks: **

With spaces: * *

Two underscores __

with spaces: _ _

three asterisks: ***

with spaces: * * *

three underscores: ___

with spaces: _ _ _

One char: a

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/em_strong.txt0000644000175100001770000000032314657673134017463 0ustar00runnerdockerOne asterisk: * One underscore: _ Two asterisks: ** With spaces: * * Two underscores __ with spaces: _ _ three asterisks: *** with spaces: * * * three underscores: ___ with spaces: _ _ _ One char: _a_ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/em_strong_complex.html0000644000175100001770000000110114657673134021332 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/em_strong_complex.txt0000644000175100001770000000040214657673134021210 0ustar00runnerdocker___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*././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/email.html0000644000175100001770000000156314657673134016711 0ustar00runnerdocker

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

bob&sue@example.com

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/email.txt0000644000175100001770000000016314657673134016557 0ustar00runnerdocker asdfasdfadsfasd or you can say instead ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/escaped_links.html0000644000175100001770000000032414657673134020420 0ustar00runnerdocker

Backslashed in links:

q=go:GO\:0000307

q=go:GO\:0000308

a \non-escaped char.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/escaped_links.txt0000644000175100001770000000025614657673134020277 0ustar00runnerdockerBackslashed 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.././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/funky-list.html0000644000175100001770000000042214657673134017720 0ustar00runnerdocker
  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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/funky-list.txt0000644000175100001770000000031314657673134017572 0ustar00runnerdocker1. 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/h1.html0000644000175100001770000000010514657673134016121 0ustar00runnerdocker

Header

Header 2

H3

H1

H2

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/h1.txt0000644000175100001770000000006714657673134016003 0ustar00runnerdockerHeader ------ Header 2 ======== ### H3 H1 = H2 -- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/hash.html0000644000175100001770000000014314657673134016536 0ustar00runnerdocker

a

#!/usr/bin/python
hello

a

!/usr/bin/python
hello

a

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/hash.txt0000644000175100001770000000012114657673134016405 0ustar00runnerdockera
#!/usr/bin/python
hello
a
!/usr/bin/python
hello
a ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/header-in-lists.html0000644000175100001770000000052414657673134020606 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/header-in-lists.txt0000644000175100001770000000031214657673134020454 0ustar00runnerdockerTight 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/headers.html0000644000175100001770000000034314657673134017230 0ustar00runnerdocker

Hello world

Line 2 Line 3

[Markdown][5]

Markdown

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

Issue #1: Markdown

Text

Header

Some other text

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/headers.txt0000644000175100001770000000024314657673134017102 0ustar00runnerdocker### 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/hline.html0000644000175100001770000000004014657673134016706 0ustar00runnerdocker

Header

Next line

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/hline.txt0000644000175100001770000000002514657673134016564 0ustar00runnerdocker #Header Next line ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/image-2.html0000644000175100001770000000016014657673134017033 0ustar00runnerdocker

link!

link

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/image-2.txt0000644000175100001770000000010014657673134016700 0ustar00runnerdocker[*link!*](http://src.com/) *[link](http://www.freewisdom.org)* ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/image_in_links.html0000644000175100001770000000013014657673134020557 0ustar00runnerdocker

altname

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/image_in_links.txt0000644000175100001770000000007114657673134020436 0ustar00runnerdocker [![altname](path/to/img_thumb.png)](path/to/image.png) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/ins-at-start-of-paragraph.html0000644000175100001770000000011414657673134022504 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/ins-at-start-of-paragraph.txt0000644000175100001770000000010614657673134022360 0ustar00runnerdockerHello, fellow developer this ins should be wrapped in a p. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/inside_html.html0000644000175100001770000000006114657673134020111 0ustar00runnerdocker

ok?

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/inside_html.txt0000644000175100001770000000003614657673134017766 0ustar00runnerdocker __ok__? ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/japanese.html0000644000175100001770000000565714657673134017420 0ustar00runnerdocker

パイソン (Python)

Python(パイソン)ã¯ã€Guido van Rossum ã«ã‚ˆã£ã¦ä½œã‚‰ã‚ŒãŸã‚ªãƒ¼ãƒ—ンソースã®ã‚ªãƒ–ジェクト指å‘スクリプト言語。Perlã¨ã¨ã‚‚ã«æ¬§ç±³ã§åºƒãæ™®åŠã—ã¦ã„る。イギリスã®ãƒ†ãƒ¬ãƒ“å±€ BBC ãŒè£½ä½œã—ãŸã‚³ãƒ¡ãƒ‡ã‚£ç•ªçµ„『空飛ã¶ãƒ¢ãƒ³ãƒ†ã‚£ãƒ»ãƒ‘イソンã€ã«ã¡ãªã‚“ã§å付ã‘られãŸã€‚ (Pythonã«ã¯ã€çˆ¬è™«é¡žã®ãƒ‹ã‚·ã‚­ãƒ˜ãƒ“ã®æ„味ãŒã‚りã€Python言語ã®ãƒžã‚¹ã‚³ãƒƒãƒˆã‚„アイコンã¨ã—ã¦ä½¿ã‚れるã“ã¨ãŒã‚る。)

概è¦

プログラミング言語 Python ã¯åˆå¿ƒè€…ã‹ã‚‰å°‚門家ã¾ã§å¹…広ã„ユーザ層をç²å¾—ã—ã¦ã„ã‚‹ã€‚åˆ©ç”¨ç›®çš„ã¯æ±Žç”¨ã§ã€æ–¹å‘性ã¨ã—ã¦ã¯Javaã«è¿‘ã„。ãŸã ã—ã€æœ€åˆã‹ã‚‰ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯åˆ©ç”¨ã‚’メインã¨ã—ã¦è€ƒãˆã‚‰ã‚Œã¦ã„ã‚‹Javaよりセキュリティã«ã¤ã„ã¦ã¯ã‚„や寛大ã§ã‚る。多ãã®ãƒ—ラットフォームをサãƒãƒ¼ãƒˆã—ã¦ãŠã‚Šï¼ˆâ‡’動作ã™ã‚‹ãƒ—ラットフォーム)ã€è±Šå¯Œãªãƒ©ã‚¤ãƒ–ラリãŒã‚ã‚‹ã“ã¨ã‹ã‚‰ã€ç”£æ¥­ç•Œã§ã‚‚利用ãŒå¢—ãˆã¤ã¤ã‚る。ã¾ãŸã€Pythonã¯ç´”粋ãªãƒ—ログラミング言語ã®ã»ã‹ã«ã‚‚ã€å¤šãã®ç•°ãªã‚‹è¨€èªžã§æ›¸ã‹ã‚ŒãŸãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’ã¾ã¨ã‚る糊言語ã®ã²ã¨ã¤ã¨ã—ã¦ä½ç½®ã¥ã‘ã‚‹ã“ã¨ãŒã§ãる。実際Pythonã¯å¤šãã®å•†ç”¨ã‚¢ãƒ—リケーションã§ã‚¹ã‚¯ãƒªãƒ—ト言語ã¨ã—ã¦æŽ¡ç”¨ã•れã¦ã„る(⇒Pythonを使ã£ã¦ã„る製å“ã‚ã‚‹ã„ã¯ã‚½ãƒ•トウェアã®ä¸€è¦§ï¼‰ã€‚豊富ãªãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’ã‚‚ã¡ã€Unicodeã«ã‚ˆã‚‹æ–‡å­—列æ“作をサãƒãƒ¼ãƒˆã—ã¦ãŠã‚Šã€æ—¥æœ¬èªžå‡¦ç†ã‚‚標準ã§å¯èƒ½ã§ã‚る。

Python ã¯åŸºæœ¬çš„ã«ã‚¤ãƒ³ã‚¿ãƒ—リタ上ã§å®Ÿè¡Œã•れるã“ã¨ã‚’念頭ã«ãŠã„ã¦è¨­è¨ˆã•れã¦ãŠã‚Šã€ä»¥ä¸‹ã®ã‚ˆã†ãªç‰¹å¾´ã‚’ã‚‚ã£ã¦ã„ã‚‹:

  • å‹•çš„ãªåž‹ä»˜ã‘。
  • オブジェクトã®ãƒ¡ãƒ³ãƒã«å¯¾ã™ã‚‹ã‚¢ã‚¯ã‚»ã‚¹ãŒåˆ¶é™ã•れã¦ã„ãªã„。(属性や専用ã®ãƒ¡ã‚½ãƒƒãƒ‰ãƒ•ックを実装ã™ã‚‹ã“ã¨ã«ã‚ˆã£ã¦åˆ¶é™ã¯å¯èƒ½ã€‚)
  • モジュールã€ã‚¯ãƒ©ã‚¹ã€ã‚ªãƒ–ジェクト等ã®è¨€èªžã®è¦ç´ ãŒå†…部ã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹å¯èƒ½ã§ã‚りã€ãƒªãƒ•レクションを利用ã—ãŸè¨˜è¿°ãŒå¯èƒ½ã€‚

ã¾ãŸã€Pythonã§ã¯ã‚¤ãƒ³ãƒ‡ãƒ³ãƒˆã«ã‚ˆã‚Šãƒ–ロックを指定ã™ã‚‹æ§‹æ–‡ã‚’採用ã—ã¦ã„る(⇒オフサイドルール)。ã“ã®æ§‹æ–‡ã¯Pythonã«æ…£ã‚ŒãŸãƒ¦ãƒ¼ã‚¶ã‹ã‚‰ã¯ç§°è³›ã‚’ã‚‚ã£ã¦å—ã‘入れられã¦ã„ã‚‹ãŒã€ä»–ã®è¨€èªžã®ãƒ¦ãƒ¼ã‚¶ã‹ã‚‰ã¯æ‰¹åˆ¤ã‚‚多ã„。ã“ã®ã»ã‹ã«ã‚‚ã€å¤§ãã™ãŽã‚‹å®Ÿè¡Œãƒ•ァイルやã€Javaã«æ¯”ã¹ã¦é…ã„処ç†é€Ÿåº¦ãªã©ãŒæ¬ ç‚¹ã¨ã—ã¦æŒ‡æ‘˜ã•れã¦ã„る。ã—ã‹ã— プロトタイピング ã®éš›ã«ã¯ã“れらã®ç‚¹ã¯ã•ã—ã¦å•題ã¨ã¯ãªã‚‰ãªã„ã“ã¨ã‹ã‚‰ã€ç ”究開発部門ã§ã¯é »ç¹ã«åˆ©ç”¨ã•れã¦ã„る。

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/japanese.txt0000644000175100001770000000545414657673134017266 0ustar00runnerdockerパイソン (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ã«æ¯”ã¹ã¦é…ã„処ç†é€Ÿåº¦ãªã©ãŒæ¬ ç‚¹ã¨ã—ã¦æŒ‡æ‘˜ã•れã¦ã„る。ã—ã‹ã— **プロトタイピング** ã®éš›ã«ã¯ã“れらã®ç‚¹ã¯ã•ã—ã¦å•題ã¨ã¯ãªã‚‰ãªã„ã“ã¨ã‹ã‚‰ã€ç ”究開発部門ã§ã¯é »ç¹ã«åˆ©ç”¨ã•れã¦ã„る。 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lazy-block-quote.html0000644000175100001770000000023214657673134021014 0ustar00runnerdocker

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

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lazy-block-quote.txt0000644000175100001770000000016714657673134020676 0ustar00runnerdocker> Line one of lazy block quote. Line two of lazy block quote. > Line one of paragraph two. Line two of paragraph two. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/link-with-parenthesis.html0000644000175100001770000000021514657673134022044 0ustar00runnerdocker

ZIP archives

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/link-with-parenthesis.txt0000644000175100001770000000016614657673134021724 0ustar00runnerdocker[ZIP archives](http://en.wikipedia.org/wiki/ZIP_(file_format) "ZIP (file format) - Wikipedia, the free encyclopedia") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists.html0000644000175100001770000000064614657673134016761 0ustar00runnerdocker
  • 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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists.txt0000644000175100001770000000035514657673134016631 0ustar00runnerdocker * 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists2.html0000644000175100001770000000011414657673134017031 0ustar00runnerdocker
  • blah blah blah sdf asdf asdf asdf asdf asda asdf asdfasd
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists2.txt0000644000175100001770000000007314657673134016710 0ustar00runnerdocker* blah blah blah sdf asdf asdf asdf asdf asda asdf asdfasd ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists3.html0000644000175100001770000000012414657673134017033 0ustar00runnerdocker
  • blah blah blah sdf asdf asdf asdf asdf asda asdf asdfasd
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists3.txt0000644000175100001770000000010314657673134016703 0ustar00runnerdocker* blah blah blah sdf asdf asdf asdf asdf asda asdf asdfasd ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists4.html0000644000175100001770000000012714657673134017037 0ustar00runnerdocker
  • item1
  • item2
    1. Number 1
    2. Number 2
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists4.txt0000644000175100001770000000006114657673134016707 0ustar00runnerdocker * item1 * item2 1. Number 1 2. Number 2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists5.html0000644000175100001770000000036714657673134017046 0ustar00runnerdocker

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.
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists5.txt0000644000175100001770000000024714657673134016716 0ustar00runnerdocker> 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists6.html0000644000175100001770000000036314657673134017043 0ustar00runnerdocker

Test five or more spaces as start of list:

  • five spaces

not first item:

  • one space
  • five spaces

loose list:

  • one space

  • five spaces

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists6.txt0000644000175100001770000000023314657673134016712 0ustar00runnerdockerTest five or more spaces as start of list: * five spaces not first item: * one space * five spaces loose list: * one space * five spaces ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists7.html0000644000175100001770000000174614657673134017052 0ustar00runnerdocker
  • 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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists7.txt0000644000175100001770000000102514657673134016713 0ustar00runnerdocker* 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists8.html0000644000175100001770000000106214657673134017042 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/lists8.txt0000644000175100001770000000045514657673134016722 0ustar00runnerdocker# 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/missing-link-def.html0000644000175100001770000000015114657673134020752 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/missing-link-def.txt0000644000175100001770000000014714657673134020632 0ustar00runnerdockerThis is a [missing link][empty] and a [valid][link] and [missing][again]. [link]: http://example.com ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/multi-paragraph-block-quote.html0000644000175100001770000000026114657673134023134 0ustar00runnerdocker

This is line one of paragraph one This is line two of paragraph one

This is line one of paragraph two

This is another blockquote.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/multi-paragraph-block-quote.txt0000644000175100001770000000021614657673134023007 0ustar00runnerdocker> This is line one of paragraph one > This is line two of paragraph one > This is line one of paragraph two > This is another blockquote. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/multi-test.html0000644000175100001770000000103214657673134017720 0ustar00runnerdocker

Blah blah blah http://www.slashdot.org

  • Basic list
  • Basic list 2

addss

  • Lazy list

An example (oops)

Now, let's use a footnote[^1]. Not bad, eh? Let's continue.

[^1]: Here is the text of the footnote continued on several lines. some more of the footnote, etc.

Actually, another paragraph too.

And then there is a little bit of text.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/multi-test.txt0000644000175100001770000000063214657673134017600 0ustar00runnerdockerBlah blah blah * Basic list * Basic list 2 addss * Lazy list An [example][ref] (oops) [ref]: http://example.com "Title" Now, let's use a footnote[^1]. Not bad, eh? Let's continue. [^1]: Here is the text of the footnote continued on several lines. some more of the footnote, etc. Actually, another paragraph too. And then there is a little bit of text. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/nested-lists.html0000644000175100001770000000106514657673134020235 0ustar00runnerdocker
  • item 1

    paragraph 2

  • item 2

    • item 2-1
    • item 2-2

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

      • item 2-3-1
  • item 3

plain text

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

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

      Paragraph under item 4-3

    Paragraph under item 4

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/nested-lists.txt0000644000175100001770000000053014657673134020104 0ustar00runnerdocker* item 1 paragraph 2 * item 2 * item 2-1 * item 2-2 * item 2-2-1 * item 2-3 * item 2-3-1 * item 3 plain text * item 1 * item 1-1 * item 1-2 * item 1-2-1 * item 2 * item 3 * item 4 * item 4-1 * item 4-2 * item 4-3 Paragraph under item 4-3 Paragraph under item 4 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/nested-patterns.html0000644000175100001770000000141414657673134020735 0ustar00runnerdocker

link link link link link link link

I am italic and bold I am just bold

Example bold italic on the same line bold italic.

Example bold italic on the same line bold italic.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/nested-patterns.txt0000644000175100001770000000063014657673134020607 0ustar00runnerdocker___[link](http://example.com)___ ***[link](http://example.com)*** **[*link*](http://example.com)** __[_link_](http://example.com)__ __[*link*](http://example.com)__ **[_link_](http://example.com)** [***link***](http://example.com) ***I am ___italic_ and__ bold* I am `just` bold** Example __*bold italic*__ on the same line __*bold italic*__. Example **_bold italic_** on the same line **_bold italic_**. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/normalize.html0000644000175100001770000000010414657673134017610 0ustar00runnerdocker

Link

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/normalize.txt0000644000175100001770000000005214657673134017465 0ustar00runnerdocker [Link](http://www.stuff.com/q?x=1&y=2<>) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/numeric-entity.html0000644000175100001770000000040014657673134020563 0ustar00runnerdocker

user@gmail.com

This is an entity: ê

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/numeric-entity.txt0000644000175100001770000000005614657673134020445 0ustar00runnerdocker This is an entity: ê ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/para-with-hr.html0000644000175100001770000000031514657673134020117 0ustar00runnerdocker

Here is a paragraph, followed by a horizontal rule.


Followed by another paragraph.

Here is another paragraph, followed by: *** not an HR. Followed by more of the same paragraph.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/para-with-hr.txt0000644000175100001770000000026714657673134020000 0ustar00runnerdockerHere is a paragraph, followed by a horizontal rule. *** Followed by another paragraph. Here is another paragraph, followed by: *** not an HR. Followed by more of the same paragraph. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/russian.html0000644000175100001770000000643314657673134017307 0ustar00runnerdocker

Ðедвард «Ðед» ФландерÑ

Ðедвард «Ðед» Ð¤Ð»Ð°Ð½Ð´ÐµÑ€Ñ (Nedward «Ned» Flanders) — вымышленный перÑонаж мультÑериала «[СимпÑоны][]», озвученный Гарри Ширером. Он и его ÑÐµÐ¼ÑŒÑ Ð¶Ð¸Ð²ÑƒÑ‚ по ÑоÑедÑтву от Ñемьи СимпÑонов. Ðабожный хриÑтианин, Ðед ÑвлÑетÑÑ Ð¾Ð´Ð½Ð¸Ð¼ из Ñтолпов морали Спрингфилда. Ð’ Ñпизоде «Alone Again, Natura-Diddily» он овдовел, его жена Мод погибла в результате неÑчаÑтного ÑлучаÑ.

Ðед был одним из первых перÑонажей в мультÑериале, который не был членом Ñемьи СимпÑонов. ÐÐ°Ñ‡Ð¸Ð½Ð°Ñ Ñ Ð¿ÐµÑ€Ð²Ñ‹Ñ… Ñерий, он регулÑрно поÑвлÑетÑÑ Ð² «СимпÑонах». СчитаетÑÑ, что Ðед Ð¤Ð»Ð°Ð½Ð´ÐµÑ€Ñ Ð±Ñ‹Ð» назван в чеÑть улицы Northeast Flanders St. в Портленде, Орегон, родном городе ÑÐ¾Ð·Ð´Ð°Ñ‚ÐµÐ»Ñ Ð¼ÑƒÐ»ÑŒÑ‚Ñериала МÑтта Грейнинга]]. ÐадпиÑÑŒ на указателе улицы NE Flanders St. хулиганы чаÑто иÑправлÑли на NED Flanders St.

БиографиÑ

Ðед Ð¤Ð»Ð°Ð½Ð´ÐµÑ€Ñ Ñ€Ð¾Ð´Ð¸Ð»ÑÑ Ð² Ðью-Йорке, его родители были битниками. Его отец в точноÑти похож на взроÑлого Ðеда, только он ноÑил козлиную бородку. Их отказ от воÑÐ¿Ð¸Ñ‚Ð°Ð½Ð¸Ñ Ðеда и то, что они, в общем-то, были плохими родителÑми («мы ничего в Ñтом не понимаем и не знаем как начать») привело к тому, что Ðед превратилÑÑ Ð² ужаÑного Ñорванца. Ð’ конце концов они ÑоглаÑилиÑÑŒ на ÑкÑпериментальную воÑьмимеÑÑчную шлепологичеÑкую терапию МиннеÑотÑкого УниверÑитета (воÑÐ¿Ð¾Ð¼Ð¸Ð½Ð°Ð½Ð¸Ñ Ðеда в Ñпизоде «Hurricane Neddy»), ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ Ð½Ð°ÑƒÑ‡Ð¸Ð»Ð° его подавлÑть чувÑтво злоÑти. Побочным Ñфектом терапии Ñтало то, что Ðед Ñтал ненавидеть Ñвоих родителей (Ñто одна из двух вещей которые ненавидит ФландерÑ, Ð²Ñ‚Ð¾Ñ€Ð°Ñ â€” Ð¾Ñ‚Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¿Ð¾Ñ‡Ñ‚Ñ‹, чьи длинные очереди, Ñуета и угрюмый перÑонал раздражают его).

У Ðеда еÑть ÑÑ‚Ñ€Ð°Ð½Ð½Ð°Ñ Ð¿Ñ€Ð¸Ð²Ñ‹Ñ‡ÐºÐ° добавлÑть «дидли», «дадли» и другие беÑÑмыÑленные Ñлова в Ñвои фразы при разговоре, например: «Hi-diddly-ho, neighbor-ino» («Приветик, ÑоÑедушка»). Это результат Ñублимации его злоÑти, вызванной Ñдерживанием гнева, который не имеет никакого другого выхода.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/russian.txt0000644000175100001770000000634314657673134017162 0ustar00runnerdockerÐедвард «Ðед» Ð¤Ð»Ð°Ð½Ð´ÐµÑ€Ñ ====================== **Ðедвард «Ðед» ФландерÑ** (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» («Приветик, ÑоÑедушка»). Это результат Ñублимации его злоÑти, вызванной Ñдерживанием гнева, который не имеет никакого другого выхода. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/smart_em.html0000644000175100001770000000026214657673134017424 0ustar00runnerdocker

emphasis

this_is_not_emphasis

[punctuation with emphasis]

[punctuation_with_emphasis]

[punctuation_without_emphasis]

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/smart_em.txt0000644000175100001770000000017714657673134017304 0ustar00runnerdocker_emphasis_ this_is_not_emphasis [_punctuation with emphasis_] [_punctuation_with_emphasis_] [punctuation_without_emphasis] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/some-test.html0000644000175100001770000000132614657673134017537 0ustar00runnerdocker
  • 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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/some-test.txt0000644000175100001770000000103114657673134017403 0ustar00runnerdocker---------------------- * 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/span.html0000644000175100001770000000025614657673134016561 0ustar00runnerdocker

Foo bar Baz

*foo*
Foo *bar* Baz

Foo bar Baz

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/span.txt0000644000175100001770000000022714657673134016432 0ustar00runnerdocker Foo *bar* Baz
*foo*
Foo *bar* Baz
Foo *bar* Baz ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/strong-with-underscores.html0000644000175100001770000000004614657673134022434 0ustar00runnerdocker

this_is_strong

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/strong-with-underscores.txt0000644000175100001770000000002314657673134022302 0ustar00runnerdocker__this_is_strong__ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/stronintags.html0000644000175100001770000000034614657673134020173 0ustar00runnerdocker

this is a test

this is a second test

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/stronintags.txt0000644000175100001770000000021414657673134020040 0ustar00runnerdockerthis is a [**test**](http://example.com/) this is a second **[test](http://example.com)** reference **[test][]** reference [**test**][] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/tabs-in-lists.html0000644000175100001770000000066214657673134020312 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/tabs-in-lists.txt0000644000175100001770000000034214657673134020160 0ustar00runnerdockerFirst 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 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/two-spaces.html0000644000175100001770000000064414657673134017706 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/two-spaces.txt0000644000175100001770000000053214657673134017555 0ustar00runnerdockerThis 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/uche.html0000644000175100001770000000045614657673134016546 0ustar00runnerdocker

asif

Alt text

text

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/uche.txt0000644000175100001770000000031214657673134016410 0ustar00runnerdocker![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/) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/underscores.html0000644000175100001770000000036514657673134020155 0ustar00runnerdocker

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?

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/underscores.txt0000644000175100001770000000024214657673134020022 0ustar00runnerdockerTHIS_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? ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/url_spaces.html0000644000175100001770000000024114657673134017752 0ustar00runnerdocker

Dawn of War

Dawn of War

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/misc/url_spaces.txt0000644000175100001770000000017214657673134017630 0ustar00runnerdocker[Dawn of War](http://wikipedia.org/wiki/Dawn of War) [Dawn of War](http://wikipedia.org/wiki/Dawn of War "Dawn of War") ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1723823713.039737 markdown-3.7/tests/pl/0000755000175100001770000000000014657673141014405 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0957382 markdown-3.7/tests/pl/Tests_2004/0000755000175100001770000000000014657673141016154 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Amps and angle encoding.html0000644000175100001770000000077114657673134023312 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Auto links.html0000644000175100001770000000104214657673134021052 0ustar00runnerdocker

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/>
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Backslash escapes.html0000644000175100001770000000242614657673134022347 0ustar00runnerdocker

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: \-

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Blockquotes with code blocks.html0000644000175100001770000000027214657673134024425 0ustar00runnerdocker

Example:

sub status {
    print "working";
}

Or:

sub status {
    return "working";
}
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Hard-wrapped paragraphs with list-like lines.html0000644000175100001770000000032314657673134027376 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Horizontal rules.html0000644000175100001770000000066114657673134022313 0ustar00runnerdocker

Dashes:





---




- - -

Asterisks:





***




* * *

Underscores:





___




_ _ _
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Inline HTML (Advanced).html0000644000175100001770000000022414657673134022614 0ustar00runnerdocker

Simple block on one line:

foo

And nested without indentation:

foo
bar
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Inline HTML (Simple).html0000644000175100001770000000142014657673134022337 0ustar00runnerdocker

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:










././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Inline HTML comments.html0000644000175100001770000000027414657673134022620 0ustar00runnerdocker

Paragraph one.

Paragraph two.

The end.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Links, inline style.html0000644000175100001770000000043114657673134022556 0ustar00runnerdocker

Just a URL.

URL and title.

URL and title.

URL and title.

Empty.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Links, reference style.html0000644000175100001770000000062714657673134023245 0ustar00runnerdocker

Foo bar.

Foo bar.

Foo bar.

With embedded [brackets].

Indented once.

Indented twice.

Indented thrice.

Indented [four][] times.

[four]: /url
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Literal quotes in titles.html0000644000175100001770000000024314657673134023614 0ustar00runnerdocker

Foo bar.

Foo bar.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Markdown Documentation - Basics.html0000644000175100001770000002225014657673134024723 0ustar00runnerdocker

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 indented 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>
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Markdown Documentation - Syntax.html0000644000175100001770000007605114657673134025015 0ustar00runnerdocker

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 indented with spaces or tabs.

The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a <br /> tag.

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

Yes, this takes a tad more effort to create a <br />, but a simplistic "every line break is a <br />" rule wouldn't work for Markdown. Markdown's email-style blockquoting 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 indented by either 4 spaces or one tab:

1.  This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
    sit amet velit.

2.  Suspendisse id sem consectetuer libero luctus adipiscing.

It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy:

*   This is a list item with two paragraphs.

    This is the second paragraph in the list item. You're
only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.

*   Another item in the same list.

To put a blockquote within a list item, the blockquote's > delimiters need to be indented:

*   A list item with a blockquote:

    > This is a blockquote
    > inside a list item.

To put a code block within a list item, the code block needs to be indented twice -- 8 spaces or two tabs:

*   A list item with a code block:

        <code goes here>

It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this:

1986. What a great season.

In other words, a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape the period:

1986\. What a great season.

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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Nested blockquotes.html0000644000175100001770000000015114657673134022577 0ustar00runnerdocker

foo

bar

foo

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Ordered and unordered lists.html0000644000175100001770000000306214657673134024243 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Strong and em together.html0000644000175100001770000000032714657673134023231 0ustar00runnerdocker

This is strong and em.

So is this word.

This is strong and em.

So is this word.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Tabs.html0000644000175100001770000000066714657673134017746 0ustar00runnerdocker
  • 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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Tidyness.html0000644000175100001770000000020514657673134020643 0ustar00runnerdocker

A list within a blockquote:

  • asterisk 1
  • asterisk 2
  • asterisk 3
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Yuri-Attributes.html0000644000175100001770000000151114657673134022116 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Yuri-Email.html0000644000175100001770000000112714657673134021022 0ustar00runnerdocker

Lorem ipsum yuri@domain.org, etc.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Yuri-Footnotes.html0000644000175100001770000000435614657673134021762 0ustar00runnerdocker

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.
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2004/Yuri-Links-in-Headers.html0000644000175100001770000000046514657673134023034 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0997381 markdown-3.7/tests/pl/Tests_2007/0000755000175100001770000000000014657673141016157 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Amps and angle encoding.html0000644000175100001770000000077114657673134023315 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Auto links.html0000644000175100001770000000104214657673134021055 0ustar00runnerdocker

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/>
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Backslash escapes.html0000644000175100001770000000326114657673134022350 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Blockquotes with code blocks.html0000644000175100001770000000027214657673134024430 0ustar00runnerdocker

Example:

sub status {
    print "working";
}

Or:

sub status {
    return "working";
}
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Code Blocks.html0000644000175100001770000000047014657673134021120 0ustar00runnerdocker
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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Code Spans.html0000644000175100001770000000033614657673134020770 0ustar00runnerdocker

<test a=" content of attribute ">

Fix for backticks within HTML tag: like this

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Hard-wrapped paragraphs with list-like lines.html0000644000175100001770000000032314657673134027401 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Horizontal rules.html0000644000175100001770000000066114657673134022316 0ustar00runnerdocker

Dashes:





---




- - -

Asterisks:





***




* * *

Underscores:





___




_ _ _
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Images.html0000644000175100001770000000131614657673134020255 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Inline HTML (Advanced).html0000644000175100001770000000053214657673134022621 0ustar00runnerdocker

Simple block on one line:

foo

And nested without indentation:

foo
bar

And with attributes:

This was broken in 1.0.2b7:

foo
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Inline HTML (Simple).html0000644000175100001770000000142014657673134022342 0ustar00runnerdocker

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:










././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Inline HTML comments.html0000644000175100001770000000027414657673134022623 0ustar00runnerdocker

Paragraph one.

Paragraph two.

The end.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Links, inline style.html0000644000175100001770000000147414657673134022571 0ustar00runnerdocker

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)

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Links, reference style.html0000644000175100001770000000214514657673134023245 0ustar00runnerdocker

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.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Links, shortcut references.html0000644000175100001770000000040014657673134024133 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Literal quotes in titles.html0000644000175100001770000000024314657673134023617 0ustar00runnerdocker

Foo bar.

Foo bar.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Markdown Documentation - Basics.html0000644000175100001770000002225014657673134024726 0ustar00runnerdocker

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 indented 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>
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Markdown Documentation - Syntax.html0000644000175100001770000007605114657673134025020 0ustar00runnerdocker

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 indented with spaces or tabs.

The implication of the "one or more consecutive lines of text" rule is that Markdown supports "hard-wrapped" text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type's "Convert Line Breaks" option) which translate every line break character in a paragraph into a <br /> tag.

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

Yes, this takes a tad more effort to create a <br />, but a simplistic "every line break is a <br />" rule wouldn't work for Markdown. Markdown's email-style blockquoting 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 indented by either 4 spaces or one tab:

1.  This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
    sit amet velit.

2.  Suspendisse id sem consectetuer libero luctus adipiscing.

It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy:

*   This is a list item with two paragraphs.

    This is the second paragraph in the list item. You're
only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.

*   Another item in the same list.

To put a blockquote within a list item, the blockquote's > delimiters need to be indented:

*   A list item with a blockquote:

    > This is a blockquote
    > inside a list item.

To put a code block within a list item, the code block needs to be indented twice -- 8 spaces or two tabs:

*   A list item with a code block:

        <code goes here>

It's worth noting that it's possible to trigger an ordered list by accident, by writing something like this:

1986. What a great season.

In other words, a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape the period:

1986\. What a great season.

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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Nested blockquotes.html0000644000175100001770000000015114657673134022602 0ustar00runnerdocker

foo

bar

foo

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Ordered and unordered lists.html0000644000175100001770000000324514657673134024251 0ustar00runnerdocker

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

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Strong and em together.html0000644000175100001770000000032714657673134023234 0ustar00runnerdocker

This is strong and em.

So is this word.

This is strong and em.

So is this word.

././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Tabs.html0000644000175100001770000000066714657673134017751 0ustar00runnerdocker
  • 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
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/pl/Tests_2007/Tidyness.html0000644000175100001770000000020514657673134020646 0ustar00runnerdocker

A list within a blockquote:

  • asterisk 1
  • asterisk 2
  • asterisk 3
././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_apis.py0000644000175100001770000010326314657673134016346 0ustar00runnerdocker""" 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-2023 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 library. """ import unittest import sys import os import markdown import warnings from markdown.__main__ import parse_options from markdown import inlinepatterns from logging import DEBUG, WARNING, CRITICAL import yaml import tempfile from io import BytesIO, StringIO, TextIOWrapper import xml.etree.ElementTree as etree from xml.etree.ElementTree import ProcessingInstruction 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 = StringIO('foo') sys.stdout = TextIOWrapper(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(), '

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 = 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.assertIsInstance(tree, etree.ElementTree) self.assertIs(etree.iselement(tree.getroot()), True) 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: """ 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.assertIsInstance(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.assertIs(r._is_sorted, False) r.register(Item('a'), 'a', 20) list(r) self.assertIs(r._is_sorted, True) r.register(Item('b'), 'b', 21) self.assertIs(r._is_sorted, False) r['a'] self.assertIs(r._is_sorted, True) r._is_sorted = False r.get_index_for_name('a') self.assertIs(r._is_sorted, True) r._is_sorted = False repr(r) self.assertIs(r._is_sorted, True) 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-existent item with `strict=False` r.deregister('d', strict=False) self.assertEqual(len(r), 1) with self.assertRaises(ValueError): # deregister non-existent 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.assertIs('a' in r, True) self.assertIn(item, r) self.assertNotIn('b', 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' with self.assertRaises(TypeError): r['a'] = 'a' def testRegistryDelItem(self): r = markdown.util.Registry() r.register(Item('a'), 'a', 20) with self.assertRaises(TypeError): del r[0] with self.assertRaises(TypeError): del r['a'] 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.assertIsInstance(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']) 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 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-existent 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 = etree.Comment('foo') def testCommentIsComment(self): """ Test that an `ElementTree` `Comment` passes the `is Comment` test. """ self.assertIs(self.comment.tag, etree.Comment) def testCommentIsBlockLevel(self): """ Test that an `ElementTree` `Comment` is recognized as `BlockLevel`. """ md = markdown.Markdown() self.assertIs(md.is_block_level(self.comment.tag), False) 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 = etree.Element('root') br = etree.SubElement(root, 'br') self.assertEqual(br.tail, None) self.pretty.run(root) self.assertEqual(br.tail, "\n") class testElementPreCodeTests(unittest.TestCase): """ Element `PreCode` Tests """ def setUp(self): md = markdown.Markdown() self.pretty = markdown.treeprocessors.PrettifyTreeprocessor(md) def prettify(self, xml): root = etree.fromstring(xml) self.pretty.run(root) return etree.tostring(root, encoding="unicode", short_empty_elements=False) def testPreCodeEmpty(self): xml = "
" expected = "
\n" self.assertEqual(expected, self.prettify(xml)) def testPreCodeWithChildren(self): xml = "
 
" expected = "
 
\n" self.assertEqual(expected, self.prettify(xml)) def testPreCodeWithSpaceOnly(self): xml = "
 
" expected = "
\n
\n" self.assertEqual(expected, self.prettify(xml)) def testPreCodeWithText(self): xml = "
 hello
" expected = "
 hello\n
\n" self.assertEqual(expected, self.prettify(xml)) def testPreCodeWithTrailingSpace(self): xml = "
 hello 
" expected = "
 hello\n
\n" self.assertEqual(expected, self.prettify(xml)) class testSerializers(unittest.TestCase): """ Test the html and xhtml serializers. """ def testHtml(self): """ Test HTML serialization. """ el = etree.Element('div') el.set('id', 'foo<&">') p = etree.SubElement(el, 'p') p.text = 'foo <&escaped>' p.set('hidden', 'hidden') etree.SubElement(el, 'hr') non_element = etree.SubElement(el, None) non_element.text = 'non-element text' script = 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 = etree.Element('div') el.set('id', 'foo<&">') p = etree.SubElement(el, 'p') p.text = 'foo<&escaped>' p.set('hidden', 'hidden') etree.SubElement(el, 'hr') non_element = etree.SubElement(el, None) non_element.text = 'non-element text' script = 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 = etree.Element('MixedCase') el.text = 'not valid ' em = etree.SubElement(el, 'EMPHASIS') em.text = 'html' 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 = etree.Element('div') qname = etree.QName('http://www.w3.org/1998/Math/MathML', 'math') math = etree.SubElement(div, qname) math.set('display', 'block') sem = etree.SubElement(math, 'semantics') msup = etree.SubElement(sem, 'msup') mi = etree.SubElement(msup, 'mi') mi.text = 'x' mn = etree.SubElement(msup, 'mn') mn.text = '2' ann = 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 = etree.Element('div') div.set(etree.QName('foo'), etree.QName('bar')) self.assertEqual( markdown.serializers.to_xhtml_string(div), '
' ) def testBadQNameTag(self): """ Test serialization of `QName` with no tag. """ qname = etree.QName('http://www.w3.org/1998/Math/MathML') el = etree.Element(qname) self.assertRaises(ValueError, markdown.serializers.to_xhtml_string, el) def testQNameEscaping(self): """ Test `QName` escaping. """ qname = etree.QName('<&"test\nescaping">', 'div') el = etree.Element(qname) self.assertEqual( markdown.serializers.to_xhtml_string(el), '
' ) def testQNamePreEscaping(self): """ Test `QName` that is already partially escaped. """ qname = etree.QName('<&"test escaping">', 'div') el = 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 hard-coded 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): self.md = markdown.Markdown() self.inlineprocessor = self.md.treeprocessors['inline'] def testString(self): """ Test that a regular string is parsed. """ tree = etree.Element('div') p = 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 = etree.Element('div') p = 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 = etree.Element('div') p = etree.SubElement(tree, 'p') p.text = markdown.util.AtomicString('*some* ') span1 = etree.SubElement(p, 'span') span1.text = markdown.util.AtomicString('*more* ') span2 = etree.SubElement(span1, 'span') span2.text = markdown.util.AtomicString('*text* ') span3 = 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*

' ) def testInlineProcessorDoesntCrashWithWrongAtomicString(self): """ Test that an `AtomicString` returned from a Pattern doesn't cause a crash. """ tree = etree.Element('div') p = etree.SubElement(tree, 'p') p.text = 'a marker c' self.md.inlinePatterns.register( _InlineProcessorThatReturnsAtomicString(r'marker', self.md), 'test', 100 ) new = self.inlineprocessor.run(tree) self.assertEqual( markdown.serializers.to_html_string(new), '

a <b>atomic</b> c

' ) class _InlineProcessorThatReturnsAtomicString(inlinepatterns.InlineProcessor): """ Return a simple text of `group(1)` of a Pattern. """ def handleMatch(self, m, data): return markdown.util.AtomicString('atomic'), m.start(0), m.end(0) class TestConfigParsing(unittest.TestCase): def assertParses(self, value, result): self.assertIs(markdown.util.parseBoolValue(value, False), 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.assertIsNone(markdown.util.parseBoolValue('None', preserve_none=True)) self.assertIsNone(markdown.util.parseBoolValue(None, preserve_none=True)) 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.assertGreater(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 temporary configuration files. """ if not isinstance(config, str): # 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 = 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) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_extensions.py0000644000175100001770000002242614657673134017612 0ustar00runnerdocker""" 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-2023 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`. """ import unittest import markdown 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 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 document 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 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) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_legacy.py0000644000175100001770000001212714657673134016654 0ustar00runnerdocker""" 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-2023 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 different order Inline HTML (Span): Backtick in raw HTML attribute TODO: fix me 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 `OL`s and `UL`s: We match `markdown.pl` here. I think PHP is wrong here Emphasis: We have various minor differences 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 backslash? """ 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 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: fix me Backslash escapes: backticks in raw html attributes TODO: fix me Code Spans: more backticks in raw html attributes TODO: fix me """ 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']) 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']) 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']) extra_config = Kwargs( extensions=['extra'], extension_configs={ 'extra': { 'footnotes': { 'PLACE_MARKER': '~~~placemarker~~~' } } } ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_meta.py0000644000175100001770000000163114657673134016334 0ustar00runnerdockerimport unittest from markdown.__meta__ import _get_version, __version__ class TestVersion(unittest.TestCase): def test_get_version(self): """Test that _get_version formats __version_info__ as required by PEP 440.""" self.assertEqual(_get_version((1, 1, 2, 'dev', 0)), "1.1.2.dev0") self.assertEqual(_get_version((1, 1, 2, 'alpha', 1)), "1.1.2a1") self.assertEqual(_get_version((1, 2, 0, 'beta', 2)), "1.2b2") self.assertEqual(_get_version((1, 2, 0, 'rc', 4)), "1.2rc4") self.assertEqual(_get_version((1, 2, 0, 'final', 0)), "1.2") def test__version__IsValid(self): """Test that __version__ is valid and normalized.""" try: import packaging.version except ImportError: self.skipTest('packaging does not appear to be installed') self.assertEqual(__version__, str(packaging.version.Version(__version__))) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0997381 markdown-3.7/tests/test_syntax/0000755000175100001770000000000014657673141016357 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/__init__.py0000644000175100001770000000134114657673134020471 0ustar00runnerdocker""" 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-2023 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). """ ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.0997381 markdown-3.7/tests/test_syntax/blocks/0000755000175100001770000000000014657673141017634 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/blocks/__init__.py0000644000175100001770000000134114657673134021746 0ustar00runnerdocker""" 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-2023 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). """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/blocks/test_blockquotes.py0000644000175100001770000000342114657673134023602 0ustar00runnerdocker""" 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-2023 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, recursionlimit class TestBlockquoteBlocks(TestCase): # TODO: Move legacy tests here def test_nesting_limit(self): # Test that the nesting limit is within 100 levels of recursion limit. Future code changes could cause the # recursion limit to need adjusted here. We need to account for all of Markdown's internal calls. Finally, we # need to account for the 100 level cushion which we are testing. with recursionlimit(120): self.assertMarkdownRenders( '>>>>>>>>>>', self.dedent( """

>>>>>

""" ) ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/blocks/test_code_blocks.py0000644000175100001770000000430114657673134023514 0ustar00runnerdocker""" 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-2023 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>
                
""" ) ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/blocks/test_headers.py0000644000175100001770000004427214657673134022673 0ustar00runnerdocker""" 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-2023 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 https://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 https://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 necessarily intuitive. # See: https://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 \\

""" ) ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/blocks/test_hr.py0000644000175100001770000002047014657673134021663 0ustar00runnerdocker""" 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-2023 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_hr_after_emstrong(self): self.assertMarkdownRenders( self.dedent( """ ***text*** *** """ ), self.dedent( """

text


""" ) ) 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( '_ _', '

_ _

' ) def test_2_consecutive_hr(self): self.assertMarkdownRenders( self.dedent( """ - - - - - - """ ), self.dedent( """

""" ) ) def test_not_hr_end_in_char(self): self.assertMarkdownRenders( '--------------------------------------c', '

--------------------------------------c

' ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/blocks/test_html_blocks.py0000644000175100001770000011712214657673134023554 0ustar00runnerdocker# -*- 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-2023 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 import markdown class TestHTMLBlocks(TestCase): def test_raw_paragraph(self): self.assertMarkdownRenders( '

A raw paragraph.

', '

A raw paragraph.

' ) def test_raw_skip_inline_markdown(self): self.assertMarkdownRenders( '

A *raw* paragraph.

', '

A *raw* paragraph.

' ) def test_raw_indent_one_space(self): self.assertMarkdownRenders( '

A *raw* paragraph.

', '

A *raw* paragraph.

' ) def test_raw_indent_two_spaces(self): self.assertMarkdownRenders( '

A *raw* paragraph.

', '

A *raw* paragraph.

' ) def test_raw_indent_three_spaces(self): self.assertMarkdownRenders( '

A *raw* paragraph.

', '

A *raw* paragraph.

' ) def test_raw_indent_four_spaces(self): self.assertMarkdownRenders( '

code block

', self.dedent( """
<p>code block</p>
                
""" ) ) def test_raw_span(self): self.assertMarkdownRenders( '*inline*', '

inline

' ) def test_code_span(self): self.assertMarkdownRenders( '`

code span

`', '

<p>code span</p>

' ) def test_code_span_open_gt(self): self.assertMarkdownRenders( '*bar* `<` *foo*', '

bar < foo

' ) def test_raw_empty(self): self.assertMarkdownRenders( '

', '

' ) def test_raw_empty_space(self): self.assertMarkdownRenders( '

', '

' ) def test_raw_empty_newline(self): self.assertMarkdownRenders( '

\n

', '

\n

' ) def test_raw_empty_blank_line(self): self.assertMarkdownRenders( '

\n\n

', '

\n\n

' ) def test_raw_uppercase(self): self.assertMarkdownRenders( '
*foo*
', '
*foo*
' ) def test_raw_uppercase_multiline(self): self.assertMarkdownRenders( self.dedent( """
*foo*
""" ), self.dedent( """
*foo*
""" ) ) def test_multiple_raw_single_line(self): self.assertMarkdownRenders( '

*foo*

*bar*
', self.dedent( """

*foo*

*bar*
""" ) ) def test_multiple_raw_single_line_with_pi(self): self.assertMarkdownRenders( "

*foo*

'; ?>", self.dedent( """

*foo*

'; ?> """ ) ) def test_multiline_raw(self): self.assertMarkdownRenders( self.dedent( """

A raw paragraph with multiple lines.

""" ), self.dedent( """

A raw paragraph with multiple lines.

""" ) ) def test_blank_lines_in_raw(self): self.assertMarkdownRenders( self.dedent( """

A raw paragraph... with many blank lines.

""" ), self.dedent( """

A raw paragraph... with many blank lines.

""" ) ) def test_raw_surrounded_by_Markdown(self): self.assertMarkdownRenders( self.dedent( """ Some *Markdown* text.

*Raw* HTML.

More *Markdown* text. """ ), self.dedent( """

Some Markdown text.

*Raw* HTML.

More Markdown text.

""" ) ) def test_raw_surrounded_by_text_without_blank_lines(self): self.assertMarkdownRenders( self.dedent( """ Some *Markdown* text.

*Raw* HTML.

More *Markdown* text. """ ), self.dedent( """

Some Markdown text.

*Raw* HTML.

More Markdown text.

""" ) ) def test_multiline_markdown_with_code_span(self): self.assertMarkdownRenders( self.dedent( """ A paragraph with a block-level `

code span

`, which is at the start of a line. """ ), self.dedent( """

A paragraph with a block-level <p>code span</p>, which is at the start of a line.

""" ) ) def test_raw_block_preceded_by_markdown_code_span_with_unclosed_block_tag(self): self.assertMarkdownRenders( self.dedent( """ A paragraph with a block-level code span: `
`.

*not markdown*

This is *markdown* """ ), self.dedent( """

A paragraph with a block-level code span: <div>.

*not markdown*

This is markdown

""" ) ) def test_raw_one_line_followed_by_text(self): self.assertMarkdownRenders( '

*foo*

*bar*', self.dedent( """

*foo*

bar

""" ) ) def test_raw_one_line_followed_by_span(self): self.assertMarkdownRenders( "

*foo*

*bar*", self.dedent( """

*foo*

bar

""" ) ) def test_raw_with_markdown_blocks(self): self.assertMarkdownRenders( self.dedent( """
Not a Markdown paragraph. * Not a list item. * Another non-list item. Another non-Markdown paragraph.
""" ), self.dedent( """
Not a Markdown paragraph. * Not a list item. * Another non-list item. Another non-Markdown paragraph.
""" ) ) def test_adjacent_raw_blocks(self): self.assertMarkdownRenders( self.dedent( """

A raw paragraph.

A second raw paragraph.

""" ), self.dedent( """

A raw paragraph.

A second raw paragraph.

""" ) ) def test_adjacent_raw_blocks_with_blank_lines(self): self.assertMarkdownRenders( self.dedent( """

A raw paragraph.

A second raw paragraph.

""" ), self.dedent( """

A raw paragraph.

A second raw paragraph.

""" ) ) def test_nested_raw_one_line(self): self.assertMarkdownRenders( '

*foo*

', '

*foo*

' ) def test_nested_raw_block(self): self.assertMarkdownRenders( self.dedent( """

A raw paragraph.

""" ), self.dedent( """

A raw paragraph.

""" ) ) def test_nested_indented_raw_block(self): self.assertMarkdownRenders( self.dedent( """

A raw paragraph.

""" ), self.dedent( """

A raw paragraph.

""" ) ) def test_nested_raw_blocks(self): self.assertMarkdownRenders( self.dedent( """

A raw paragraph.

A second raw paragraph.

""" ), self.dedent( """

A raw paragraph.

A second raw paragraph.

""" ) ) def test_nested_raw_blocks_with_blank_lines(self): self.assertMarkdownRenders( self.dedent( """

A raw paragraph.

A second raw paragraph.

""" ), self.dedent( """

A raw paragraph.

A second raw paragraph.

""" ) ) def test_nested_inline_one_line(self): self.assertMarkdownRenders( '

foo

', '

foo

' ) def test_raw_nested_inline(self): self.assertMarkdownRenders( self.dedent( """

*text*

""" ), self.dedent( """

*text*

""" ) ) def test_raw_nested_inline_with_blank_lines(self): self.assertMarkdownRenders( self.dedent( """

*text*

""" ), self.dedent( """

*text*

""" ) ) def test_raw_html5(self): self.assertMarkdownRenders( self.dedent( """

Hello :-)

Caption

Some footer

""" ), self.dedent( """

Hello :-)

Caption

Some footer

""" ) ) def test_raw_pre_tag(self): self.assertMarkdownRenders( self.dedent( """ Preserve whitespace in raw html
                class Foo():
                    bar = 'bar'

                    @property
                    def baz(self):
                        return self.bar
                
""" ), self.dedent( """

Preserve whitespace in raw html

                class Foo():
                    bar = 'bar'

                    @property
                    def baz(self):
                        return self.bar
                
""" ) ) def test_raw_pre_tag_nested_escaped_html(self): self.assertMarkdownRenders( self.dedent( """
                <p>foo</p>
                
""" ), self.dedent( """
                <p>foo</p>
                
""" ) ) def test_raw_p_no_end_tag(self): self.assertMarkdownRenders( '

*text*', '

*text*' ) def test_raw_multiple_p_no_end_tag(self): self.assertMarkdownRenders( self.dedent( """

*text*'

more *text* """ ), self.dedent( """

*text*'

more *text* """ ) ) def test_raw_p_no_end_tag_followed_by_blank_line(self): self.assertMarkdownRenders( self.dedent( """

*raw text*' Still part of *raw* text. """ ), self.dedent( """

*raw text*' Still part of *raw* text. """ ) ) def test_raw_nested_p_no_end_tag(self): self.assertMarkdownRenders( '

*text*

', '

*text*

' ) def test_raw_open_bracket_only(self): self.assertMarkdownRenders( '<', '

<

' ) def test_raw_open_bracket_followed_by_space(self): self.assertMarkdownRenders( '< foo', '

< foo

' ) def test_raw_missing_close_bracket(self): self.assertMarkdownRenders( '<foo

' ) def test_raw_unclosed_tag_in_code_span(self): self.assertMarkdownRenders( self.dedent( """ ` hello
""" ), self.dedent( """

<div.

hello
""" ) ) def test_raw_unclosed_tag_in_code_span_space(self): self.assertMarkdownRenders( self.dedent( """ `
hello
""" ), self.dedent( """

<div.

hello
""" ) ) def test_raw_attributes(self): self.assertMarkdownRenders( '

text

', '

text

' ) def test_raw_attributes_nested(self): self.assertMarkdownRenders( self.dedent( """

""" ), self.dedent( """

""" ) ) def test_raw_comment_one_line(self): self.assertMarkdownRenders( '', '' ) def test_raw_comment_one_line_with_tag(self): self.assertMarkdownRenders( '', '' ) def test_comment_in_code_span(self): self.assertMarkdownRenders( '``', '

<!-- *foo* -->

' ) def test_raw_comment_one_line_followed_by_text(self): self.assertMarkdownRenders( '*bar*', self.dedent( """

bar

""" ) ) def test_raw_comment_one_line_followed_by_html(self): self.assertMarkdownRenders( '

*bar*

', self.dedent( """

*bar*

""" ) ) # Note: Trailing (insignificant) whitespace is not preserved, which does not match the # reference implementation. However, it is not a change in behavior for Python-Markdown. def test_raw_comment_trailing_whitespace(self): self.assertMarkdownRenders( ' ', '' ) def test_bogus_comment(self): self.assertMarkdownRenders( '', '

<!invalid>

' ) def test_bogus_comment_endtag(self): self.assertMarkdownRenders( '', '

</#invalid>

' ) def test_raw_multiline_comment(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_multiline_comment_with_tag(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_multiline_comment_first_line(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_multiline_comment_last_line(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_comment_with_blank_lines(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_comment_with_blank_lines_with_tag(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_comment_with_blank_lines_first_line(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_comment_with_blank_lines_last_line(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_comment_indented(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_comment_indented_with_tag(self): self.assertMarkdownRenders( self.dedent( """ """ ), self.dedent( """ """ ) ) def test_raw_comment_nested(self): self.assertMarkdownRenders( self.dedent( """
""" ), self.dedent( """
""" ) ) def test_comment_in_code_block(self): self.assertMarkdownRenders( ' ', self.dedent( """
<!-- *foo* -->
                
""" ) ) # Note: This is a change in behavior. Previously, Python-Markdown interpreted this in the same manner # as browsers and all text after the opening comment tag was considered to be in a comment. However, # that did not match the reference implementation. The new behavior does. def test_unclosed_comment_(self): self.assertMarkdownRenders( self.dedent( """ A *Markdown* paragraph.
""" ), self.dedent( """

A Markdown paragraph.

A Markdown paragraph.

""" ) ) def test_md1_nested_link_ref(self): self.assertMarkdownRenders( self.dedent( """
[link]: http://example.com
[link][link]
""" ), self.dedent( """ """ ) ) def test_md1_hr_only_start(self): self.assertMarkdownRenders( self.dedent( """ *emphasis1*
*emphasis2* """ ), self.dedent( """

emphasis1


emphasis2

""" ) ) def test_md1_hr_self_close(self): self.assertMarkdownRenders( self.dedent( """ *emphasis1*
*emphasis2* """ ), self.dedent( """

emphasis1


emphasis2

""" ) ) def test_md1_hr_start_and_end(self): # Browsers ignore ending hr tags, so we don't try to do anything to handle them special. self.assertMarkdownRenders( self.dedent( """ *emphasis1*
*emphasis2* """ ), self.dedent( """

emphasis1


emphasis2

""" ) ) def test_md1_hr_only_end(self): # Browsers ignore ending hr tags, so we don't try to do anything to handle them special. self.assertMarkdownRenders( self.dedent( """ *emphasis1* *emphasis2* """ ), self.dedent( """

emphasis1 emphasis2

""" ) ) def test_md1_hr_with_content(self): # Browsers ignore ending hr tags, so we don't try to do anything to handle them special. # Content is not allowed and will be treated as normal content between two hr tags self.assertMarkdownRenders( self.dedent( """ *emphasis1*
**content** *emphasis2* """ ), self.dedent( """

emphasis1


content emphasis2

""" ) ) def test_no_md1_hr_with_content(self): # Browsers ignore ending hr tags, so we don't try to do anything to handle them special. # Content is not allowed and will be treated as normal content between two hr tags self.assertMarkdownRenders( self.dedent( """ *emphasis1*
**content** *emphasis2* """ ), self.dedent( """

emphasis1


content emphasis2

""" ) ) def test_md1_nested_abbr_ref(self): self.assertMarkdownRenders( self.dedent( """
*[abbr]: Abbreviation
abbr
""" ), self.dedent( """

abbr

""" ), extensions=['md_in_html', 'abbr'] ) def test_md1_nested_footnote_ref(self): self.assertMarkdownRenders( self.dedent( """
[^1]: The footnote.
Paragraph with a footnote.[^1]
""" ), '
\n' '
\n' '

Paragraph with a footnote.1

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

    The footnote. ' '' '

    \n' '
  2. \n' '
\n' '
', extensions=['md_in_html', 'footnotes'] ) def load_tests(loader, tests, pattern): """ Ensure `TestHTMLBlocks` doesn't get run twice by excluding it here. """ suite = TestSuite() for test_class in [TestDefaultwMdInHTML, TestMdInHTML, TestMarkdownInHTMLPostProcessor]: tests = loader.loadTestsFromTestCase(test_class) suite.addTests(tests) return suite ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/extensions/test_smarty.py0000644000175100001770000001675314657673134023524 0ustar00runnerdocker# -*- 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-2022 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 TestSmarty(TestCase): default_kwargs = {'extensions': ['smarty']} def test_basic(self): self.assertMarkdownRenders( "It's fun. What's fun?", '

It’s fun. What’s fun?

' ) self.assertMarkdownRenders( '"Isn\'t this fun"? --- she said...', '

“Isn’t this fun”? — she said…

' ) self.assertMarkdownRenders( '"\'Quoted\' words in a larger quote."', '

“‘Quoted’ words in a larger quote.”

' ) self.assertMarkdownRenders( '\'Quoted "words" in a larger quote.\'', '

‘Quoted “words” in a larger quote.’

' ) self.assertMarkdownRenders( '"quoted" text and **bold "quoted" text**', '

“quoted” text and bold “quoted” text

' ) self.assertMarkdownRenders( "'quoted' text and **bold 'quoted' text**", '

‘quoted’ text and bold ‘quoted’ text

' ) self.assertMarkdownRenders( 'em-dashes (---) and ellipes (...)', '

em-dashes (—) and ellipes (…)

' ) self.assertMarkdownRenders( '"[Link](http://example.com)" --- she said.', '

Link” — she said.

' ) self.assertMarkdownRenders( '"Ellipsis within quotes..."', '

“Ellipsis within quotes…”

' ) self.assertMarkdownRenders( "*Custer*'s Last Stand", "

Custer’s Last Stand

" ) def test_years(self): self.assertMarkdownRenders("1440--80's", '

1440–80’s

') self.assertMarkdownRenders("1440--'80s", '

1440–’80s

') self.assertMarkdownRenders("1440---'80s", '

1440—’80s

') self.assertMarkdownRenders("1960's", '

1960’s

') self.assertMarkdownRenders("one two '60s", '

one two ’60s

') self.assertMarkdownRenders("'60s", '

’60s

') def test_wrapping_line(self): text = ( "A line that 'wraps' with\n" "*emphasis* at the beginning of the next line." ) html = ( '

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

' ) self.assertMarkdownRenders(text, html) def test_escaped(self): self.assertMarkdownRenders( 'Escaped \\-- ndash', '

Escaped -- ndash

' ) self.assertMarkdownRenders( '\\\'Escaped\\\' \\"quotes\\"', '

\'Escaped\' "quotes"

' ) self.assertMarkdownRenders( 'Escaped ellipsis\\...', '

Escaped ellipsis...

' ) self.assertMarkdownRenders( '\'Escaped \\"quotes\\" in real ones\'', '

‘Escaped "quotes" in real ones’

' ) self.assertMarkdownRenders( '\\\'"Real" quotes in escaped ones\\\'', "

'“Real” quotes in escaped ones'

" ) def test_escaped_attr(self): self.assertMarkdownRenders( '![x\"x](x)', '

x"x

' ) def test_code_spans(self): self.assertMarkdownRenders( 'Skip `"code" -- --- \'spans\' ...`.', '

Skip "code" -- --- \'spans\' ....

' ) def test_code_blocks(self): text = ( ' Also skip "code" \'blocks\'\n' ' foo -- bar --- baz ...' ) html = ( '
Also skip "code" \'blocks\'\n'
            'foo -- bar --- baz ...\n'
            '
' ) self.assertMarkdownRenders(text, html) def test_horizontal_rule(self): self.assertMarkdownRenders('--- -- ---', '
') class TestSmartyAngledQuotes(TestCase): default_kwargs = { 'extensions': ['smarty'], 'extension_configs': { 'smarty': { 'smart_angled_quotes': True, }, }, } def test_angled_quotes(self): self.assertMarkdownRenders( '<>', '

«hello»

' ) self.assertMarkdownRenders( 'Кавычки-<<ёлочки>>', '

Кавычки-«Ñ‘лочки»

' ) self.assertMarkdownRenders( 'Anführungszeichen->>Chevrons<<', '

Anführungszeichen-»Chevrons«

' ) class TestSmartyCustomSubstitutions(TestCase): default_kwargs = { 'extensions': ['smarty'], 'extension_configs': { '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': ']', }, }, }, } def test_custom_substitutions(self): text = ( '<< The "Unicode char of the year 2014"\n' "is the 'mdash': ---\n" "Must not be confused with 'ndash' (--) ... >>" ) html = ( '

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

' ) self.assertMarkdownRenders(text, html) class TestSmartyAndToc(TestCase): default_kwargs = { 'extensions': ['smarty', 'toc'], } def test_smarty_and_toc(self): self.assertMarkdownRenders( '# *Foo* --- `bar`', '

Foobar

', expected_attrs={ 'toc_tokens': [ { 'level': 1, 'id': 'foo-bar', 'name': 'Foo — bar', 'html': 'Foobar', 'data-toc-label': '', 'children': [], }, ], }, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/extensions/test_tables.py0000644000175100001770000006343214657673134023453 0ustar00runnerdocker""" 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-2023 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 from markdown.extensions.tables import TableExtension 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'] ) def test_no_sides(self): self.assertMarkdownRenders( self.dedent( """ First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell """ ), self.dedent( """
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
""" ), extensions=['tables'] ) def test_both_sides(self): self.assertMarkdownRenders( self.dedent( """ | First Header | Second Header | | ------------- | ------------- | | Content Cell | Content Cell | | Content Cell | Content Cell | """ ), self.dedent( """
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
""" ), extensions=['tables'] ) def test_align_columns(self): self.assertMarkdownRenders( self.dedent( """ | Item | Value | | :-------- | -----:| | Computer | $1600 | | Phone | $12 | | Pipe | $1 | """ ), self.dedent( """
Item Value
Computer $1600
Phone $12
Pipe $1
""" ), extensions=['tables'] ) def test_styles_in_tables(self): self.assertMarkdownRenders( self.dedent( """ | Function name | Description | | ------------- | ------------------------------ | | `help()` | Display the help window. | | `destroy()` | **Destroy your computer!** | """ ), self.dedent( """
Function name Description
help() Display the help window.
destroy() Destroy your computer!
""" ), extensions=['tables'] ) def test_align_three(self): self.assertMarkdownRenders( self.dedent( """ |foo|bar|baz| |:--|:-:|--:| | | Q | | |W | | W| """ ), self.dedent( """
foo bar baz
Q
W W
""" ), extensions=['tables'] ) def test_three_columns(self): self.assertMarkdownRenders( self.dedent( """ foo|bar|baz ---|---|--- | Q | W | | W """ ), self.dedent( """
foo bar baz
Q
W W
""" ), extensions=['tables'] ) def test_three_spaces_prefix(self): self.assertMarkdownRenders( self.dedent( """ 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 | """), self.dedent( """

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
""" ), extensions=['tables'] ) def test_code_block_table(self): self.assertMarkdownRenders( self.dedent( """ Four spaces is a code block: First Header | Second Header ------------ | ------------- Content Cell | Content Cell Content Cell | Content Cell | First Header | Second Header | | ------------ | ------------- | """), self.dedent( """

Four spaces is a code block:

First Header | Second Header
                ------------ | -------------
                Content Cell | Content Cell
                Content Cell | Content Cell
                
First Header Second Header
""" ), extensions=['tables'] ) def test_inline_code_blocks(self): self.assertMarkdownRenders( self.dedent( """ 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 """), self.dedent( """

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
""" ), extensions=['tables'] ) def test_issue_440(self): self.assertMarkdownRenders( self.dedent( """ A test for issue #440: foo | bar --- | --- foo | (`bar`) and `baz`. """), self.dedent( """

A test for issue #440:

foo bar
foo (bar) and baz.
""" ), extensions=['tables'] ) def test_lists_not_tables(self): self.assertMarkdownRenders( self.dedent( """ Lists are not tables - this | should | not - be | a | table """), self.dedent( """

Lists are not tables

  • this | should | not
  • be | a | table
""" ), extensions=['tables'] ) def test_issue_449(self): self.assertMarkdownRenders( self.dedent( r""" 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` """), self.dedent( """

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
""" ), extensions=['tables'] ) def test_single_column_tables(self): self.assertMarkdownRenders( self.dedent( """ 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 """), self.dedent( """

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

""" ), extensions=['tables'] ) def test_align_columns_legacy(self): self.assertMarkdownRenders( self.dedent( """ | Item | Value | | :-------- | -----:| | Computer | $1600 | | Phone | $12 | | Pipe | $1 | """ ), self.dedent( """
Item Value
Computer $1600
Phone $12
Pipe $1
""" ), extensions=[TableExtension(use_align_attribute=True)] ) def test_align_three_legacy(self): self.assertMarkdownRenders( self.dedent( """ |foo|bar|baz| |:--|:-:|--:| | | Q | | |W | | W| """ ), self.dedent( """
foo bar baz
Q
W W
""" ), extensions=[TableExtension(use_align_attribute=True)] ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/extensions/test_toc.py0000644000175100001770000016312614657673134022767 0ustar00runnerdocker""" 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 from markdown import Markdown from markdown.extensions.toc import TocExtension, strip_tags, unique from markdown.extensions.nl2br import Nl2BrExtension class TestTOC(TestCase): maxDiff = None default_kwargs = { 'extensions': [TocExtension()] } def testTOCMarker(self): self.assertMarkdownRenders( self.dedent( ''' [TOC] # Header 1 ## Header 2 ''' ), '
\n' '
    \n' # noqa '
  • Header 1' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' '

Header 1

\n' '

Header 2

' ) def testNoTOCMarker(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 ## Header 2 ''' ), self.dedent( '''

Header 1

Header 2

''' ), expected_attrs={ 'toc': ( '
\n' '
    \n' # noqa '
  • Header 1' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' ) } ) def testAlternateTOCMarker(self): self.assertMarkdownRenders( self.dedent( ''' {{marker}} # Header 1 ## Header 2 ''' ), '
\n' '
    \n' # noqa '
  • Header 1' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' '

Header 1

\n' '

Header 2

', extensions=[TocExtension(marker='{{marker}}')] ) def testDisabledTOCMarker(self): self.assertMarkdownRenders( self.dedent( ''' [TOC] # Header 1 ## Header 2 ''' ), self.dedent( '''

[TOC]

Header 1

Header 2

''' ), expected_attrs={ 'toc': ( '
\n' '
    \n' # noqa '
  • Header 1' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' ) }, extensions=[TocExtension(marker='')] ) def testTOCReset(self): md = Markdown(extensions=[TocExtension()]) self.assertEqual(md.toc, '') self.assertEqual(md.toc_tokens, []) md.convert('# Header 1') self.assertEqual('
', md.toc[:17]) self.assertEqual(len(md.toc_tokens), 1) md.reset() self.assertEqual(md.toc, '') self.assertEqual(md.toc_tokens, []) def testUniqueIds(self): self.assertMarkdownRenders( self.dedent( ''' #Header #Header #Header ''' ), self.dedent( '''

Header

Header

Header

''' ), expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' ), 'toc_tokens': [ { 'level': 1, 'id': 'header', 'name': 'Header', 'html': 'Header', 'data-toc-label': '', 'children': [] }, { 'level': 1, 'id': 'header_1', 'name': 'Header', 'html': 'Header', 'data-toc-label': '', 'children': [] }, { 'level': 1, 'id': 'header_2', 'name': 'Header', 'html': 'Header', 'data-toc-label': '', 'children': [] }, ] } ) def testHtmlEntitiesInTOC(self): self.assertMarkdownRenders( '# Foo & bar', '

Foo & bar

', expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' ), 'toc_tokens': [{ 'level': 1, 'id': 'foo-bar', 'name': 'Foo & bar', 'html': 'Foo & bar', 'data-toc-label': '', 'children': [] }] } ) def testHtmlSpecialCharsInTOC(self): self.assertMarkdownRenders( '# Foo > & bar', '

Foo > & bar

', expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' ), 'toc_tokens': [{ 'level': 1, 'id': 'foo-bar', 'name': 'Foo > & bar', 'html': 'Foo > & bar', 'data-toc-label': '', 'children': [] }] } ) def testRawHtmlInTOC(self): self.assertMarkdownRenders( '# Foo Bar Baz.', '

Foo Bar Baz.

', expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' ), 'toc_tokens': [{ 'level': 1, 'id': 'foo-bar-baz', 'name': 'Foo Bar Baz.', 'html': 'Foo Bar Baz.', 'data-toc-label': '', 'children': [] }] } ) def testTOCBaseLevel(self): self.assertMarkdownRenders( self.dedent( ''' # Some Header ## Next Level ### Too High ''' ), self.dedent( '''
Some Header
Next Level
Too High
''' ), expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' ), 'toc_tokens': [{ 'level': 5, 'id': 'some-header', 'name': 'Some Header', 'html': 'Some Header', 'data-toc-label': '', 'children': [ { 'level': 6, 'id': 'next-level', 'name': 'Next Level', 'html': 'Next Level', 'data-toc-label': '', 'children': [] }, { 'level': 6, 'id': 'too-high', 'name': 'Too High', 'html': 'Too High', 'data-toc-label': '', 'children': [] } ] }] }, extensions=[TocExtension(baselevel=5)] ) def testHeaderInlineMarkup(self): self.assertMarkdownRenders( '#Some *Header* with [markup](http://example.com).', '

Some Header with ' 'markup.

', expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' ), 'toc_tokens': [{ 'level': 1, 'id': 'some-header-with-markup', 'name': 'Some Header with markup.', 'html': 'Some Header with markup.', 'data-toc-label': '', 'children': [] }] } ) def testTOCTitle(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 ## Header 2 ''' ), self.dedent( '''

Header 1

Header 2

''' ), expected_attrs={ 'toc': ( '
Table of Contents' '
    \n' # noqa '
  • Header 1' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' ) }, extensions=[TocExtension(title='Table of Contents')] ) def testTOCUniqueFunc(self): ids = {'foo'} self.assertEqual(unique('foo', ids), 'foo_1') self.assertEqual(ids, {'foo', 'foo_1'}) def testTocInHeaders(self): self.assertMarkdownRenders( self.dedent( ''' [TOC] #[TOC] ''' ), '
\n' # noqa '
    \n' # noqa '
  • [TOC]
  • \n' # noqa '
\n' # noqa '
\n' # noqa '

[TOC]

' # noqa ) self.assertMarkdownRenders( self.dedent( ''' #[TOC] [TOC] ''' ), '

[TOC]

\n' # noqa '
\n' # noqa '
    \n' # noqa '
  • [TOC]
  • \n' # noqa '
\n' # noqa '
' # noqa ) self.assertMarkdownRenders( self.dedent( ''' [TOC] # *[TOC]* ''' ), '
\n' # noqa '
    \n' # noqa '
  • [TOC]
  • \n' # noqa '
\n' # noqa '
\n' # noqa '

[TOC]

' # noqa ) def testTOCPermalink(self): self.assertMarkdownRenders( self.dedent( ''' # Hd 1 ## Hd 2 ''' ), '

' 'Hd 1' # noqa '' # noqa '¶' # noqa '' # noqa '

\n' '

' 'Hd 2' # noqa '' # noqa '¶' # noqa '' # noqa '

', extensions=[TocExtension(permalink=True, permalink_title="PL")] ) def testTOCPermalinkLeading(self): self.assertMarkdownRenders( self.dedent( ''' # Hd 1 ## Hd 2 ''' ), '

' '' # noqa '¶' # noqa '' # noqa 'Hd 1' # noqa '

\n' '

' '' # noqa '¶' # noqa '' # noqa 'Hd 2' # noqa '

', extensions=[TocExtension(permalink=True, permalink_title="PL", permalink_leading=True)] ) def testTOCInlineMarkupPermalink(self): self.assertMarkdownRenders( '# Code `in` hd', '

' 'Code in hd' # noqa '' # noqa '¶' # noqa '' # noqa '

', extensions=[TocExtension(permalink=True, permalink_title="PL")] ) def testTOCInlineMarkupPermalinkLeading(self): self.assertMarkdownRenders( '# Code `in` hd', '

' '' # noqa '¶' # noqa '' # noqa 'Code in hd' # noqa '

', extensions=[TocExtension(permalink=True, permalink_title="PL", permalink_leading=True)] ) def testAnchorLink(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 ## Header *2* ''' ), self.dedent( '''

Header 1

Header 2

''' ), extensions=[TocExtension(anchorlink=True)] ) def testAnchorLinkWithSingleInlineCode(self): self.assertMarkdownRenders( '# This is `code`.', '

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

', # noqa extensions=[TocExtension(anchorlink=True)] ) def testAnchorLinkWithDoubleInlineCode(self): self.assertMarkdownRenders( '# This is `code` and `this` too.', '

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

', # noqa extensions=[TocExtension(anchorlink=True)] ) def testPermalink(self): self.assertMarkdownRenders( '# Header', '

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

', # noqa extensions=[TocExtension(permalink=True)] ) def testPermalinkWithSingleInlineCode(self): self.assertMarkdownRenders( '# This is `code`.', '

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

', # noqa extensions=[TocExtension(permalink=True)] ) def testPermalinkWithDoubleInlineCode(self): self.assertMarkdownRenders( '# This is `code` and `this` too.', '

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

', # noqa extensions=[TocExtension(permalink=True)] ) def testMinMaxLevel(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 not in TOC ## Header 2 not in TOC ### Header 3 #### Header 4 ##### Header 5 not in TOC ''' ), self.dedent( '''

Header 1 not in TOC

Header 2 not in TOC

Header 3

Header 4

Header 5 not in TOC
''' ), expected_attrs={ 'toc': ( '
\n' '
    \n' # noqa '
  • Header 3' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' # noqa ), 'toc_tokens': [ { 'level': 3, 'id': 'header-3', 'name': 'Header 3', 'html': 'Header 3', 'data-toc-label': '', 'children': [ { 'level': 4, 'id': 'header-4', 'name': 'Header 4', 'html': 'Header 4', 'data-toc-label': '', 'children': [] } ] } ] }, extensions=[TocExtension(toc_depth='3-4')] ) def testMaxLevel(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 ## Header 2 ### Header 3 not in TOC ''' ), self.dedent( '''

Header 1

Header 2

Header 3 not in TOC

''' ), expected_attrs={ 'toc': ( '
\n' '
    \n' # noqa '
  • Header 1' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' # noqa ), 'toc_tokens': [ { 'level': 1, 'id': 'header-1', 'name': 'Header 1', 'html': 'Header 1', 'data-toc-label': '', 'children': [ { 'level': 2, 'id': 'header-2', 'name': 'Header 2', 'html': 'Header 2', 'data-toc-label': '', 'children': [] } ] } ] }, extensions=[TocExtension(toc_depth=2)] ) def testMinMaxLevelwithAnchorLink(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 not in TOC ## Header 2 not in TOC ### Header 3 #### Header 4 ##### Header 5 not in TOC ''' ), '

' # noqa 'Header 1 not in TOC

\n' # noqa '

' # noqa 'Header 2 not in TOC

\n' # noqa '

' # noqa 'Header 3

\n' # noqa '

' # noqa 'Header 4

\n' # noqa '
' # noqa 'Header 5 not in TOC
', # noqa expected_attrs={ 'toc': ( '
\n' '
    \n' # noqa '
  • Header 3' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' # noqa ), 'toc_tokens': [ { 'level': 3, 'id': 'header-3', 'name': 'Header 3', 'html': 'Header 3', 'data-toc-label': '', 'children': [ { 'level': 4, 'id': 'header-4', 'name': 'Header 4', 'html': 'Header 4', 'data-toc-label': '', 'children': [] } ] } ] }, extensions=[TocExtension(toc_depth='3-4', anchorlink=True)] ) def testMinMaxLevelwithPermalink(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 not in TOC ## Header 2 not in TOC ### Header 3 #### Header 4 ##### Header 5 not in TOC ''' ), '

Header 1 not in TOC' # noqa '

\n' # noqa '

Header 2 not in TOC' # noqa '

\n' # noqa '

Header 3' # noqa '

\n' # noqa '

Header 4' # noqa '

\n' # noqa '
Header 5 not in TOC' # noqa '
', # noqa expected_attrs={ 'toc': ( '
\n' '
    \n' # noqa '
  • Header 3' # noqa '\n' # noqa '
  • \n' # noqa '
\n' # noqa '
\n' # noqa ), 'toc_tokens': [ { 'level': 3, 'id': 'header-3', 'name': 'Header 3', 'html': 'Header 3', 'data-toc-label': '', 'children': [ { 'level': 4, 'id': 'header-4', 'name': 'Header 4', 'html': 'Header 4', 'data-toc-label': '', 'children': [] } ] } ] }, extensions=[TocExtension(toc_depth='3-4', permalink=True)] ) def testMinMaxLevelwithBaseLevel(self): self.assertMarkdownRenders( self.dedent( ''' # First Header ## Second Level ### Third Level #### Forth Level ''' ), self.dedent( '''

First Header

Second Level

Third Level
Forth Level
''' ), expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' # noqa ), 'toc_tokens': [ { 'level': 4, 'id': 'second-level', 'name': 'Second Level', 'html': 'Second Level', 'data-toc-label': '', 'children': [ { 'level': 5, 'id': 'third-level', 'name': 'Third Level', 'html': 'Third Level', 'data-toc-label': '', 'children': [] } ] } ] }, extensions=[TocExtension(toc_depth='4-5', baselevel=3)] ) def testMaxLevelwithBaseLevel(self): self.assertMarkdownRenders( self.dedent( ''' # Some Header ## Next Level ### Too High ''' ), self.dedent( '''

Some Header

Next Level

Too High

''' ), expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' # noqa ), 'toc_tokens': [ { 'level': 2, 'id': 'some-header', 'name': 'Some Header', 'html': 'Some Header', 'data-toc-label': '', 'children': [ { 'level': 3, 'id': 'next-level', 'name': 'Next Level', 'html': 'Next Level', 'data-toc-label': '', 'children': [] } ] } ] }, extensions=[TocExtension(toc_depth=3, baselevel=2)] ) def test_escaped_code(self): self.assertMarkdownRenders( self.dedent( ''' [TOC] # `` ''' ), self.dedent( '''

<test>

''' ), extensions=['toc'] ) def test_escaped_char_in_id(self): self.assertMarkdownRenders( r'# escaped\_character', '

escaped_character

', expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' # noqa ), 'toc_tokens': [ { 'level': 1, 'id': 'escaped_character', 'name': 'escaped_character', 'html': 'escaped_character', 'data-toc-label': '', 'children': [] } ] }, extensions=['toc'] ) def testAutoLinkEmail(self): self.assertMarkdownRenders( '## ', '

foo@exa' 'mple.org

', expected_attrs={ 'toc_tokens': [ { 'level': 2, 'id': 'fooexampleorg', 'name': 'foo@exam' 'ple.org', 'html': 'foo' '@example.org', 'data-toc-label': '', 'children': [] } ] }, extensions=['toc'] ) def testAnchorLinkWithCustomClass(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 ## Header *2* ''' ), self.dedent( '''

Header 1

Header 2

''' ), extensions=[TocExtension(anchorlink=True, anchorlink_class="custom")] ) def testAnchorLinkWithCustomClasses(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 ## Header *2* ''' ), self.dedent( '''

Header 1

Header 2

''' ), extensions=[TocExtension(anchorlink=True, anchorlink_class="custom1 custom2")] ) def testPermalinkWithEmptyText(self): self.assertMarkdownRenders( '# Header', '

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

', # noqa extensions=[TocExtension(permalink="")] ) def testPermalinkWithCustomClass(self): self.assertMarkdownRenders( '# Header', '

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

', # noqa extensions=[TocExtension(permalink=True, permalink_class="custom")] ) def testPermalinkWithCustomClasses(self): self.assertMarkdownRenders( '# Header', '

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

', # noqa extensions=[TocExtension(permalink=True, permalink_class="custom1 custom2")] ) def testPermalinkWithCustomTitle(self): self.assertMarkdownRenders( '# Header', '

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

', # noqa extensions=[TocExtension(permalink=True, permalink_title="custom")] ) def testPermalinkWithEmptyTitle(self): self.assertMarkdownRenders( '# Header', '

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

', # noqa extensions=[TocExtension(permalink=True, permalink_title="")] ) def testPermalinkWithUnicodeInID(self): from markdown.extensions.toc import slugify_unicode self.assertMarkdownRenders( '# Unicode ヘッダー', '

' # noqa 'Unicode ヘッダー' # noqa '' # noqa '

', # noqa extensions=[TocExtension(permalink=True, slugify=slugify_unicode)] ) def testPermalinkWithUnicodeTitle(self): from markdown.extensions.toc import slugify_unicode self.assertMarkdownRenders( '# Unicode ヘッダー', '

' # noqa 'Unicode ヘッダー' # noqa '' # noqa '

', # noqa extensions=[TocExtension(permalink=True, permalink_title="パーマリンク", slugify=slugify_unicode)] ) def testPermalinkWithExtendedLatinInID(self): self.assertMarkdownRenders( '# Théâtre', '

' # noqa 'Théâtre' # noqa '' # noqa '

', # noqa extensions=[TocExtension(permalink=True)] ) def testNl2brCompatibility(self): self.assertMarkdownRenders( '[TOC]\ntext', '

[TOC]
\ntext

', extensions=[TocExtension(), Nl2BrExtension()] ) def testTOCWithCustomClass(self): self.assertMarkdownRenders( self.dedent( ''' [TOC] # Header ''' ), self.dedent( '''

Header

''' ), extensions=[TocExtension(toc_class="custom")] ) def testTOCWithCustomClasses(self): self.assertMarkdownRenders( self.dedent( ''' [TOC] # Header ''' ), self.dedent( '''

Header

''' ), extensions=[TocExtension(toc_class="custom1 custom2")] ) def testTOCWithEmptyTitleClass(self): self.assertMarkdownRenders( self.dedent( ''' [TOC] # Header ''' ), self.dedent( '''
ToC

Header

''' ), extensions=[TocExtension(title_class="", title='ToC')] ) def testTOCWithCustomTitleClass(self): self.assertMarkdownRenders( self.dedent( ''' [TOC] # Header ''' ), self.dedent( '''
ToC

Header

''' ), extensions=[TocExtension(title_class="tocname", title='ToC')] ) def testTocWithAttrList(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1 ## Header 2 { #foo } ## Header 3 { data-toc-label="Foo Bar" } # Header 4 { data-toc-label="Foo > & < Baz" } # Header 5 { data-toc-label="Foo Quux" } ''' ), self.dedent( '''

Header 1

Header 2

Header 3

Header 4

Header 5

''' ), expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' ), 'toc_tokens': [ { 'level': 1, 'id': 'header-1', 'name': 'Header 1', 'html': 'Header 1', 'data-toc-label': '', 'children': [ { 'level': 2, 'id': 'foo', 'name': 'Header 2', 'html': 'Header 2', 'data-toc-label': '', 'children': [] }, { 'level': 2, 'id': 'header-3', 'name': 'Foo Bar', 'html': 'Header 3', 'data-toc-label': 'Foo Bar', 'children': [] } ] }, { 'level': 1, 'id': 'header-4', 'name': 'Foo > & < Baz', 'html': 'Header 4', 'data-toc-label': 'Foo > & < Baz', 'children': [] }, { 'level': 1, 'id': 'header-5', 'name': 'Foo Quux', 'html': 'Header 5', 'data-toc-label': 'Foo Quux', 'children': [] }, ] }, extensions=[TocExtension(), 'attr_list'] ) def testHeadingRemoveFootnoteRef(self): self.assertMarkdownRenders( self.dedent( ''' # Header 1[^1] # Header[^1] 2 # Header *subelement*[^1] 3 # Header[^1] double[^1] 4 [^1]: footnote ''' ), ( '

Header 11

\n' '

Header1 2

\n' '

' 'Header subelement1 3' '

\n' '

' 'Header1 double' '1 4' '

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

    ' 'footnote ' '' '' '' '' '' '

    \n' '
  2. \n' '
\n' '
' ), expected_attrs={ 'toc': ( '
\n' '\n' # noqa '
\n' # noqa ), 'toc_tokens': [ { 'level': 1, 'id': 'header-1', 'name': 'Header 1', 'html': 'Header 1', 'data-toc-label': '', 'children': [] }, { 'level': 1, 'id': 'header-2', 'name': 'Header 2', 'html': 'Header 2', 'data-toc-label': '', 'children': [] }, { 'level': 1, 'id': 'header-subelement-3', 'name': 'Header subelement 3', 'html': 'Header subelement 3', 'data-toc-label': '', 'children': [] }, { 'level': 1, 'id': 'header-double-4', 'name': 'Header double 4', 'html': 'Header double 4', 'data-toc-label': '', 'children': [] } ] }, extensions=[TocExtension(), 'footnotes'] ) class testStripTags(TestCase): def testStripElement(self): self.assertEqual( strip_tags('foo bar'), 'foo bar' ) def testStripOpenElement(self): self.assertEqual( strip_tags('foo bar'), 'foo bar' ) def testStripEmptyElement(self): self.assertEqual( strip_tags('foo
bar'), 'foo bar' ) def testDontStripOpenBracket(self): self.assertEqual( strip_tags('foo < bar'), 'foo < bar' ) def testDontStripCloseBracket(self): self.assertEqual( strip_tags('foo > bar'), 'foo > bar' ) def testStripCollapseWhitespace(self): self.assertEqual( strip_tags('foo \tbar\t'), 'foo bar' ) def testStripElementWithNewlines(self): self.assertEqual( strip_tags('foo bar'), 'foo bar' ) def testStripComment(self): self.assertEqual( strip_tags('foo bar'), 'foo bar' ) def testStripCommentWithInnerTags(self): self.assertEqual( strip_tags('foo bar'), 'foo bar' ) def testStripCommentInElement(self): self.assertEqual( strip_tags('foo bar'), 'foo bar' ) def testDontStripHTMLEntities(self): self.assertEqual( strip_tags('foo < & < bar'), 'foo < & < bar' ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1723823713.1037383 markdown-3.7/tests/test_syntax/inline/0000755000175100001770000000000014657673141017635 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/inline/__init__.py0000644000175100001770000000134114657673134021747 0ustar00runnerdocker""" 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-2023 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). """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/inline/test_autolinks.py0000644000175100001770000000520114657673134023257 0ustar00runnerdocker""" 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-2021 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 TestAutomaticLinks(TestCase): def test_email_address(self): self.assertMarkdownRenders( 'asdfasdfadsfasd or you can say ', '

asdfasdfadsfasd yuri@freewisd' 'om.org or you can say

' ) def test_mailto_email_address(self): self.assertMarkdownRenders( 'instead ', '

instead ' 'yuri@freewisdom' '.org

' ) def test_email_address_with_ampersand(self): self.assertMarkdownRenders( '', '

bob&' 'sue@example.com

' ) def test_invalid_email_address_local_part(self): self.assertMarkdownRenders( 'Missing local-part <@domain>', '

Missing local-part <@domain>

' ) def test_invalid_email_address_domain(self): self.assertMarkdownRenders( 'Missing domain ', '

Missing domain <local-part@>

' ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/inline/test_emphasis.py0000644000175100001770000001236214657673134023065 0ustar00runnerdocker""" 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_asterisks_consecutive(self): self.assertMarkdownRenders( 'Foo * * * *', '

Foo * * * *

' ) def test_standalone_understore_consecutive(self): self.assertMarkdownRenders( 'Foo _ _ _ _', '

Foo _ _ _ _

' ) def test_standalone_asterisks_pairs(self): self.assertMarkdownRenders( 'Foo ** ** ** **', '

Foo ** ** ** **

' ) def test_standalone_understore_pairs(self): self.assertMarkdownRenders( 'Foo __ __ __ __', '

Foo __ __ __ __

' ) def test_standalone_asterisks_triples(self): self.assertMarkdownRenders( 'Foo *** *** *** ***', '

Foo *** *** *** ***

' ) def test_standalone_understore_triples(self): self.assertMarkdownRenders( 'Foo ___ ___ ___ ___', '

Foo ___ ___ ___ ___

' ) 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_underscore_at_begin(self): self.assertMarkdownRenders( '_ foo_ bar', '

_ foo_ bar

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

foo *bar *

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

_ bar _

' ) def test_complex_emphasis_asterisk(self): self.assertMarkdownRenders( 'This is text **bold *italic bold*** with more text', '

This is text bold italic bold with more text

' ) def test_complex_emphasis_asterisk_mid_word(self): self.assertMarkdownRenders( 'This is text **bold*italic bold*** with more text', '

This is text bolditalic bold with more text

' ) def test_complex_emphasis_smart_underscore(self): self.assertMarkdownRenders( 'This is text __bold _italic bold___ with more text', '

This is text bold italic bold with more text

' ) def test_complex_emphasis_smart_underscore_mid_word(self): self.assertMarkdownRenders( 'This is text __bold_italic bold___ with more text', '

This is text __bold_italic bold___ with more text

' ) def test_nested_emphasis(self): self.assertMarkdownRenders( 'This text is **bold *italic* *italic* bold**', '

This text is bold italic italic bold

' ) def test_complex_multple_emphasis_type(self): self.assertMarkdownRenders( 'traced ***along*** bla **blocked** if other ***or***', '

traced along bla blocked if other or

' # noqa: E501 ) def test_complex_multple_emphasis_type_variant2(self): self.assertMarkdownRenders( 'on the **1-4 row** of the AP Combat Table ***and*** receive', '

on the 1-4 row of the AP Combat Table and receive

' ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/inline/test_entities.py0000644000175100001770000000313114657673134023072 0ustar00runnerdocker""" 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-2023 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;

") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/inline/test_images.py0000644000175100001770000001547114657673134022525 0ustar00runnerdocker""" 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-2023 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

""" ) def test_short_ref(self): self.assertMarkdownRenders( self.dedent( """ ![ref] [ref]: ./image.jpg """ ), '

ref

' ) def test_short_ref_in_link(self): self.assertMarkdownRenders( self.dedent( """ [![img ref]](http://example.com/) [img ref]: ./image.jpg """ ), '

img ref

' ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/inline/test_links.py0000644000175100001770000003017314657673134022374 0ustar00runnerdocker""" 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-2023 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 TestInlineLinks(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

' ) class TestReferenceLinks(TestCase): def test_ref_link(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: http://example.com """ ), """

Text

""" ) def test_ref_link_angle_brackets(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: """ ), """

Text

""" ) def test_ref_link_no_space(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]:http://example.com """ ), """

Text

""" ) def test_ref_link_angle_brackets_no_space(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: """ ), """

Text

""" ) def test_ref_link_angle_brackets_title(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: "title" """ ), """

Text

""" ) def test_ref_link_title(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: http://example.com "title" """ ), """

Text

""" ) def test_ref_link_angle_brackets_title_no_space(self): # TODO: Maybe reevaluate this? self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: "title" """ ), """

Text

""" ) def test_ref_link_title_no_space(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: http://example.com"title" """ ), """

Text

""" ) def test_ref_link_single_quoted_title(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: http://example.com 'title' """ ), """

Text

""" ) def test_ref_link_title_nested_quote(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: http://example.com "title'" """ ), """

Text

""" ) def test_ref_link_single_quoted_title_nested_quote(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: http://example.com 'title"' """ ), """

Text

""" ) def test_ref_link_override(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: http://example.com 'ignore' [Text]: https://example.com 'override' """ ), """

Text

""" ) def test_ref_link_title_no_blank_lines(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: http://example.com "title" [Text] """ ), self.dedent( """

Text

Text

""" ) ) def test_ref_link_multi_line(self): self.assertMarkdownRenders( self.dedent( """ [Text] [Text]: http://example.com "title" """ ), """

Text

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

' ) def test_ref_link_nested_left_bracket(self): self.assertMarkdownRenders( self.dedent( """ [Text[] [Text[]: http://example.com """ ), self.dedent( """

[Text[]

[Text[]: http://example.com

""" ) ) def test_ref_link_nested_right_bracket(self): self.assertMarkdownRenders( self.dedent( """ [Text]] [Text]]: http://example.com """ ), self.dedent( """

[Text]]

[Text]]: http://example.com

""" ) ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tests/test_syntax/inline/test_raw_html.py0000644000175100001770000000251214657673134023065 0ustar00runnerdocker""" 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-2023 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 TestRawHtml(TestCase): def test_inline_html_angle_brackets(self): self.assertMarkdownRenders("e", "

e<c

") self.assertMarkdownRenders("e>c", "

e>c

") self.assertMarkdownRenders("e < c", "

e < c

") self.assertMarkdownRenders("e > c", "

e > c

") def test_inline_html_backslashes(self): self.assertMarkdownRenders('', '

') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1723823708.0 markdown-3.7/tox.ini0000644000175100001770000000214214657673134014144 0ustar00runnerdocker[tox] envlist = py{38, 39, 310, 311, 312}, pypy{38, 39, 310}, pygments, flake8, checkspelling, pep517check, checklinks isolated_build = True [testenv] extras = testing deps = pytidylib allowlist_externals = coverage commands = coverage run --source=markdown -m unittest discover {toxinidir}/tests coverage xml coverage report --show-missing [testenv:pygments] # Run tests with pygments installed (override deps only). setenv = PYGMENTS_VERSION = 2.7.1 deps = pytidylib pygments=={env:PYGMENTS_VERSION} [testenv:flake8] deps = flake8 allowlist_externals = flake8 commands = flake8 {toxinidir}/markdown {toxinidir}/tests skip_install = true [testenv:checkspelling] extras = docs deps = pyspelling commands = {envpython} -m mkdocs build --strict --config-file {toxinidir}/mkdocs.yml {envpython} -m pyspelling --config {toxinidir}/.pyspelling.yml [testenv:checklinks] whitelist_externals = markdown-link-check deps = commands = {toxinidir}/checklinks.sh [testenv:pep517check] deps = pep517 commands = python -m pep517.check {toxinidir} skip_install = true [flake8] max-line-length = 119

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