markdown2-2.3.7/0000755000076500000240000000000013402017660013475 5ustar nickstaff00000000000000markdown2-2.3.7/bin/0000755000076500000240000000000013402017660014245 5ustar nickstaff00000000000000markdown2-2.3.7/bin/markdown20000755000076500000240000000073712240460102016076 0ustar nickstaff00000000000000#!/usr/bin/env python import sys from os.path import join, dirname, exists # Use the local markdown2.py if we are in the source tree. source_tree_markdown2 = join(dirname(__file__), "..", "lib", "markdown2.py") if exists(source_tree_markdown2): sys.path.insert(0, dirname(source_tree_markdown2)) try: from markdown2 import main finally: del sys.path[0] else: from markdown2 import main if __name__ == "__main__": sys.exit( main(sys.argv) ) markdown2-2.3.7/CHANGES.md0000644000076500000240000004574213402017423015100 0ustar nickstaff00000000000000# python-markdown2 Changelog ## python-markdown2 2.3.7 - [pull #306] Drop support for legacy Python versions - [pull #307] Fix syntax highlighting test cases that depend on Pygments output - [pull #308] Add support for Python 3.7 - [pull #304] Add Wheel package support - [pull #312] Fix toc_depth initialization regression - [pull #315] XSS fix ## python-markdown2 2.3.6 - [pull #282] Add TOC depth option - [pull #283] Fix to add TOC html to output via CLI - [pull #284] Do not remove anchors in safe_mode - [pull #288] fixing cuddled-lists with a single list item - [pull #292] Fix Wrong rendering of last list element - [pull #295] link-patterns fix - [pull #300] Replace a deprecated method - [pull #301] DeprecationWarning: invalid escape sequence - [pull #302] Fix "make test" in Python 3 - [pull #303] Fix CVE-2018-5773 ## python-markdown2 2.3.5 - [pull #238] Fenced code blocks lang with leading space - [pull #260] Search for items only within metadata header - [pull #264] highlightjs language class support - [pull #265] FIPS compliance - [pull #274] Fix for double amp replacement inside link title ## python-markdown2 2.3.4 - [pull #243] task list extra visual changes - [pull #245] Don't let "target-blank-lines" break footnotes - [pull #247] Translatable footnote titles - [pull #252] Add pipe escaping in table extension ## python-markdown2 2.3.3 - [pull #236] Fix for safe_mode links regression - [pull #235] Fix for overgreedy regex in metadata - [pull #237] Fix for header-ids extra non-alpha character issue ## python-markdown2 2.3.2 - [pull #204] toc extra Python 3 error - [pull #207] Performance improvements - [pull #210] Leading paragraph with fenced code blocks - [pull #212] Target blank links extra - [pull #215] Optional metadata fences - [pull #218] Github style task list - [pull #220] Numbering extra - [pull #224] Metadata in blocks - [pull #230] safe_mode changes ## python-markdown2 2.3.1 - [pull #131] Markdown "spoiler" extra - [pull #170] html-classes support for table tags - [pull #190] "strike" extra - [pull #201] Allow empty table cells ## python-markdown2 2.3.0 - New "tables" extra for table syntax that matches GFM and PHP-Markdown Extra . For example: | Header 1 | *Header* 2 | | -------- | -------- | | `Cell 1` | [Cell 2](http://example.com) link | | Cell 3 | **Cell 4** | See for examples and edge cases. If you have documents using the 'wiki-tables' syntax and want to convert to the 'tables' syntax, there is a script to help with that here: ## python-markdown2 2.2.3 - [issue #165] Fix an edge case in list parsing. ## python-markdown2 2.2.2 - [pull #156] Footnotes XML compatibility. - [pull #157] Horizontal rule minimum length. - [pull #162] Fix escaping fenced code block with safe mode - [pull #163] Fix code highlight with safe mode ## python-markdown2 2.2.1 - [issue #142 pull #141] Fix parentheses and spaces in urls. - [issue #88 issue #95 pull #145] Fix code blocks in code blocks with syntax highlighting. - [issue #113 issue #127 via pull #144] Fix fenced-code-blocks html and code output. - [pull #133] Unify the -/= and ## style headers and fix TOC order - [pull #146] tag-friendly extra to require that atx headers have a space after # ## python-markdown2 2.2.0 - [issue #135] Fix fenced code blocks odd rendering. - [pull #138] specify shell in Makefile - [pull #130] break-on-newline extra - [pull #140] Allow html-classes for img - [pull #122] Allow parentheses in urls ## python-markdown2 2.1.0 - ["nofollow" extra, issue #74, pull #104] Add `rel="nofollow"` support (mostly by https://github.com/cdman): $ echo '[link](http://example)' | markdown2 -x nofollow

link

Limitation: This *can* add a duplicate 'rel' attribute to raw HTML links in the input. ## python-markdown2 2.0.1 - ["toc" extra] Unescape Markdown special chars in TOC entries. See . - Now 'tox' testing support (by github.com/msabramo): [sudo] pip install tox tox confirming that markdown2 works with jython (not sure which version) and pypy! Also added pypy to travis-ci testing (http://travis-ci.org/#!/trentm/python-markdown2). ## python-markdown2 2.0.0 - [issue #90] Add a `Markdown.preprocess(text) -> text` hook for subclasses. This is a match for the `Markdown.postprocess(text) -> text` hook added in an earlier version. (by @joestump). - [issue #90, backward incompatible change] Require a space between the '#' and a text for a title. I.e.: # This still works #This doesn't work ##Nor this This keeps comments, hash tags, and ticket numbers at the beginning of the line from turning into an h1. (by @joestump) This is a backward incompatible change, however small, hence the version change to 2.0.0. ## python-markdown2 1.4.2 - [issue #84, issue #87] Fix problems with fenced-code-blocks getting double-processed. ## python-markdown2 1.4.1 - [issue #67] Fix an sub-`ul` inside a `ol` not working with an indent less than 4 spaces. - Fix code blocks and fenced-code-blocks to work with a single leading newline at the start of the input. - [issue #86, 'fenced-code-blocks' extra] Fix fenced code blocks not being parsed out before other syntax elements, like headers. - [issue #83, 'fenced-code-blocks' and 'code-color' extras] Allow 'cssclass' code coloring option (passed to pygments) to be overridden (by https://github.com/kaishaku). E.g.: import markdown2 html = markdown2.markdown(text, extras={'fenced-code-blocks': {'cssclass': 'mycode'}}) ## python-markdown2 1.4.0 - [issue #64] Python 3 support! markdown2.py supports Python 2 and 3 in the same file without requiring install-time 2to3 transformation. ## python-markdown2 1.3.1 - [issue #80] Jython 2.2.1 support fix (by github.com/clach04) ## python-markdown2 1.3.0 - Deprecate `code-color` extra. Use the `fenced-code-block` extra and its cleaner mechanism for specifying the language, instead. This extra will be removed in v2.0 or so. - New `fenced-code-blocks` extra. It allows a code block to not have to be indented by fencing it with '```' on a line before and after. Based on [GFM](hi

Thanks Ryan! - Drop this "1.0.1.*" version silliness. The idea *was* that the first three numbers tracked the Markdown.pl on which markdown2.py was originally based. I don't believe Markdown.pl really gets releases anymore tho, so pointless. ## python-markdown2 1.0.1.19 - [Issue 66] Add "wiki-tables" extra for Google Code Wiki-style tables. See . ## python-markdown2 1.0.1.18 - [Issue 57] Add html5 block tags (article, section, aside, et al; see "_html5tags" variable) to Markdown literal HTML block tag handling. Thanks Tim Gray! - [Issue 56] Fix `setup.py install`. - [Issue 54] Fix escaping of link title attributes. Thanks FND! - Tweak list matching to NOT make a ul for something like this: - - - - - hi there Before this change this would be a silly 5-deep nested li. See "not_quite_a_list" test case. - [Issue 52] Fix potential pathologically slow matching for `
` markdown ("slow_hr" test case). - Add a `Markdown.postprocess(text) -> text` hook that is called near the end of markdown conversion. By default this does no transformation. It is called just before unescaping of special characters and unhashing of literal HTML blocks. - ["header-ids" and "toc" extras] Add "n" argument to `Markdown.header_id_from_text` hook. This allows a subclass using this hook to differentiate the header id based on the hN number (e.g. h1 diff that h2). Also allow a `None` return value to not add an id to that header (and exclude that header from the TOC). Note: If you used this hook, this is an incompatible change to the call signature. - Add a "markdown-in-html" extra similar to (but limited) . I.e. this:
Yo **yo**!
becomes:
Yo yo!
- [Issue 39] Test case fix for pygments 1.3.1 from thomas.moschny. - [Issue 42] Add "smarty-pants" extra for transforming plain ASCII punctuation characters into smart typographic punctuation HTML entities. Inspiration: Implementation by Nikhil Chelliah. Also add `\'` and `\"` escape sequences for forcing dumb quotes when this extra is in use. - Guard against using `True` instead of `None` as follows `markdown(..., extras={'header-ids': True})`. `None` is wanted, but `True` is commonly (at least I did it twice) used. ## python-markdown2 1.0.1.17 - [Issue 36] Fix "cuddled-lists" extra handling for an looks-like-a-cuddled-list-but-is-indented block. See the "test/tm-cases/cuddled_list_indented.text" test case. - Experimental new "toc" extra. The returned string from conversion will have a `toc_html` attribute. - New "header-ids" extra that will add an `id` attribute to headers: # My First Section will become:

My First Section

An argument can be give for the extra, which will be used as a prefix for the ids: $ cat foo.txt # hi there $ python markdown2.py foo.txt

hi there

$ python markdown2.py foo.txt -x header-ids

hi there

$ python markdown2.py foo.txt -x header-ids=prefix

hi there

- Preliminary support for "html-classes" extra: takes a dict mapping HTML tag to the string value to use for a "class" attribute for that emitted tag. Currently just supports "pre" and "code" for code *blocks*. ## python-markdown2 1.0.1.16 - [Issue 33] Implement a "cuddled-lists" extra that allows: I did these things: * bullet1 * bullet2 * bullet3 to be converted to:

I did these things:

  • bullet1
  • bullet2
  • bullet3
## python-markdown2 1.0.1.15 - [Issue 30] Fix a possible XSS via JavaScript injection in a carefully crafted image reference (usage of double-quotes in the URL). ## python-markdown2 1.0.1.14 - [Issue 29] Fix security hole in the md5-hashing scheme for handling HTML chunks during processing. - [Issue 27] Fix problem with underscores in footnotes content (with "footnotes" extra). ## python-markdown2 1.0.1.13 - [Issue 24] Set really long sentinel for max-length of link text to avoid problems with reasonably long ones. - [Issue 26] Complete the fix for this issue. Before this change the randomized obscuring of 'mailto:' link letters would sometimes result in emails with underscores getting misinterpreted as for italics. ## python-markdown2 1.0.1.12 - [Issue 26] Fix bug where email auto linking wouldn't work for emails with underscores. E.g. `Mail me: ` wouldn't work. - Update MANIFEST.in to ensure bin/markdown2 gets included in sdist. - [Issue 23] Add support for passing options to pygments for the "code-color" extra. For example: >>> markdown("...", extras={'code-color': {"noclasses": True}}) This `formatter_opts` dict is passed to the pygments HtmlCodeFormatter. Patch from 'svetlyak.40wt'. - [Issue 21] Escape naked '>' characters, as is already done for '&' and '<' characters. Note that other markdown implementations (both Perl and PHP) do *not* do this. This results in differing output with two 3rd-party tests: "php-markdown-cases/Backslash escapes.text" and "markdowntest-cases/Amps and angle encoding.tags". - "link-patterns" extra: Add support for the href replacement being a callable, e.g.: >>> link_patterns = [ ... (re.compile("PEP\s+(\d+)", re.I), ... lambda m: "http://www.python.org/dev/peps/pep-%04d/" % int(m.group(1))), ... ] >>> markdown2.markdown("Here is PEP 42.", extras=["link-patterns"], ... link_patterns=link_patterns) u'

Here is PEP 42.

\n' ## python-markdown2 1.0.1.11 - Fix syntax_color test for the latest Pygments. - [Issue 20] Can't assume that `sys.argv` is defined at top-level code -- e.g. when used at a PostreSQL stored procedure. Fix that. ## python-markdown2 1.0.1.10 - Fix sys.path manipulation in setup.py so `easy_install markdown2-*.tar.gz` works. (Henry Precheur pointed out the problem.) - "bin/markdown2" is now a stub runner script rather than a symlink to "lib/markdown2.py". The symlink was a problem for sdist: tar makes it a copy. - Added 'xml' extra: passes *one-liner* XML processing instructions and namespaced XML tags without wrapping in a `

` -- i.e. treats them as a HTML block tag. ## python-markdown2 1.0.1.9 - Fix bug in processing text with two HTML comments, where the first comment is cuddled to other content. See "test/tm-cases/two_comments.text". Noted by Wolfgang Machert. - Revert change in v1.0.1.6 passing XML processing instructions and one-liner tags. This changed caused some bugs. Similar XML processing support will make it back via an "xml" extra. ## python-markdown2 1.0.1.8 - License note updates to facilitate Thomas Moschny building a package for Fedora Core Linux. No functional change. ## python-markdown2 1.0.1.7 - Add a proper setup.py and release to pypi: http://pypi.python.org/pypi/markdown2/ - Move markdown2.py module to a lib subdir. This allows one to put the "lib" dir of a source checkout (e.g. via an svn:externals) on ones Python Path without have the .py files at the top-level getting in the way. ## python-markdown2 1.0.1.6 - Fix Python 2.6 deprecation warning about the `md5` module. - Pass XML processing instructions and one-liner tags. For example: Limitations: they must be on one line. Test: pi_and_xinclude. Suggested by Wolfgang Machert. ## python-markdown2 1.0.1.5 - Add ability for 'extras' to have arguments. Internally the 'extras' attribute of the Markdown class is a dict (it was a set). - Add "demote-headers" extra that will demote the markdown for, e.g., an h1 to h2-6 by the number of the demote-headers argument. >>> markdown('# this would be an h1', extras={'demote-headers': 2}) u'

this would be an h1

\n' This can be useful for user-supplied Markdown content for a sub-section of a page. ## python-markdown2 1.0.1.4 - [Issue 18] Allow spaces in the URL for link definitions. - [Issue 15] Fix some edge cases with backslash-escapes. - Fix this error that broken command-line usage: NameError: global name 'use_file_vars' is not defined - Add "pyshell" extra for auto-codeblock'ing Python interactive shell sessions even if they weren't properly indented by the tab width. ## python-markdown2 1.0.1.3 - Make the use of the `-*- markdown-extras: ... -*-` emacs-style files variable to set "extras" **off** be default. It can be turned on via `--use-file-vars` on the command line and `use_file_vars=True` via the module interface. - [Issue 3] Drop the code-color extra hack added *for* issue3 that was causing the a unicode error with unicode in a code-colored block, ## python-markdown2 1.0.1.2 - [Issue 8] Alleviate some of the incompat of the last change by allowing (at the Python module level) the usage of `safe_mode=True` to mean what it used to -- i.e. "replace" safe mode. - [Issue 8, **incompatible change**] The "-s|--safe" command line option and the equivalent "safe_mode" option has changed semantics to be a string instead of a boolean. Legal values of the string are "replace" (the old behaviour: literal HTML is replaced with "[HTML_REMOVED]") and "escape" (meta chars in literal HTML is escaped). - [Issue 11] Process markup in footnote definition bodies. - Add support for `-*- markdown-extras: ... -*-` emacs-style files variables (typically in an XML comment) to set "extras" for the markdown conversion. - [Issue 6] Fix problem with footnotes if the reference string had uppercase letters. ## python-markdown2 1.0.1.1 - [Issue 3] Fix conversion of unicode strings. - Make the "safe_mode" replacement test overridable via subclassing: change `Markdown.html_removed_text`. - [Issue 2] Fix problems with "safe_mode" removing generated HTML, instead of just raw HTML in the text. - Add "-s|--safe" command-line option to set "safe_mode" conversion boolean. This option is mainly for compat with markdown.py. - Add "link-patterns" extra: allows one to specify a list of regexes that should be automatically made into links. For example, one can define a mapping for things like "Mozilla Bug 1234": regex: mozilla\s+bug\s+(\d+) href: http://bugzilla.mozilla.org/show_bug.cgi?id=\1 See for details. - Add a "MarkdownWithExtras" class that enables all extras (except "code-friendly"): >>> import markdown2 >>> converter = markdown2.MarkdownWithExtras() >>> converter.convert('...TEXT...') ...HTML... - [Issue 1] Added "code-color" extra: pygments-based (TODO: link) syntax coloring of code blocks. Requires the pygments Python library on sys.path. See for details. - [Issue 1] Added "footnotes" extra: adds support for footnotes syntax. See for details. ## python-markdown2 1.0.1.0 - Added "code-friendly" extra: disables the use of leading and trailing `_` and `__` for emphasis and strong. These can easily get in the way when writing docs about source code with variable_list_this and when one is not careful about quoting. - Full basic Markdown syntax. (Started maintaining this log 15 Oct 2007. At that point there had been no releases of python-markdown2.) markdown2-2.3.7/CONTRIBUTORS.txt0000644000076500000240000000306213347747771016221 0ustar nickstaff00000000000000Nicholas Serra (github.com/nicholasserra, primary maintainer) Trent Mick (github.com/trentm, original author) Thomas Moschny (redhat packaging, https://bugzilla.redhat.com/show_bug.cgi?id=461692) Massimo Di Pierro (security fix, issue #29) Nikhil Chelliah ("smarty-pants" extra, issue #42) Tim Gray (html5 block tags, issue #57) Ryan Doenges (github.com/rhdoenges, filter CLI, issue #72) slomo (github.com/slomo, metadata extra, issue #78) Joe Stump (@joestump, pull #90) msabramo (github.com/msabramo, tox test setup) Attila-Mihaly Balazs (github.com/cdman) Taylan Aydinli (github.com/vape, pull #140) Joseph Turner (github.com/josephturnerjr, pull #122) Malcolm Rowe (github.com/malcolmr) Lukáš Pohlreich (github.com/polarkac) Devvyn Murphy (github.com/devvynm) Neo (github.com/neo5simple) Adam Labbe (github.com/adamatom) Marios Zindilis (github.com/marios-zindilis) keysona (github.com/keysona) nkanaev (github.com/nkanaev) liguangsheng (github.com/liguangsheng) ewankirk (github.com/ewankirk) Oz N Tiram (github.com/oz123) Alan Hamlett (github.com/alanhamlett) Stein Strindhaug (github.com/strindhaug) David Lowry-Duda (github.com/davidowryduda) neo5anderson (github.com/neo5anderson) cosven (github.com/cosven) David D Lowe (github.com/Flimm) Lapshin Dmitry (github.com/LDVSOFT) rox (github.com/roxma) Matthew Howle (github.com/mdhowle) Chris Riedl (github.com/wrwlf) Shaun Brady (github.com/shaunbrady) MattX (github.com/MattX) Denis Ivanov (github.com/tetafro) Hassan Magdy Saad (github.com/hmagdy) Christian Klus (github.com/kluchrj) Tsuyoshi Hombashi (github.com/thombashi) markdown2-2.3.7/lib/0000755000076500000240000000000013402017660014243 5ustar nickstaff00000000000000markdown2-2.3.7/lib/markdown2.egg-info/0000755000076500000240000000000013402017660017641 5ustar nickstaff00000000000000markdown2-2.3.7/lib/markdown2.egg-info/dependency_links.txt0000644000076500000240000000000113402017660023707 0ustar nickstaff00000000000000 markdown2-2.3.7/lib/markdown2.egg-info/PKG-INFO0000644000076500000240000000337113402017660020742 0ustar nickstaff00000000000000Metadata-Version: 1.1 Name: markdown2 Version: 2.3.7 Summary: A fast and complete Python implementation of Markdown Home-page: https://github.com/trentm/python-markdown2 Author: Trent Mick Author-email: trentm@gmail.com License: MIT Description: markdown2: A fast and complete Python implementation of Markdown. Markdown is a text-to-HTML filter; it translates an easy-to-read / easy-to-write structured text format into HTML. Markdown's text format is most similar to that of plain text email, and supports features such as headers, *emphasis*, code blocks, blockquotes, and links. -- http://daringfireball.net/projects/markdown/ This is a fast and complete Python implementation of the Markdown spec. See http://github.com/trentm/python-markdown2 for more info. Platform: any Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Operating System :: OS Independent Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Software Development :: Documentation Classifier: Topic :: Text Processing :: Filters Classifier: Topic :: Text Processing :: Markup :: HTML markdown2-2.3.7/lib/markdown2.egg-info/SOURCES.txt0000644000076500000240000003306613402017660021535 0ustar nickstaff00000000000000CHANGES.md CONTRIBUTORS.txt LICENSE.txt MANIFEST.in Makefile TODO.txt setup.cfg setup.py bin/markdown2 lib/markdown2.py lib/markdown2.egg-info/PKG-INFO lib/markdown2.egg-info/SOURCES.txt lib/markdown2.egg-info/dependency_links.txt lib/markdown2.egg-info/top_level.txt test/api.doctests test/test.py test/test_markdown2.py test/testall.py test/testlib.py test/tm-cases/CVE-2018-5773.html test/tm-cases/CVE-2018-5773.opts test/tm-cases/CVE-2018-5773.text test/tm-cases/ampersands.html test/tm-cases/ampersands.tags test/tm-cases/ampersands.text test/tm-cases/auto_link.html test/tm-cases/auto_link.text test/tm-cases/auto_link_email_with_underscore.html test/tm-cases/auto_link_email_with_underscore.tags test/tm-cases/auto_link_email_with_underscore.text test/tm-cases/auto_link_safe_mode.html test/tm-cases/auto_link_safe_mode.opts test/tm-cases/auto_link_safe_mode.tags test/tm-cases/auto_link_safe_mode.text test/tm-cases/basic_safe_mode.html test/tm-cases/basic_safe_mode.opts test/tm-cases/basic_safe_mode.tags test/tm-cases/basic_safe_mode.text test/tm-cases/basic_safe_mode_escape.html test/tm-cases/basic_safe_mode_escape.opts test/tm-cases/basic_safe_mode_escape.tags test/tm-cases/basic_safe_mode_escape.text test/tm-cases/blockquote.html test/tm-cases/blockquote.text test/tm-cases/blockquote_with_pre.html test/tm-cases/blockquote_with_pre.text test/tm-cases/break_on_newline.html test/tm-cases/break_on_newline.opts test/tm-cases/break_on_newline.text test/tm-cases/code_block_with_tabs.html test/tm-cases/code_block_with_tabs.tags test/tm-cases/code_block_with_tabs.text test/tm-cases/code_blocks_leading_line.html test/tm-cases/code_blocks_leading_line.text test/tm-cases/code_safe_emphasis.html test/tm-cases/code_safe_emphasis.opts test/tm-cases/code_safe_emphasis.tags test/tm-cases/code_safe_emphasis.text test/tm-cases/codeblock.html test/tm-cases/codeblock.text test/tm-cases/codespans.html test/tm-cases/codespans.text test/tm-cases/codespans_safe_mode.html test/tm-cases/codespans_safe_mode.opts test/tm-cases/codespans_safe_mode.tags test/tm-cases/codespans_safe_mode.text test/tm-cases/cuddled_list_indented.html test/tm-cases/cuddled_list_indented.opts test/tm-cases/cuddled_list_indented.tags test/tm-cases/cuddled_list_indented.text test/tm-cases/cuddled_para_and_list.html test/tm-cases/cuddled_para_and_list.opts test/tm-cases/cuddled_para_and_list.tags test/tm-cases/cuddled_para_and_list.text test/tm-cases/cuddled_with_para.html test/tm-cases/cuddled_with_para.text test/tm-cases/demote_headers.html test/tm-cases/demote_headers.opts test/tm-cases/demote_headers.text test/tm-cases/emacs_head_vars.html test/tm-cases/emacs_head_vars.opts test/tm-cases/emacs_head_vars.tags test/tm-cases/emacs_head_vars.text test/tm-cases/emacs_tail_vars.html test/tm-cases/emacs_tail_vars.opts test/tm-cases/emacs_tail_vars.tags test/tm-cases/emacs_tail_vars.text test/tm-cases/emphasis.html test/tm-cases/emphasis.text test/tm-cases/escapes.html test/tm-cases/escapes.tags test/tm-cases/escapes.text test/tm-cases/fenced_code_blocks_issue113.html test/tm-cases/fenced_code_blocks_issue113.opts test/tm-cases/fenced_code_blocks_issue113.tags test/tm-cases/fenced_code_blocks_issue113.text test/tm-cases/fenced_code_blocks_issue127.html test/tm-cases/fenced_code_blocks_issue127.opts test/tm-cases/fenced_code_blocks_issue127.tags test/tm-cases/fenced_code_blocks_issue127.text test/tm-cases/fenced_code_blocks_issue135.html test/tm-cases/fenced_code_blocks_issue135.opts test/tm-cases/fenced_code_blocks_issue135.tags test/tm-cases/fenced_code_blocks_issue135.text test/tm-cases/fenced_code_blocks_issue161.html test/tm-cases/fenced_code_blocks_issue161.opts test/tm-cases/fenced_code_blocks_issue161.tags test/tm-cases/fenced_code_blocks_issue161.text test/tm-cases/fenced_code_blocks_issue86.html test/tm-cases/fenced_code_blocks_issue86.opts test/tm-cases/fenced_code_blocks_issue86.tags test/tm-cases/fenced_code_blocks_issue86.text test/tm-cases/fenced_code_blocks_leading_lang_space.html test/tm-cases/fenced_code_blocks_leading_lang_space.opts test/tm-cases/fenced_code_blocks_leading_lang_space.tags test/tm-cases/fenced_code_blocks_leading_lang_space.text test/tm-cases/fenced_code_blocks_leading_line.html test/tm-cases/fenced_code_blocks_leading_line.opts test/tm-cases/fenced_code_blocks_leading_line.tags test/tm-cases/fenced_code_blocks_leading_line.text test/tm-cases/fenced_code_blocks_leading_paragraph.html test/tm-cases/fenced_code_blocks_leading_paragraph.opts test/tm-cases/fenced_code_blocks_leading_paragraph.tags test/tm-cases/fenced_code_blocks_leading_paragraph.text test/tm-cases/fenced_code_blocks_safe_highlight.html test/tm-cases/fenced_code_blocks_safe_highlight.opts test/tm-cases/fenced_code_blocks_safe_highlight.tags test/tm-cases/fenced_code_blocks_safe_highlight.text test/tm-cases/fenced_code_blocks_simple.html test/tm-cases/fenced_code_blocks_simple.opts test/tm-cases/fenced_code_blocks_simple.tags test/tm-cases/fenced_code_blocks_simple.text test/tm-cases/fenced_code_blocks_syntax_highlighting.html test/tm-cases/fenced_code_blocks_syntax_highlighting.opts test/tm-cases/fenced_code_blocks_syntax_highlighting.tags test/tm-cases/fenced_code_blocks_syntax_highlighting.text test/tm-cases/fenced_code_blocks_syntax_indentation.html test/tm-cases/fenced_code_blocks_syntax_indentation.opts test/tm-cases/fenced_code_blocks_syntax_indentation.tags test/tm-cases/fenced_code_blocks_syntax_indentation.text test/tm-cases/footnotes.html test/tm-cases/footnotes.opts test/tm-cases/footnotes.text test/tm-cases/footnotes_custom.html test/tm-cases/footnotes_custom.opts test/tm-cases/footnotes_custom.text test/tm-cases/footnotes_letters.html test/tm-cases/footnotes_letters.opts test/tm-cases/footnotes_letters.tags test/tm-cases/footnotes_letters.text test/tm-cases/footnotes_markup.html test/tm-cases/footnotes_markup.opts test/tm-cases/footnotes_markup.tags test/tm-cases/footnotes_markup.text test/tm-cases/footnotes_safe_mode_escape.html test/tm-cases/footnotes_safe_mode_escape.opts test/tm-cases/footnotes_safe_mode_escape.tags test/tm-cases/footnotes_safe_mode_escape.text test/tm-cases/footnotes_underscores.html test/tm-cases/footnotes_underscores.opts test/tm-cases/footnotes_underscores.tags test/tm-cases/footnotes_underscores.text test/tm-cases/header.html test/tm-cases/header.text test/tm-cases/header_atx_no_preceeding_space.html test/tm-cases/header_atx_no_preceeding_space.text test/tm-cases/header_ids_1.html test/tm-cases/header_ids_1.opts test/tm-cases/header_ids_1.tags test/tm-cases/header_ids_1.text test/tm-cases/header_ids_2.html test/tm-cases/header_ids_2.opts test/tm-cases/header_ids_2.tags test/tm-cases/header_ids_2.text test/tm-cases/header_ids_3.html test/tm-cases/header_ids_3.opts test/tm-cases/header_ids_3.tags test/tm-cases/header_ids_3.text test/tm-cases/header_ids_4.html test/tm-cases/header_ids_4.opts test/tm-cases/header_ids_4.tags test/tm-cases/header_ids_4.text test/tm-cases/header_ids_5.html test/tm-cases/header_ids_5.opts test/tm-cases/header_ids_5.tags test/tm-cases/header_ids_5.text test/tm-cases/headers_tag_friendly.html test/tm-cases/headers_tag_friendly.opts test/tm-cases/headers_tag_friendly.tags test/tm-cases/headers_tag_friendly.text test/tm-cases/highlightjs_lang.html test/tm-cases/highlightjs_lang.opts test/tm-cases/highlightjs_lang.tags test/tm-cases/highlightjs_lang.text test/tm-cases/hr.html test/tm-cases/hr.text test/tm-cases/hr_length.html test/tm-cases/hr_length.text test/tm-cases/hr_spaces.html test/tm-cases/hr_spaces.text test/tm-cases/html5_block_tags.html test/tm-cases/html5_block_tags.tags test/tm-cases/html5_block_tags.text test/tm-cases/html_classes.html test/tm-cases/html_classes.opts test/tm-cases/html_classes.tags test/tm-cases/html_classes.text test/tm-cases/img_in_link.html test/tm-cases/img_in_link.text test/tm-cases/incorrect_list_parse.html test/tm-cases/incorrect_list_parse.tags test/tm-cases/incorrect_list_parse.text test/tm-cases/inline_links.html test/tm-cases/inline_links.text test/tm-cases/issue21_gt_escaping.html test/tm-cases/issue21_gt_escaping.opts test/tm-cases/issue21_gt_escaping.tags test/tm-cases/issue21_gt_escaping.text test/tm-cases/issue2_safe_mode_borks_markup.html test/tm-cases/issue2_safe_mode_borks_markup.opts test/tm-cases/issue2_safe_mode_borks_markup.tags test/tm-cases/issue2_safe_mode_borks_markup.text test/tm-cases/issue3_bad_code_color_hack.html test/tm-cases/issue3_bad_code_color_hack.opts test/tm-cases/issue3_bad_code_color_hack.tags test/tm-cases/issue3_bad_code_color_hack.text test/tm-cases/issue52_hang.html test/tm-cases/issue52_hang.tags test/tm-cases/issue52_hang.text test/tm-cases/issue54_escape_link_title.html test/tm-cases/issue54_escape_link_title.tags test/tm-cases/issue54_escape_link_title.text test/tm-cases/link_defn_alt_title_delims.html test/tm-cases/link_defn_alt_title_delims.text test/tm-cases/link_defn_spaces_in_url.html test/tm-cases/link_defn_spaces_in_url.tags test/tm-cases/link_defn_spaces_in_url.text test/tm-cases/link_nofollow.html test/tm-cases/link_nofollow.opts test/tm-cases/link_nofollow.tags test/tm-cases/link_nofollow.text test/tm-cases/link_patterns.html test/tm-cases/link_patterns.opts test/tm-cases/link_patterns.text test/tm-cases/link_patterns_double_hit.html test/tm-cases/link_patterns_double_hit.opts test/tm-cases/link_patterns_double_hit.tags test/tm-cases/link_patterns_double_hit.text test/tm-cases/link_patterns_edge_cases.html test/tm-cases/link_patterns_edge_cases.opts test/tm-cases/link_patterns_edge_cases.tags test/tm-cases/link_patterns_edge_cases.text test/tm-cases/link_patterns_markdown_syntax.html test/tm-cases/link_patterns_markdown_syntax.opts test/tm-cases/link_patterns_markdown_syntax.text test/tm-cases/link_safe_urls.html test/tm-cases/link_safe_urls.opts test/tm-cases/link_safe_urls.tags test/tm-cases/link_safe_urls.text test/tm-cases/link_with_blank.html test/tm-cases/link_with_blank.opts test/tm-cases/link_with_blank.tags test/tm-cases/link_with_blank.text test/tm-cases/lists.html test/tm-cases/lists.text test/tm-cases/lists2.html test/tm-cases/lists2.tags test/tm-cases/lists2.text test/tm-cases/long_link.html test/tm-cases/long_link.tags test/tm-cases/long_link.text test/tm-cases/markdown_in_html.html test/tm-cases/markdown_in_html.opts test/tm-cases/markdown_in_html.tags test/tm-cases/markdown_in_html.text test/tm-cases/metadata.html test/tm-cases/metadata.opts test/tm-cases/metadata.tags test/tm-cases/metadata.text test/tm-cases/metadata2.html test/tm-cases/metadata2.opts test/tm-cases/metadata2.tags test/tm-cases/metadata2.text test/tm-cases/mismatched_footnotes.html test/tm-cases/mismatched_footnotes.opts test/tm-cases/mismatched_footnotes.text test/tm-cases/missing_link_defn.html test/tm-cases/missing_link_defn.text test/tm-cases/nested_list.html test/tm-cases/nested_list.text test/tm-cases/nested_list_safe_mode.html test/tm-cases/nested_list_safe_mode.opts test/tm-cases/nested_list_safe_mode.tags test/tm-cases/nested_list_safe_mode.text test/tm-cases/not_quite_a_list.html test/tm-cases/not_quite_a_list.text test/tm-cases/numbering.html test/tm-cases/numbering.opts test/tm-cases/numbering.text test/tm-cases/parens_in_url_4.html test/tm-cases/parens_in_url_4.tags test/tm-cases/parens_in_url_4.text test/tm-cases/pi_and_xinclude.html test/tm-cases/pi_and_xinclude.opts test/tm-cases/pi_and_xinclude.tags test/tm-cases/pi_and_xinclude.text test/tm-cases/pyshell.html test/tm-cases/pyshell.opts test/tm-cases/pyshell.text test/tm-cases/raw_html.html test/tm-cases/raw_html.text test/tm-cases/ref_links.html test/tm-cases/ref_links.text test/tm-cases/smarty_pants.html test/tm-cases/smarty_pants.opts test/tm-cases/smarty_pants.tags test/tm-cases/smarty_pants.text test/tm-cases/smarty_pants_image_links.html test/tm-cases/smarty_pants_image_links.opts test/tm-cases/smarty_pants_image_links.tags test/tm-cases/smarty_pants_image_links.text test/tm-cases/spoiler.html test/tm-cases/spoiler.opts test/tm-cases/spoiler.text test/tm-cases/strike.html test/tm-cases/strike.opts test/tm-cases/strike.tags test/tm-cases/strike.text test/tm-cases/sublist-ordered-para.html test/tm-cases/sublist-ordered-para.tags test/tm-cases/sublist-ordered-para.text test/tm-cases/sublist-para.html test/tm-cases/sublist-para.tags test/tm-cases/sublist-para.text test/tm-cases/syntax_color.html test/tm-cases/syntax_color.opts test/tm-cases/syntax_color.tags test/tm-cases/syntax_color.text test/tm-cases/syntax_color_opts.html test/tm-cases/syntax_color_opts.opts test/tm-cases/syntax_color_opts.tags test/tm-cases/syntax_color_opts.text test/tm-cases/tables.html test/tm-cases/tables.opts test/tm-cases/tables.tags test/tm-cases/tables.text test/tm-cases/task_list.html test/tm-cases/task_list.opts test/tm-cases/task_list.tags test/tm-cases/task_list.text test/tm-cases/toc_1.html test/tm-cases/toc_1.opts test/tm-cases/toc_1.tags test/tm-cases/toc_1.text test/tm-cases/toc_2.html test/tm-cases/toc_2.opts test/tm-cases/toc_2.tags test/tm-cases/toc_2.text test/tm-cases/toc_3.html test/tm-cases/toc_3.opts test/tm-cases/toc_3.tags test/tm-cases/toc_3.text test/tm-cases/toc_4.html test/tm-cases/toc_4.opts test/tm-cases/toc_4.tags test/tm-cases/toc_4.text test/tm-cases/toc_5.html test/tm-cases/toc_5.opts test/tm-cases/toc_5.tags test/tm-cases/toc_5.text test/tm-cases/toc_depth.html test/tm-cases/toc_depth.opts test/tm-cases/toc_depth.tags test/tm-cases/toc_depth.text test/tm-cases/tricky_anchors.html test/tm-cases/tricky_anchors.text test/tm-cases/two_comments.html test/tm-cases/two_comments.text test/tm-cases/underline_in_autolink.html test/tm-cases/underline_in_autolink.text test/tm-cases/wiki_tables.html test/tm-cases/wiki_tables.opts test/tm-cases/wiki_tables.tags test/tm-cases/wiki_tables.text test/tm-cases/xss_quotes.html test/tm-cases/xss_quotes.tags test/tm-cases/xss_quotes.textmarkdown2-2.3.7/lib/markdown2.egg-info/top_level.txt0000644000076500000240000000001213402017660022364 0ustar nickstaff00000000000000markdown2 markdown2-2.3.7/lib/markdown2.py0000755000076500000240000032530413402017423016530 0ustar nickstaff00000000000000#!/usr/bin/env python # Copyright (c) 2012 Trent Mick. # Copyright (c) 2007-2008 ActiveState Corp. # License: MIT (http://www.opensource.org/licenses/mit-license.php) r"""A fast and complete Python implementation of Markdown. [from http://daringfireball.net/projects/markdown/] > Markdown is a text-to-HTML filter; it translates an easy-to-read / > easy-to-write structured text format into HTML. Markdown's text > format is most similar to that of plain text email, and supports > features such as headers, *emphasis*, code blocks, blockquotes, and > links. > > Markdown's syntax is designed not as a generic markup language, but > specifically to serve as a front-end to (X)HTML. You can use span-level > HTML tags anywhere in a Markdown document, and you can use block level > HTML tags (like
and as well). Module usage: >>> import markdown2 >>> markdown2.markdown("*boo!*") # or use `html = markdown_path(PATH)` u'

boo!

\n' >>> markdowner = Markdown() >>> markdowner.convert("*boo!*") u'

boo!

\n' >>> markdowner.convert("**boom!**") u'

boom!

\n' This implementation of Markdown implements the full "core" syntax plus a number of extras (e.g., code syntax coloring, footnotes) as described on . """ cmdln_desc = """A fast and complete Python implementation of Markdown, a text-to-HTML conversion tool for web writers. Supported extra syntax options (see -x|--extras option below and see for details): * code-friendly: Disable _ and __ for em and strong. * cuddled-lists: Allow lists to be cuddled to the preceding paragraph. * fenced-code-blocks: Allows a code block to not have to be indented by fencing it with '```' on a line before and after. Based on with support for syntax highlighting. * footnotes: Support footnotes as in use on daringfireball.net and implemented in other Markdown processors (tho not in Markdown.pl v1.0.1). * header-ids: Adds "id" attributes to headers. The id value is a slug of the header text. * highlightjs-lang: Allows specifying the language which used for syntax highlighting when using fenced-code-blocks and highlightjs. * html-classes: Takes a dict mapping html tag names (lowercase) to a string to use for a "class" tag attribute. Currently only supports "img", "table", "pre" and "code" tags. Add an issue if you require this for other tags. * link-patterns: Auto-link given regex patterns in text (e.g. bug number references, revision number references). * markdown-in-html: Allow the use of `markdown="1"` in a block HTML tag to have markdown processing be done on its contents. Similar to but with some limitations. * metadata: Extract metadata from a leading '---'-fenced block. See for details. * nofollow: Add `rel="nofollow"` to add `` tags with an href. See . * numbering: Support of generic counters. Non standard extension to allow sequential numbering of figures, tables, equations, exhibits etc. * pyshell: Treats unindented Python interactive shell sessions as blocks. * smarty-pants: Replaces ' and " with curly quotation marks or curly apostrophes. Replaces --, ---, ..., and . . . with en dashes, em dashes, and ellipses. * spoiler: A special kind of blockquote commonly hidden behind a click on SO. Syntax per . * strike: text inside of double tilde is ~~strikethrough~~ * tag-friendly: Requires atx style headers to have a space between the # and the header text. Useful for applications that require twitter style tags to pass through the parser. * tables: Tables using the same format as GFM and PHP-Markdown Extra . * toc: The returned HTML string gets a new "toc_html" attribute which is a Table of Contents for the document. (experimental) * use-file-vars: Look for an Emacs-style markdown-extras file variable to turn on Extras. * wiki-tables: Google Code Wiki-style tables. See . * xml: Passes one-liner processing instructions and namespaced XML tags. """ # Dev Notes: # - Python's regex syntax doesn't have '\z', so I'm using '\Z'. I'm # not yet sure if there implications with this. Compare 'pydoc sre' # and 'perldoc perlre'. __version_info__ = (2, 3, 7) __version__ = '.'.join(map(str, __version_info__)) __author__ = "Trent Mick" import sys import re import logging from hashlib import sha256 import optparse from random import random, randint import codecs from collections import defaultdict try: from urllib import quote_plus except ImportError: from urllib.parse import quote_plus # ---- Python version compat # Use `bytes` for byte strings and `unicode` for unicode strings (str in Py3). if sys.version_info[0] <= 2: py3 = False try: bytes except NameError: bytes = str base_string_type = basestring elif sys.version_info[0] >= 3: py3 = True unicode = str base_string_type = str # ---- globals DEBUG = False log = logging.getLogger("markdown") DEFAULT_TAB_WIDTH = 4 SECRET_SALT = bytes(randint(0, 1000000)) # MD5 function was previously used for this; the "md5" prefix was kept for # backwards compatibility. def _hash_text(s): return 'md5-' + sha256(SECRET_SALT + s.encode("utf-8")).hexdigest()[32:] # Table of hash values for escaped characters: g_escape_table = dict([(ch, _hash_text(ch)) for ch in '\\`*_{}[]()>#+-.!']) # Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin: # http://bumppo.net/projects/amputator/ _AMPERSAND_RE = re.compile(r'&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)') # ---- exceptions class MarkdownError(Exception): pass # ---- public api def markdown_path(path, encoding="utf-8", html4tags=False, tab_width=DEFAULT_TAB_WIDTH, safe_mode=None, extras=None, link_patterns=None, footnote_title=None, footnote_return_symbol=None, use_file_vars=False): fp = codecs.open(path, 'r', encoding) text = fp.read() fp.close() return Markdown(html4tags=html4tags, tab_width=tab_width, safe_mode=safe_mode, extras=extras, link_patterns=link_patterns, footnote_title=footnote_title, footnote_return_symbol=footnote_return_symbol, use_file_vars=use_file_vars).convert(text) def markdown(text, html4tags=False, tab_width=DEFAULT_TAB_WIDTH, safe_mode=None, extras=None, link_patterns=None, footnote_title=None, footnote_return_symbol=None, use_file_vars=False, cli=False): return Markdown(html4tags=html4tags, tab_width=tab_width, safe_mode=safe_mode, extras=extras, link_patterns=link_patterns, footnote_title=footnote_title, footnote_return_symbol=footnote_return_symbol, use_file_vars=use_file_vars, cli=cli).convert(text) class Markdown(object): # The dict of "extras" to enable in processing -- a mapping of # extra name to argument for the extra. Most extras do not have an # argument, in which case the value is None. # # This can be set via (a) subclassing and (b) the constructor # "extras" argument. extras = None urls = None titles = None html_blocks = None html_spans = None html_removed_text = "[HTML_REMOVED]" # for compat with markdown.py # Used to track when we're inside an ordered or unordered list # (see _ProcessListItems() for details): list_level = 0 _ws_only_line_re = re.compile(r"^[ \t]+$", re.M) def __init__(self, html4tags=False, tab_width=4, safe_mode=None, extras=None, link_patterns=None, footnote_title=None, footnote_return_symbol=None, use_file_vars=False, cli=False): if html4tags: self.empty_element_suffix = ">" else: self.empty_element_suffix = " />" self.tab_width = tab_width # For compatibility with earlier markdown2.py and with # markdown.py's safe_mode being a boolean, # safe_mode == True -> "replace" if safe_mode is True: self.safe_mode = "replace" else: self.safe_mode = safe_mode # Massaging and building the "extras" info. if self.extras is None: self.extras = {} elif not isinstance(self.extras, dict): self.extras = dict([(e, None) for e in self.extras]) if extras: if not isinstance(extras, dict): extras = dict([(e, None) for e in extras]) self.extras.update(extras) assert isinstance(self.extras, dict) if "toc" in self.extras: if "header-ids" not in self.extras: self.extras["header-ids"] = None # "toc" implies "header-ids" if self.extras["toc"] is None: self._toc_depth = 6 else: self._toc_depth = self.extras["toc"].get("depth", 6) self._instance_extras = self.extras.copy() self.link_patterns = link_patterns self.footnote_title = footnote_title self.footnote_return_symbol = footnote_return_symbol self.use_file_vars = use_file_vars self._outdent_re = re.compile(r'^(\t|[ ]{1,%d})' % tab_width, re.M) self.cli = cli self._escape_table = g_escape_table.copy() if "smarty-pants" in self.extras: self._escape_table['"'] = _hash_text('"') self._escape_table["'"] = _hash_text("'") def reset(self): self.urls = {} self.titles = {} self.html_blocks = {} self.html_spans = {} self.list_level = 0 self.extras = self._instance_extras.copy() if "footnotes" in self.extras: self.footnotes = {} self.footnote_ids = [] if "header-ids" in self.extras: self._count_from_header_id = defaultdict(int) if "metadata" in self.extras: self.metadata = {} # Per "rel" # should only be used in tags with an "href" attribute. _a_nofollow = re.compile(r""" <(a) ( [^>]* href= # href is required ['"]? # HTML5 attribute values do not have to be quoted [^#'"] # We don't want to match href values that start with # (like footnotes) ) """, re.IGNORECASE | re.VERBOSE ) # Opens the linked document in a new window or tab # should only used in tags with an "href" attribute. # same with _a_nofollow _a_blank = _a_nofollow def convert(self, text): """Convert the given text.""" # Main function. The order in which other subs are called here is # essential. Link and image substitutions need to happen before # _EscapeSpecialChars(), so that any *'s or _'s in the # and tags get encoded. # Clear the global hashes. If we don't clear these, you get conflicts # from other articles when generating a page which contains more than # one article (e.g. an index page that shows the N most recent # articles): self.reset() if not isinstance(text, unicode): # TODO: perhaps shouldn't presume UTF-8 for string input? text = unicode(text, 'utf-8') if self.use_file_vars: # Look for emacs-style file variable hints. emacs_vars = self._get_emacs_vars(text) if "markdown-extras" in emacs_vars: splitter = re.compile("[ ,]+") for e in splitter.split(emacs_vars["markdown-extras"]): if '=' in e: ename, earg = e.split('=', 1) try: earg = int(earg) except ValueError: pass else: ename, earg = e, None self.extras[ename] = earg # Standardize line endings: text = text.replace("\r\n", "\n") text = text.replace("\r", "\n") # Make sure $text ends with a couple of newlines: text += "\n\n" # Convert all tabs to spaces. text = self._detab(text) # Strip any lines consisting only of spaces and tabs. # This makes subsequent regexen easier to write, because we can # match consecutive blank lines with /\n+/ instead of something # contorted like /[ \t]*\n+/ . text = self._ws_only_line_re.sub("", text) # strip metadata from head and extract if "metadata" in self.extras: text = self._extract_metadata(text) text = self.preprocess(text) if "fenced-code-blocks" in self.extras and not self.safe_mode: text = self._do_fenced_code_blocks(text) if self.safe_mode: text = self._hash_html_spans(text) # Turn block-level HTML blocks into hash entries text = self._hash_html_blocks(text, raw=True) if "fenced-code-blocks" in self.extras and self.safe_mode: text = self._do_fenced_code_blocks(text) # Because numbering references aren't links (yet?) then we can do everything associated with counters # before we get started if "numbering" in self.extras: text = self._do_numbering(text) # Strip link definitions, store in hashes. if "footnotes" in self.extras: # Must do footnotes first because an unlucky footnote defn # looks like a link defn: # [^4]: this "looks like a link defn" text = self._strip_footnote_definitions(text) text = self._strip_link_definitions(text) text = self._run_block_gamut(text) if "footnotes" in self.extras: text = self._add_footnotes(text) text = self.postprocess(text) text = self._unescape_special_chars(text) if self.safe_mode: text = self._unhash_html_spans(text) if "nofollow" in self.extras: text = self._a_nofollow.sub(r'<\1 rel="nofollow"\2', text) if "target-blank-links" in self.extras: text = self._a_blank.sub(r'<\1 target="_blank"\2', text) if "toc" in self.extras and self._toc: self._toc_html = calculate_toc_html(self._toc) # Prepend toc html to output if self.cli: text = '{}\n{}'.format(self._toc_html, text) text += "\n" # Attach attrs to output rv = UnicodeWithAttrs(text) if "toc" in self.extras and self._toc: rv.toc_html = self._toc_html if "metadata" in self.extras: rv.metadata = self.metadata return rv def postprocess(self, text): """A hook for subclasses to do some postprocessing of the html, if desired. This is called before unescaping of special chars and unhashing of raw HTML spans. """ return text def preprocess(self, text): """A hook for subclasses to do some preprocessing of the Markdown, if desired. This is called after basic formatting of the text, but prior to any extras, safe mode, etc. processing. """ return text # Is metadata if the content starts with optional '---'-fenced `key: value` # pairs. E.g. (indented for presentation): # --- # foo: bar # another-var: blah blah # --- # # header # or: # foo: bar # another-var: blah blah # # # header _meta_data_pattern = re.compile(r'^(?:---[\ \t]*\n)?(.*:\s+>\n\s+[\S\s]+?)(?=\n\w+\s*:\s*\w+\n|\Z)|([\S\w]+\s*:(?! >)[ \t]*.*\n?)(?:---[\ \t]*\n)?', re.MULTILINE) _key_val_pat = re.compile(r"[\S\w]+\s*:(?! >)[ \t]*.*\n?", re.MULTILINE) # this allows key: > # value # conutiues over multiple lines _key_val_block_pat = re.compile( "(.*:\s+>\n\s+[\S\s]+?)(?=\n\w+\s*:\s*\w+\n|\Z)", re.MULTILINE) _meta_data_fence_pattern = re.compile(r'^---[\ \t]*\n', re.MULTILINE) _meta_data_newline = re.compile("^\n", re.MULTILINE) def _extract_metadata(self, text): if text.startswith("---"): fence_splits = re.split(self._meta_data_fence_pattern, text, maxsplit=2) metadata_content = fence_splits[1] match = re.findall(self._meta_data_pattern, metadata_content) if not match: return text tail = fence_splits[2] else: metadata_split = re.split(self._meta_data_newline, text, maxsplit=1) metadata_content = metadata_split[0] match = re.findall(self._meta_data_pattern, metadata_content) if not match: return text tail = metadata_split[1] kv = re.findall(self._key_val_pat, metadata_content) kvm = re.findall(self._key_val_block_pat, metadata_content) kvm = [item.replace(": >\n", ":", 1) for item in kvm] for item in kv + kvm: k, v = item.split(":", 1) self.metadata[k.strip()] = v.strip() return tail _emacs_oneliner_vars_pat = re.compile(r"-\*-\s*([^\r\n]*?)\s*-\*-", re.UNICODE) # This regular expression is intended to match blocks like this: # PREFIX Local Variables: SUFFIX # PREFIX mode: Tcl SUFFIX # PREFIX End: SUFFIX # Some notes: # - "[ \t]" is used instead of "\s" to specifically exclude newlines # - "(\r\n|\n|\r)" is used instead of "$" because the sre engine does # not like anything other than Unix-style line terminators. _emacs_local_vars_pat = re.compile(r"""^ (?P(?:[^\r\n|\n|\r])*?) [\ \t]*Local\ Variables:[\ \t]* (?P.*?)(?:\r\n|\n|\r) (?P.*?\1End:) """, re.IGNORECASE | re.MULTILINE | re.DOTALL | re.VERBOSE) def _get_emacs_vars(self, text): """Return a dictionary of emacs-style local variables. Parsing is done loosely according to this spec (and according to some in-practice deviations from this): http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables """ emacs_vars = {} SIZE = pow(2, 13) # 8kB # Search near the start for a '-*-'-style one-liner of variables. head = text[:SIZE] if "-*-" in head: match = self._emacs_oneliner_vars_pat.search(head) if match: emacs_vars_str = match.group(1) assert '\n' not in emacs_vars_str emacs_var_strs = [s.strip() for s in emacs_vars_str.split(';') if s.strip()] if len(emacs_var_strs) == 1 and ':' not in emacs_var_strs[0]: # While not in the spec, this form is allowed by emacs: # -*- Tcl -*- # where the implied "variable" is "mode". This form # is only allowed if there are no other variables. emacs_vars["mode"] = emacs_var_strs[0].strip() else: for emacs_var_str in emacs_var_strs: try: variable, value = emacs_var_str.strip().split(':', 1) except ValueError: log.debug("emacs variables error: malformed -*- " "line: %r", emacs_var_str) continue # Lowercase the variable name because Emacs allows "Mode" # or "mode" or "MoDe", etc. emacs_vars[variable.lower()] = value.strip() tail = text[-SIZE:] if "Local Variables" in tail: match = self._emacs_local_vars_pat.search(tail) if match: prefix = match.group("prefix") suffix = match.group("suffix") lines = match.group("content").splitlines(0) # print "prefix=%r, suffix=%r, content=%r, lines: %s"\ # % (prefix, suffix, match.group("content"), lines) # Validate the Local Variables block: proper prefix and suffix # usage. for i, line in enumerate(lines): if not line.startswith(prefix): log.debug("emacs variables error: line '%s' " "does not use proper prefix '%s'" % (line, prefix)) return {} # Don't validate suffix on last line. Emacs doesn't care, # neither should we. if i != len(lines)-1 and not line.endswith(suffix): log.debug("emacs variables error: line '%s' " "does not use proper suffix '%s'" % (line, suffix)) return {} # Parse out one emacs var per line. continued_for = None for line in lines[:-1]: # no var on the last line ("PREFIX End:") if prefix: line = line[len(prefix):] # strip prefix if suffix: line = line[:-len(suffix)] # strip suffix line = line.strip() if continued_for: variable = continued_for if line.endswith('\\'): line = line[:-1].rstrip() else: continued_for = None emacs_vars[variable] += ' ' + line else: try: variable, value = line.split(':', 1) except ValueError: log.debug("local variables error: missing colon " "in local variables entry: '%s'" % line) continue # Do NOT lowercase the variable name, because Emacs only # allows "mode" (and not "Mode", "MoDe", etc.) in this block. value = value.strip() if value.endswith('\\'): value = value[:-1].rstrip() continued_for = variable else: continued_for = None emacs_vars[variable] = value # Unquote values. for var, val in list(emacs_vars.items()): if len(val) > 1 and (val.startswith('"') and val.endswith('"') or val.startswith('"') and val.endswith('"')): emacs_vars[var] = val[1:-1] return emacs_vars def _detab_line(self, line): r"""Recusively convert tabs to spaces in a single line. Called from _detab().""" if '\t' not in line: return line chunk1, chunk2 = line.split('\t', 1) chunk1 += (' ' * (self.tab_width - len(chunk1) % self.tab_width)) output = chunk1 + chunk2 return self._detab_line(output) def _detab(self, text): r"""Iterate text line by line and convert tabs to spaces. >>> m = Markdown() >>> m._detab("\tfoo") ' foo' >>> m._detab(" \tfoo") ' foo' >>> m._detab("\t foo") ' foo' >>> m._detab(" foo") ' foo' >>> m._detab(" foo\n\tbar\tblam") ' foo\n bar blam' """ if '\t' not in text: return text output = [] for line in text.splitlines(): output.append(self._detab_line(line)) return '\n'.join(output) # I broke out the html5 tags here and add them to _block_tags_a and # _block_tags_b. This way html5 tags are easy to keep track of. _html5tags = '|article|aside|header|hgroup|footer|nav|section|figure|figcaption' _block_tags_a = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del' _block_tags_a += _html5tags _strict_tag_block_re = re.compile(r""" ( # save in \1 ^ # start of line (with re.M) <(%s) # start tag = \2 \b # word break (.*\n)*? # any number of lines, minimally matching # the matching end tag [ \t]* # trailing spaces/tabs (?=\n+|\Z) # followed by a newline or end of document ) """ % _block_tags_a, re.X | re.M) _block_tags_b = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math' _block_tags_b += _html5tags _liberal_tag_block_re = re.compile(r""" ( # save in \1 ^ # start of line (with re.M) <(%s) # start tag = \2 \b # word break (.*\n)*? # any number of lines, minimally matching .* # the matching end tag [ \t]* # trailing spaces/tabs (?=\n+|\Z) # followed by a newline or end of document ) """ % _block_tags_b, re.X | re.M) _html_markdown_attr_re = re.compile( r'''\s+markdown=("1"|'1')''') def _hash_html_block_sub(self, match, raw=False): html = match.group(1) if raw and self.safe_mode: html = self._sanitize_html(html) elif 'markdown-in-html' in self.extras and 'markdown=' in html: first_line = html.split('\n', 1)[0] m = self._html_markdown_attr_re.search(first_line) if m: lines = html.split('\n') middle = '\n'.join(lines[1:-1]) last_line = lines[-1] first_line = first_line[:m.start()] + first_line[m.end():] f_key = _hash_text(first_line) self.html_blocks[f_key] = first_line l_key = _hash_text(last_line) self.html_blocks[l_key] = last_line return ''.join(["\n\n", f_key, "\n\n", middle, "\n\n", l_key, "\n\n"]) key = _hash_text(html) self.html_blocks[key] = html return "\n\n" + key + "\n\n" def _hash_html_blocks(self, text, raw=False): """Hashify HTML blocks We only want to do this for block-level HTML tags, such as headers, lists, and tables. That's because we still want to wrap

s around "paragraphs" that are wrapped in non-block-level tags, such as anchors, phrase emphasis, and spans. The list of tags we're looking for is hard-coded. @param raw {boolean} indicates if these are raw HTML blocks in the original source. It makes a difference in "safe" mode. """ if '<' not in text: return text # Pass `raw` value into our calls to self._hash_html_block_sub. hash_html_block_sub = _curry(self._hash_html_block_sub, raw=raw) # First, look for nested blocks, e.g.: #

#
# tags for inner block must be indented. #
#
# # The outermost tags must start at the left margin for this to match, and # the inner nested divs must be indented. # We need to do this before the next, more liberal match, because the next # match will start at the first `
` and stop at the first `
`. text = self._strict_tag_block_re.sub(hash_html_block_sub, text) # Now match more liberally, simply from `\n` to `\n` text = self._liberal_tag_block_re.sub(hash_html_block_sub, text) # Special case just for
. It was easier to make a special # case than to make the other regex more complicated. if "", start_idx) + 3 except ValueError: break # Start position for next comment block search. start = end_idx # Validate whitespace before comment. if start_idx: # - Up to `tab_width - 1` spaces before start_idx. for i in range(self.tab_width - 1): if text[start_idx - 1] != ' ': break start_idx -= 1 if start_idx == 0: break # - Must be preceded by 2 newlines or hit the start of # the document. if start_idx == 0: pass elif start_idx == 1 and text[0] == '\n': start_idx = 0 # to match minute detail of Markdown.pl regex elif text[start_idx-2:start_idx] == '\n\n': pass else: break # Validate whitespace after comment. # - Any number of spaces and tabs. while end_idx < len(text): if text[end_idx] not in ' \t': break end_idx += 1 # - Must be following by 2 newlines or hit end of text. if text[end_idx:end_idx+2] not in ('', '\n', '\n\n'): continue # Escape and hash (must match `_hash_html_block_sub`). html = text[start_idx:end_idx] if raw and self.safe_mode: html = self._sanitize_html(html) key = _hash_text(html) self.html_blocks[key] = html text = text[:start_idx] + "\n\n" + key + "\n\n" + text[end_idx:] if "xml" in self.extras: # Treat XML processing instructions and namespaced one-liner # tags as if they were block HTML tags. E.g., if standalone # (i.e. are their own paragraph), the following do not get # wrapped in a

tag: # # # _xml_oneliner_re = _xml_oneliner_re_from_tab_width(self.tab_width) text = _xml_oneliner_re.sub(hash_html_block_sub, text) return text def _strip_link_definitions(self, text): # Strips link definitions from text, stores the URLs and titles in # hash references. less_than_tab = self.tab_width - 1 # Link defs are in the form: # [id]: url "optional title" _link_def_re = re.compile(r""" ^[ ]{0,%d}\[(.+)\]: # id = \1 [ \t]* \n? # maybe *one* newline [ \t]* ? # url = \2 [ \t]* (?: \n? # maybe one newline [ \t]* (?<=\s) # lookbehind for whitespace ['"(] ([^\n]*) # title = \3 ['")] [ \t]* )? # title is optional (?:\n+|\Z) """ % less_than_tab, re.X | re.M | re.U) return _link_def_re.sub(self._extract_link_def_sub, text) def _extract_link_def_sub(self, match): id, url, title = match.groups() key = id.lower() # Link IDs are case-insensitive self.urls[key] = self._encode_amps_and_angles(url) if title: self.titles[key] = title return "" def _do_numbering(self, text): ''' We handle the special extension for generic numbering for tables, figures etc. ''' # First pass to define all the references self.regex_defns = re.compile(r''' \[\#(\w+)\s* # the counter. Open square plus hash plus a word \1 ([^@]*)\s* # Some optional characters, that aren't an @. \2 @(\w+) # the id. Should this be normed? \3 ([^\]]*)\] # The rest of the text up to the terminating ] \4 ''', re.VERBOSE) self.regex_subs = re.compile(r"\[@(\w+)\s*\]") # [@ref_id] counters = {} references = {} replacements = [] definition_html = '

{}{}{}
' reference_html = '
{}' for match in self.regex_defns.finditer(text): # We must have four match groups otherwise this isn't a numbering reference if len(match.groups()) != 4: continue counter = match.group(1) text_before = match.group(2) ref_id = match.group(3) text_after = match.group(4) number = counters.get(counter, 1) references[ref_id] = (number, counter) replacements.append((match.start(0), definition_html.format(counter, ref_id, text_before, number, text_after), match.end(0))) counters[counter] = number + 1 for repl in reversed(replacements): text = text[:repl[0]] + repl[1] + text[repl[2]:] # Second pass to replace the references with the right # value of the counter # Fwiw, it's vaguely annoying to have to turn the iterator into # a list and then reverse it but I can't think of a better thing to do. for match in reversed(list(self.regex_subs.finditer(text))): number, counter = references.get(match.group(1), (None, None)) if number is not None: repl = reference_html.format(counter, match.group(1), number) else: repl = reference_html.format(match.group(1), 'countererror', '?' + match.group(1) + '?') if "smarty-pants" in self.extras: repl = repl.replace('"', self._escape_table['"']) text = text[:match.start()] + repl + text[match.end():] return text def _extract_footnote_def_sub(self, match): id, text = match.groups() text = _dedent(text, skip_first_line=not text.startswith('\n')).strip() normed_id = re.sub(r'\W', '-', id) # Ensure footnote text ends with a couple newlines (for some # block gamut matches). self.footnotes[normed_id] = text + "\n\n" return "" def _strip_footnote_definitions(self, text): """A footnote definition looks like this: [^note-id]: Text of the note. May include one or more indented paragraphs. Where, - The 'note-id' can be pretty much anything, though typically it is the number of the footnote. - The first paragraph may start on the next line, like so: [^note-id]: Text of the note. """ less_than_tab = self.tab_width - 1 footnote_def_re = re.compile(r''' ^[ ]{0,%d}\[\^(.+)\]: # id = \1 [ \t]* ( # footnote text = \2 # First line need not start with the spaces. (?:\s*.*\n+) (?: (?:[ ]{%d} | \t) # Subsequent lines must be indented. .*\n+ )* ) # Lookahead for non-space at line-start, or end of doc. (?:(?=^[ ]{0,%d}\S)|\Z) ''' % (less_than_tab, self.tab_width, self.tab_width), re.X | re.M) return footnote_def_re.sub(self._extract_footnote_def_sub, text) _hr_re = re.compile(r'^[ ]{0,3}([-_*][ ]{0,2}){3,}$', re.M) def _run_block_gamut(self, text): # These are all the transformations that form block-level # tags like paragraphs, headers, and list items. if "fenced-code-blocks" in self.extras: text = self._do_fenced_code_blocks(text) text = self._do_headers(text) # Do Horizontal Rules: # On the number of spaces in horizontal rules: The spec is fuzzy: "If # you wish, you may use spaces between the hyphens or asterisks." # Markdown.pl 1.0.1's hr regexes limit the number of spaces between the # hr chars to one or two. We'll reproduce that limit here. hr = "\n tags around block-level tags. text = self._hash_html_blocks(text) text = self._form_paragraphs(text) return text def _pyshell_block_sub(self, match): lines = match.group(0).splitlines(0) _dedentlines(lines) indent = ' ' * self.tab_width s = ('\n' # separate from possible cuddled paragraph + indent + ('\n'+indent).join(lines) + '\n\n') return s def _prepare_pyshell_blocks(self, text): """Ensure that Python interactive shell sessions are put in code blocks -- even if not properly indented. """ if ">>>" not in text: return text less_than_tab = self.tab_width - 1 _pyshell_block_re = re.compile(r""" ^([ ]{0,%d})>>>[ ].*\n # first line ^(\1.*\S+.*\n)* # any number of subsequent lines ^\n # ends with a blank line """ % less_than_tab, re.M | re.X) return _pyshell_block_re.sub(self._pyshell_block_sub, text) def _table_sub(self, match): trim_space_re = '^[ \t\n]+|[ \t\n]+$' trim_bar_re = r'^\||\|$' split_bar_re = r'^\||(?' % self._html_class_str_from_tag('table'), '
', ''] cols = [re.sub(escape_bar_re, '|', cell.strip()) for cell in re.split(split_bar_re, re.sub(trim_bar_re, "", re.sub(trim_space_re, "", head)))] for col_idx, col in enumerate(cols): hlines.append(' %s' % ( align_from_col_idx.get(col_idx, ''), self._run_span_gamut(col) )) hlines.append('') hlines.append('') # tbody hlines.append('') for line in body.strip('\n').split('\n'): hlines.append('') cols = [re.sub(escape_bar_re, '|', cell.strip()) for cell in re.split(split_bar_re, re.sub(trim_bar_re, "", re.sub(trim_space_re, "", line)))] for col_idx, col in enumerate(cols): hlines.append(' %s' % ( align_from_col_idx.get(col_idx, ''), self._run_span_gamut(col) )) hlines.append('') hlines.append('') hlines.append('
') return '\n'.join(hlines) + '\n' def _do_tables(self, text): """Copying PHP-Markdown and GFM table syntax. Some regex borrowed from https://github.com/michelf/php-markdown/blob/lib/Michelf/Markdown.php#L2538 """ less_than_tab = self.tab_width - 1 table_re = re.compile(r''' (?:(?<=\n\n)|\A\n?) # leading blank line ^[ ]{0,%d} # allowed whitespace (.*[|].*) \n # $1: header row (at least one pipe) ^[ ]{0,%d} # allowed whitespace ( # $2: underline row # underline row with leading bar (?: \|\ *:?-+:?\ * )+ \|? \n | # or, underline row without leading bar (?: \ *:?-+:?\ *\| )+ (?: \ *:?-+:?\ * )? \n ) ( # $3: data rows (?: ^[ ]{0,%d}(?!\ ) # ensure line begins with 0 to less_than_tab spaces .*\|.* \n )+ ) ''' % (less_than_tab, less_than_tab, less_than_tab), re.M | re.X) return table_re.sub(self._table_sub, text) def _wiki_table_sub(self, match): ttext = match.group(0).strip() # print 'wiki table: %r' % match.group(0) rows = [] for line in ttext.splitlines(0): line = line.strip()[2:-2].strip() row = [c.strip() for c in re.split(r'(?' % self._html_class_str_from_tag('table'), ''] for row in rows: hrow = [''] for cell in row: hrow.append('') hrow.append(self._run_span_gamut(cell)) hrow.append('') hrow.append('') hlines.append(''.join(hrow)) hlines += ['', ''] return '\n'.join(hlines) + '\n' def _do_wiki_tables(self, text): # Optimization. if "||" not in text: return text less_than_tab = self.tab_width - 1 wiki_table_re = re.compile(r''' (?:(?<=\n\n)|\A\n?) # leading blank line ^([ ]{0,%d})\|\|.+?\|\|[ ]*\n # first line (^\1\|\|.+?\|\|\n)* # any number of subsequent lines ''' % less_than_tab, re.M | re.X) return wiki_table_re.sub(self._wiki_table_sub, text) def _run_span_gamut(self, text): # These are all the transformations that occur *within* block-level # tags like paragraphs, headers, and list items. text = self._do_code_spans(text) text = self._escape_special_chars(text) # Process anchor and image tags. if "link-patterns" in self.extras: text = self._do_link_patterns(text) text = self._do_links(text) # Make links out of things like `` # Must come after _do_links(), because you can use < and > # delimiters in inline links like [this](). text = self._do_auto_links(text) text = self._encode_amps_and_angles(text) if "strike" in self.extras: text = self._do_strike(text) text = self._do_italics_and_bold(text) if "smarty-pants" in self.extras: text = self._do_smart_punctuation(text) # Do hard breaks: if "break-on-newline" in self.extras: text = re.sub(r" *\n", " | # auto-link (e.g., ) <\w+[^>]*> | # comment | <\?.*?\?> # processing instruction ) """, re.X) def _escape_special_chars(self, text): # Python markdown note: the HTML tokenization here differs from # that in Markdown.pl, hence the behaviour for subtle cases can # differ (I believe the tokenizer here does a better job because # it isn't susceptible to unmatched '<' and '>' in HTML tags). # Note, however, that '>' is not allowed in an auto-link URL # here. escaped = [] is_html_markup = False for token in self._sorta_html_tokenize_re.split(text): if is_html_markup: # Within tags/HTML-comments/auto-links, encode * and _ # so they don't conflict with their use in Markdown for # italics and strong. We're replacing each such # character with its corresponding MD5 checksum value; # this is likely overkill, but it should prevent us from # colliding with the escape values by accident. escaped.append(token.replace('*', self._escape_table['*']) .replace('_', self._escape_table['_'])) else: escaped.append(self._encode_backslash_escapes(token)) is_html_markup = not is_html_markup return ''.join(escaped) def _hash_html_spans(self, text): # Used for safe_mode. def _is_auto_link(s): if ':' in s and self._auto_link_re.match(s): return True elif '@' in s and self._auto_email_link_re.match(s): return True return False tokens = [] is_html_markup = False for token in self._sorta_html_tokenize_re.split(text): if is_html_markup and not _is_auto_link(token): sanitized = self._sanitize_html(token) key = _hash_text(sanitized) self.html_spans[key] = sanitized tokens.append(key) else: tokens.append(self._encode_incomplete_tags(token)) is_html_markup = not is_html_markup return ''.join(tokens) def _unhash_html_spans(self, text): for key, sanitized in list(self.html_spans.items()): text = text.replace(key, sanitized) return text def _sanitize_html(self, s): if self.safe_mode == "replace": return self.html_removed_text elif self.safe_mode == "escape": replacements = [ ('&', '&'), ('<', '<'), ('>', '>'), ] for before, after in replacements: s = s.replace(before, after) return s else: raise MarkdownError("invalid value for 'safe_mode': %r (must be " "'escape' or 'replace')" % self.safe_mode) _inline_link_title = re.compile(r''' ( # \1 [ \t]+ (['"]) # quote char = \2 (?P.*?) \2 )? # title is optional \)$ ''', re.X | re.S) _tail_of_reference_link_re = re.compile(r''' # Match tail of: [text][id] [ ]? # one optional space (?:\n[ ]*)? # one optional newline followed by spaces \[ (?P<id>.*?) \] ''', re.X | re.S) _whitespace = re.compile(r'\s*') _strip_anglebrackets = re.compile(r'<(.*)>.*') def _find_non_whitespace(self, text, start): """Returns the index of the first non-whitespace character in text after (and including) start """ match = self._whitespace.match(text, start) return match.end() def _find_balanced(self, text, start, open_c, close_c): """Returns the index where the open_c and close_c characters balance out - the same number of open_c and close_c are encountered - or the end of string if it's reached before the balance point is found. """ i = start l = len(text) count = 1 while count > 0 and i < l: if text[i] == open_c: count += 1 elif text[i] == close_c: count -= 1 i += 1 return i def _extract_url_and_title(self, text, start): """Extracts the url and (optional) title from the tail of a link""" # text[start] equals the opening parenthesis idx = self._find_non_whitespace(text, start+1) if idx == len(text): return None, None, None end_idx = idx has_anglebrackets = text[idx] == "<" if has_anglebrackets: end_idx = self._find_balanced(text, end_idx+1, "<", ">") end_idx = self._find_balanced(text, end_idx, "(", ")") match = self._inline_link_title.search(text, idx, end_idx) if not match: return None, None, None url, title = text[idx:match.start()], match.group("title") if has_anglebrackets: url = self._strip_anglebrackets.sub(r'\1', url) return url, title, end_idx _safe_protocols = re.compile(r'(https?|ftp):', re.I) def _do_links(self, text): """Turn Markdown link shortcuts into XHTML <a> and <img> tags. This is a combination of Markdown.pl's _DoAnchors() and _DoImages(). They are done together because that simplified the approach. It was necessary to use a different approach than Markdown.pl because of the lack of atomic matching support in Python's regex engine used in $g_nested_brackets. """ MAX_LINK_TEXT_SENTINEL = 3000 # markdown2 issue 24 # `anchor_allowed_pos` is used to support img links inside # anchors, but not anchors inside anchors. An anchor's start # pos must be `>= anchor_allowed_pos`. anchor_allowed_pos = 0 curr_pos = 0 while True: # Handle the next link. # The next '[' is the start of: # - an inline anchor: [text](url "title") # - a reference anchor: [text][id] # - an inline img: ![text](url "title") # - a reference img: ![text][id] # - a footnote ref: [^id] # (Only if 'footnotes' extra enabled) # - a footnote defn: [^id]: ... # (Only if 'footnotes' extra enabled) These have already # been stripped in _strip_footnote_definitions() so no # need to watch for them. # - a link definition: [id]: url "title" # These have already been stripped in # _strip_link_definitions() so no need to watch for them. # - not markup: [...anything else... try: start_idx = text.index('[', curr_pos) except ValueError: break text_length = len(text) # Find the matching closing ']'. # Markdown.pl allows *matching* brackets in link text so we # will here too. Markdown.pl *doesn't* currently allow # matching brackets in img alt text -- we'll differ in that # regard. bracket_depth = 0 for p in range(start_idx+1, min(start_idx+MAX_LINK_TEXT_SENTINEL, text_length)): ch = text[p] if ch == ']': bracket_depth -= 1 if bracket_depth < 0: break elif ch == '[': bracket_depth += 1 else: # Closing bracket not found within sentinel length. # This isn't markup. curr_pos = start_idx + 1 continue link_text = text[start_idx+1:p] # Possibly a footnote ref? if "footnotes" in self.extras and link_text.startswith("^"): normed_id = re.sub(r'\W', '-', link_text[1:]) if normed_id in self.footnotes: self.footnote_ids.append(normed_id) result = '<sup class="footnote-ref" id="fnref-%s">' \ '<a href="#fn-%s">%s</a></sup>' \ % (normed_id, normed_id, len(self.footnote_ids)) text = text[:start_idx] + result + text[p+1:] else: # This id isn't defined, leave the markup alone. curr_pos = p+1 continue # Now determine what this is by the remainder. p += 1 if p == text_length: return text # Inline anchor or img? if text[p] == '(': # attempt at perf improvement url, title, url_end_idx = self._extract_url_and_title(text, p) if url is not None: # Handle an inline anchor or img. is_img = start_idx > 0 and text[start_idx-1] == "!" if is_img: start_idx -= 1 # We've got to encode these to avoid conflicting # with italics/bold. url = url.replace('*', self._escape_table['*']) \ .replace('_', self._escape_table['_']) if title: title_str = ' title="%s"' % ( _xml_escape_attr(title) .replace('*', self._escape_table['*']) .replace('_', self._escape_table['_'])) else: title_str = '' if is_img: img_class_str = self._html_class_str_from_tag("img") result = '<img src="%s" alt="%s"%s%s%s' \ % (_html_escape_url(url, safe_mode=self.safe_mode), _xml_escape_attr(link_text), title_str, img_class_str, self.empty_element_suffix) if "smarty-pants" in self.extras: result = result.replace('"', self._escape_table['"']) curr_pos = start_idx + len(result) text = text[:start_idx] + result + text[url_end_idx:] elif start_idx >= anchor_allowed_pos: safe_link = self._safe_protocols.match(url) or url.startswith('#') if self.safe_mode and not safe_link: result_head = '<a href="#"%s>' % (title_str) else: result_head = '<a href="%s"%s>' % (_html_escape_url(url, safe_mode=self.safe_mode), title_str) result = '%s%s</a>' % (result_head, _xml_escape_attr(link_text)) if "smarty-pants" in self.extras: result = result.replace('"', self._escape_table['"']) # <img> allowed from curr_pos on, <a> from # anchor_allowed_pos on. curr_pos = start_idx + len(result_head) anchor_allowed_pos = start_idx + len(result) text = text[:start_idx] + result + text[url_end_idx:] else: # Anchor not allowed here. curr_pos = start_idx + 1 continue # Reference anchor or img? else: match = self._tail_of_reference_link_re.match(text, p) if match: # Handle a reference-style anchor or img. is_img = start_idx > 0 and text[start_idx-1] == "!" if is_img: start_idx -= 1 link_id = match.group("id").lower() if not link_id: link_id = link_text.lower() # for links like [this][] if link_id in self.urls: url = self.urls[link_id] # We've got to encode these to avoid conflicting # with italics/bold. url = url.replace('*', self._escape_table['*']) \ .replace('_', self._escape_table['_']) title = self.titles.get(link_id) if title: title = _xml_escape_attr(title) \ .replace('*', self._escape_table['*']) \ .replace('_', self._escape_table['_']) title_str = ' title="%s"' % title else: title_str = '' if is_img: img_class_str = self._html_class_str_from_tag("img") result = '<img src="%s" alt="%s"%s%s%s' \ % (_html_escape_url(url, safe_mode=self.safe_mode), _xml_escape_attr(link_text), title_str, img_class_str, self.empty_element_suffix) if "smarty-pants" in self.extras: result = result.replace('"', self._escape_table['"']) curr_pos = start_idx + len(result) text = text[:start_idx] + result + text[match.end():] elif start_idx >= anchor_allowed_pos: if self.safe_mode and not self._safe_protocols.match(url): result_head = '<a href="#"%s>' % (title_str) else: result_head = '<a href="%s"%s>' % (_html_escape_url(url, safe_mode=self.safe_mode), title_str) result = '%s%s</a>' % (result_head, link_text) if "smarty-pants" in self.extras: result = result.replace('"', self._escape_table['"']) # <img> allowed from curr_pos on, <a> from # anchor_allowed_pos on. curr_pos = start_idx + len(result_head) anchor_allowed_pos = start_idx + len(result) text = text[:start_idx] + result + text[match.end():] else: # Anchor not allowed here. curr_pos = start_idx + 1 else: # This id isn't defined, leave the markup alone. curr_pos = match.end() continue # Otherwise, it isn't markup. curr_pos = start_idx + 1 return text def header_id_from_text(self, text, prefix, n): """Generate a header id attribute value from the given header HTML content. This is only called if the "header-ids" extra is enabled. Subclasses may override this for different header ids. @param text {str} The text of the header tag @param prefix {str} The requested prefix for header ids. This is the value of the "header-ids" extra key, if any. Otherwise, None. @param n {int} The <hN> tag number, i.e. `1` for an <h1> tag. @returns {str} The value for the header tag's "id" attribute. Return None to not have an id attribute and to exclude this header from the TOC (if the "toc" extra is specified). """ header_id = _slugify(text) if prefix and isinstance(prefix, base_string_type): header_id = prefix + '-' + header_id self._count_from_header_id[header_id] += 1 if 0 == len(header_id) or self._count_from_header_id[header_id] > 1: header_id += '-%s' % self._count_from_header_id[header_id] return header_id _toc = None def _toc_add_entry(self, level, id, name): if level > self._toc_depth: return if self._toc is None: self._toc = [] self._toc.append((level, id, self._unescape_special_chars(name))) _h_re_base = r''' (^(.+)[ \t]*\n(=+|-+)[ \t]*\n+) | (^(\#{1,6}) # \1 = string of #'s [ \t]%s (.+?) # \2 = Header text [ \t]* (?<!\\) # ensure not an escaped trailing '#' \#* # optional closing #'s (not counted) \n+ ) ''' _h_re = re.compile(_h_re_base % '*', re.X | re.M) _h_re_tag_friendly = re.compile(_h_re_base % '+', re.X | re.M) def _h_sub(self, match): if match.group(1) is not None and match.group(3) == "-": return match.group(1) elif match.group(1) is not None: # Setext header n = {"=": 1, "-": 2}[match.group(3)[0]] header_group = match.group(2) else: # atx header n = len(match.group(5)) header_group = match.group(6) demote_headers = self.extras.get("demote-headers") if demote_headers: n = min(n + demote_headers, 6) header_id_attr = "" if "header-ids" in self.extras: header_id = self.header_id_from_text(header_group, self.extras["header-ids"], n) if header_id: header_id_attr = ' id="%s"' % header_id html = self._run_span_gamut(header_group) if "toc" in self.extras and header_id: self._toc_add_entry(n, header_id, html) return "<h%d%s>%s</h%d>\n\n" % (n, header_id_attr, html, n) def _do_headers(self, text): # Setext-style headers: # Header 1 # ======== # # Header 2 # -------- # atx-style headers: # # Header 1 # ## Header 2 # ## Header 2 with closing hashes ## # ... # ###### Header 6 if 'tag-friendly' in self.extras: return self._h_re_tag_friendly.sub(self._h_sub, text) return self._h_re.sub(self._h_sub, text) _marker_ul_chars = '*+-' _marker_any = r'(?:[%s]|\d+\.)' % _marker_ul_chars _marker_ul = '(?:[%s])' % _marker_ul_chars _marker_ol = r'(?:\d+\.)' def _list_sub(self, match): lst = match.group(1) lst_type = match.group(3) in self._marker_ul_chars and "ul" or "ol" result = self._process_list_items(lst) if self.list_level: return "<%s>\n%s</%s>\n" % (lst_type, result, lst_type) else: return "<%s>\n%s</%s>\n\n" % (lst_type, result, lst_type) def _do_lists(self, text): # Form HTML ordered (numbered) and unordered (bulleted) lists. # Iterate over each *non-overlapping* list match. pos = 0 while True: # Find the *first* hit for either list style (ul or ol). We # match ul and ol separately to avoid adjacent lists of different # types running into each other (see issue #16). hits = [] for marker_pat in (self._marker_ul, self._marker_ol): less_than_tab = self.tab_width - 1 whole_list = r''' ( # \1 = whole list ( # \2 [ ]{0,%d} (%s) # \3 = first list item marker [ \t]+ (?!\ *\3\ ) # '- - - ...' isn't a list. See 'not_quite_a_list' test case. ) (?:.+?) ( # \4 \Z | \n{2,} (?=\S) (?! # Negative lookahead for another list item marker [ \t]* %s[ \t]+ ) ) ) ''' % (less_than_tab, marker_pat, marker_pat) if self.list_level: # sub-list list_re = re.compile("^"+whole_list, re.X | re.M | re.S) else: list_re = re.compile(r"(?:(?<=\n\n)|\A\n?)"+whole_list, re.X | re.M | re.S) match = list_re.search(text, pos) if match: hits.append((match.start(), match)) if not hits: break hits.sort() match = hits[0][1] start, end = match.span() middle = self._list_sub(match) text = text[:start] + middle + text[end:] pos = start + len(middle) # start pos for next attempted match return text _list_item_re = re.compile(r''' (\n)? # leading line = \1 (^[ \t]*) # leading whitespace = \2 (?P<marker>%s) [ \t]+ # list marker = \3 ((?:.+?) # list item text = \4 (\n{1,2})) # eols = \5 (?= \n* (\Z | \2 (?P<next_marker>%s) [ \t]+)) ''' % (_marker_any, _marker_any), re.M | re.X | re.S) _task_list_item_re = re.compile(r''' (\[[\ x]\])[ \t]+ # tasklist marker = \1 (.*) # list item text = \2 ''', re.M | re.X | re.S) _task_list_warpper_str = r'<input type="checkbox" class="task-list-item-checkbox" %sdisabled> %s' def _task_list_item_sub(self, match): marker = match.group(1) item_text = match.group(2) if marker == '[x]': return self._task_list_warpper_str % ('checked ', item_text) elif marker == '[ ]': return self._task_list_warpper_str % ('', item_text) _last_li_endswith_two_eols = False def _list_item_sub(self, match): item = match.group(4) leading_line = match.group(1) if leading_line or "\n\n" in item or self._last_li_endswith_two_eols: item = self._run_block_gamut(self._outdent(item)) else: # Recursion for sub-lists: item = self._do_lists(self._outdent(item)) if item.endswith('\n'): item = item[:-1] item = self._run_span_gamut(item) self._last_li_endswith_two_eols = (len(match.group(5)) == 2) if "task_list" in self.extras: item = self._task_list_item_re.sub(self._task_list_item_sub, item) return "<li>%s</li>\n" % item def _process_list_items(self, list_str): # Process the contents of a single ordered or unordered list, # splitting it into individual list items. # The $g_list_level global keeps track of when we're inside a list. # Each time we enter a list, we increment it; when we leave a list, # we decrement. If it's zero, we're not in a list anymore. # # We do this because when we're not inside a list, we want to treat # something like this: # # I recommend upgrading to version # 8. Oops, now this line is treated # as a sub-list. # # As a single paragraph, despite the fact that the second line starts # with a digit-period-space sequence. # # Whereas when we're inside a list (or sub-list), that line will be # treated as the start of a sub-list. What a kludge, huh? This is # an aspect of Markdown's syntax that's hard to parse perfectly # without resorting to mind-reading. Perhaps the solution is to # change the syntax rules such that sub-lists must start with a # starting cardinal number; e.g. "1." or "a.". self.list_level += 1 self._last_li_endswith_two_eols = False list_str = list_str.rstrip('\n') + '\n' list_str = self._list_item_re.sub(self._list_item_sub, list_str) self.list_level -= 1 return list_str def _get_pygments_lexer(self, lexer_name): try: from pygments import lexers, util except ImportError: return None try: return lexers.get_lexer_by_name(lexer_name) except util.ClassNotFound: return None def _color_with_pygments(self, codeblock, lexer, **formatter_opts): import pygments import pygments.formatters class HtmlCodeFormatter(pygments.formatters.HtmlFormatter): def _wrap_code(self, inner): """A function for use in a Pygments Formatter which wraps in <code> tags. """ yield 0, "<code>" for tup in inner: yield tup yield 0, "</code>" def wrap(self, source, outfile): """Return the source with a code, pre, and div.""" return self._wrap_div(self._wrap_pre(self._wrap_code(source))) formatter_opts.setdefault("cssclass", "codehilite") formatter = HtmlCodeFormatter(**formatter_opts) return pygments.highlight(codeblock, lexer, formatter) def _code_block_sub(self, match, is_fenced_code_block=False): lexer_name = None if is_fenced_code_block: lexer_name = match.group(1) if lexer_name: formatter_opts = self.extras['fenced-code-blocks'] or {} codeblock = match.group(2) codeblock = codeblock[:-1] # drop one trailing newline else: codeblock = match.group(1) codeblock = self._outdent(codeblock) codeblock = self._detab(codeblock) codeblock = codeblock.lstrip('\n') # trim leading newlines codeblock = codeblock.rstrip() # trim trailing whitespace # Note: "code-color" extra is DEPRECATED. if "code-color" in self.extras and codeblock.startswith(":::"): lexer_name, rest = codeblock.split('\n', 1) lexer_name = lexer_name[3:].strip() codeblock = rest.lstrip("\n") # Remove lexer declaration line. formatter_opts = self.extras['code-color'] or {} # Use pygments only if not using the highlightjs-lang extra if lexer_name and "highlightjs-lang" not in self.extras: def unhash_code(codeblock): for key, sanitized in list(self.html_spans.items()): codeblock = codeblock.replace(key, sanitized) replacements = [ ("&", "&"), ("<", "<"), (">", ">") ] for old, new in replacements: codeblock = codeblock.replace(old, new) return codeblock lexer = self._get_pygments_lexer(lexer_name) if lexer: codeblock = unhash_code( codeblock ) colored = self._color_with_pygments(codeblock, lexer, **formatter_opts) return "\n\n%s\n\n" % colored codeblock = self._encode_code(codeblock) pre_class_str = self._html_class_str_from_tag("pre") if "highlightjs-lang" in self.extras and lexer_name: code_class_str = ' class="%s"' % lexer_name else: code_class_str = self._html_class_str_from_tag("code") return "\n\n<pre%s><code%s>%s\n</code></pre>\n\n" % ( pre_class_str, code_class_str, codeblock) def _html_class_str_from_tag(self, tag): """Get the appropriate ' class="..."' string (note the leading space), if any, for the given tag. """ if "html-classes" not in self.extras: return "" try: html_classes_from_tag = self.extras["html-classes"] except TypeError: return "" else: if tag in html_classes_from_tag: return ' class="%s"' % html_classes_from_tag[tag] return "" def _do_code_blocks(self, text): """Process Markdown `<pre><code>` blocks.""" code_block_re = re.compile(r''' (?:\n\n|\A\n?) ( # $1 = the code block -- one or more lines, starting with a space/tab (?: (?:[ ]{%d} | \t) # Lines must start with a tab or a tab-width of spaces .*\n+ )+ ) ((?=^[ ]{0,%d}\S)|\Z) # Lookahead for non-space at line-start, or end of doc # Lookahead to make sure this block isn't already in a code block. # Needed when syntax highlighting is being used. (?![^<]*\</code\>) ''' % (self.tab_width, self.tab_width), re.M | re.X) return code_block_re.sub(self._code_block_sub, text) _fenced_code_block_re = re.compile(r''' (?:\n+|\A\n?) ^```\s*?([\w+-]+)?\s*?\n # opening fence, $1 = optional lang (.*?) # $2 = code block content ^```[ \t]*\n # closing fence ''', re.M | re.X | re.S) def _fenced_code_block_sub(self, match): return self._code_block_sub(match, is_fenced_code_block=True) def _do_fenced_code_blocks(self, text): """Process ```-fenced unindented code blocks ('fenced-code-blocks' extra).""" return self._fenced_code_block_re.sub(self._fenced_code_block_sub, text) # Rules for a code span: # - backslash escapes are not interpreted in a code span # - to include one or or a run of more backticks the delimiters must # be a longer run of backticks # - cannot start or end a code span with a backtick; pad with a # space and that space will be removed in the emitted HTML # See `test/tm-cases/escapes.text` for a number of edge-case # examples. _code_span_re = re.compile(r''' (?<!\\) (`+) # \1 = Opening run of ` (?!`) # See Note A test/tm-cases/escapes.text (.+?) # \2 = The code block (?<!`) \1 # Matching closer (?!`) ''', re.X | re.S) def _code_span_sub(self, match): c = match.group(2).strip(" \t") c = self._encode_code(c) return "<code>%s</code>" % c def _do_code_spans(self, text): # * Backtick quotes are used for <code></code> spans. # # * You can use multiple backticks as the delimiters if you want to # include literal backticks in the code span. So, this input: # # Just type ``foo `bar` baz`` at the prompt. # # Will translate to: # # <p>Just type <code>foo `bar` baz</code> at the prompt.</p> # # There's no arbitrary limit to the number of backticks you # can use as delimters. If you need three consecutive backticks # in your code, use four for delimiters, etc. # # * You can use spaces to get literal backticks at the edges: # # ... type `` `bar` `` ... # # Turns to: # # ... type <code>`bar`</code> ... return self._code_span_re.sub(self._code_span_sub, text) def _encode_code(self, text): """Encode/escape certain characters inside Markdown code runs. The point is that in code, these characters are literals, and lose their special Markdown meanings. """ replacements = [ # Encode all ampersands; HTML entities are not # entities within a Markdown code span. ('&', '&'), # Do the angle bracket song and dance: ('<', '<'), ('>', '>'), ] for before, after in replacements: text = text.replace(before, after) hashed = _hash_text(text) self._escape_table[text] = hashed return hashed _strike_re = re.compile(r"~~(?=\S)(.+?)(?<=\S)~~", re.S) def _do_strike(self, text): text = self._strike_re.sub(r"<strike>\1</strike>", text) return text _strong_re = re.compile(r"(\*\*|__)(?=\S)(.+?[*_]*)(?<=\S)\1", re.S) _em_re = re.compile(r"(\*|_)(?=\S)(.+?)(?<=\S)\1", re.S) _code_friendly_strong_re = re.compile(r"\*\*(?=\S)(.+?[*_]*)(?<=\S)\*\*", re.S) _code_friendly_em_re = re.compile(r"\*(?=\S)(.+?)(?<=\S)\*", re.S) def _do_italics_and_bold(self, text): # <strong> must go first: if "code-friendly" in self.extras: text = self._code_friendly_strong_re.sub(r"<strong>\1</strong>", text) text = self._code_friendly_em_re.sub(r"<em>\1</em>", text) else: text = self._strong_re.sub(r"<strong>\2</strong>", text) text = self._em_re.sub(r"<em>\2</em>", text) return text # "smarty-pants" extra: Very liberal in interpreting a single prime as an # apostrophe; e.g. ignores the fact that "round", "bout", "twer", and # "twixt" can be written without an initial apostrophe. This is fine because # using scare quotes (single quotation marks) is rare. _apostrophe_year_re = re.compile(r"'(\d\d)(?=(\s|,|;|\.|\?|!|$))") _contractions = ["tis", "twas", "twer", "neath", "o", "n", "round", "bout", "twixt", "nuff", "fraid", "sup"] def _do_smart_contractions(self, text): text = self._apostrophe_year_re.sub(r"’\1", text) for c in self._contractions: text = text.replace("'%s" % c, "’%s" % c) text = text.replace("'%s" % c.capitalize(), "’%s" % c.capitalize()) return text # Substitute double-quotes before single-quotes. _opening_single_quote_re = re.compile(r"(?<!\S)'(?=\S)") _opening_double_quote_re = re.compile(r'(?<!\S)"(?=\S)') _closing_single_quote_re = re.compile(r"(?<=\S)'") _closing_double_quote_re = re.compile(r'(?<=\S)"(?=(\s|,|;|\.|\?|!|$))') def _do_smart_punctuation(self, text): """Fancifies 'single quotes', "double quotes", and apostrophes. Converts --, ---, and ... into en dashes, em dashes, and ellipses. Inspiration is: <http://daringfireball.net/projects/smartypants/> See "test/tm-cases/smarty_pants.text" for a full discussion of the support here and <http://code.google.com/p/python-markdown2/issues/detail?id=42> for a discussion of some diversion from the original SmartyPants. """ if "'" in text: # guard for perf text = self._do_smart_contractions(text) text = self._opening_single_quote_re.sub("‘", text) text = self._closing_single_quote_re.sub("’", text) if '"' in text: # guard for perf text = self._opening_double_quote_re.sub("“", text) text = self._closing_double_quote_re.sub("”", text) text = text.replace("---", "—") text = text.replace("--", "–") text = text.replace("...", "…") text = text.replace(" . . . ", "…") text = text.replace(". . .", "…") return text _block_quote_base = r''' ( # Wrap whole match in \1 ( ^[ \t]*>%s[ \t]? # '>' at the start of a line .+\n # rest of the first line (.+\n)* # subsequent consecutive lines \n* # blanks )+ ) ''' _block_quote_re = re.compile(_block_quote_base % '', re.M | re.X) _block_quote_re_spoiler = re.compile(_block_quote_base % '[ \t]*?!?', re.M | re.X) _bq_one_level_re = re.compile('^[ \t]*>[ \t]?', re.M) _bq_one_level_re_spoiler = re.compile('^[ \t]*>[ \t]*?![ \t]?', re.M) _bq_all_lines_spoilers = re.compile(r'\A(?:^[ \t]*>[ \t]*?!.*[\n\r]*)+\Z', re.M) _html_pre_block_re = re.compile(r'(\s*<pre>.+?</pre>)', re.S) def _dedent_two_spaces_sub(self, match): return re.sub(r'(?m)^ ', '', match.group(1)) def _block_quote_sub(self, match): bq = match.group(1) is_spoiler = 'spoiler' in self.extras and self._bq_all_lines_spoilers.match(bq) # trim one level of quoting if is_spoiler: bq = self._bq_one_level_re_spoiler.sub('', bq) else: bq = self._bq_one_level_re.sub('', bq) # trim whitespace-only lines bq = self._ws_only_line_re.sub('', bq) bq = self._run_block_gamut(bq) # recurse bq = re.sub('(?m)^', ' ', bq) # These leading spaces screw with <pre> content, so we need to fix that: bq = self._html_pre_block_re.sub(self._dedent_two_spaces_sub, bq) if is_spoiler: return '<blockquote class="spoiler">\n%s\n</blockquote>\n\n' % bq else: return '<blockquote>\n%s\n</blockquote>\n\n' % bq def _do_block_quotes(self, text): if '>' not in text: return text if 'spoiler' in self.extras: return self._block_quote_re_spoiler.sub(self._block_quote_sub, text) else: return self._block_quote_re.sub(self._block_quote_sub, text) def _form_paragraphs(self, text): # Strip leading and trailing lines: text = text.strip('\n') # Wrap <p> tags. grafs = [] for i, graf in enumerate(re.split(r"\n{2,}", text)): if graf in self.html_blocks: # Unhashify HTML blocks grafs.append(self.html_blocks[graf]) else: cuddled_list = None if "cuddled-lists" in self.extras: # Need to put back trailing '\n' for `_list_item_re` # match at the end of the paragraph. li = self._list_item_re.search(graf + '\n') # Two of the same list marker in this paragraph: a likely # candidate for a list cuddled to preceding paragraph # text (issue 33). Note the `[-1]` is a quick way to # consider numeric bullets (e.g. "1." and "2.") to be # equal. if (li and len(li.group(2)) <= 3 and ( (li.group("next_marker") and li.group("marker")[-1] == li.group("next_marker")[-1]) or li.group("next_marker") is None ) ): start = li.start() cuddled_list = self._do_lists(graf[start:]).rstrip("\n") assert cuddled_list.startswith("<ul>") or cuddled_list.startswith("<ol>") graf = graf[:start] # Wrap <p> tags. graf = self._run_span_gamut(graf) grafs.append("<p>" + graf.lstrip(" \t") + "</p>") if cuddled_list: grafs.append(cuddled_list) return "\n\n".join(grafs) def _add_footnotes(self, text): if self.footnotes: footer = [ '<div class="footnotes">', '<hr' + self.empty_element_suffix, '<ol>', ] if not self.footnote_title: self.footnote_title = "Jump back to footnote %d in the text." if not self.footnote_return_symbol: self.footnote_return_symbol = "↩" for i, id in enumerate(self.footnote_ids): if i != 0: footer.append('') footer.append('<li id="fn-%s">' % id) footer.append(self._run_block_gamut(self.footnotes[id])) try: backlink = ('<a href="#fnref-%s" ' + 'class="footnoteBackLink" ' + 'title="' + self.footnote_title + '">' + self.footnote_return_symbol + '</a>') % (id, i+1) except TypeError: log.debug("Footnote error. `footnote_title` " "must include parameter. Using defaults.") backlink = ('<a href="#fnref-%s" ' 'class="footnoteBackLink" ' 'title="Jump back to footnote %d in the text.">' '↩</a>' % (id, i+1)) if footer[-1].endswith("</p>"): footer[-1] = footer[-1][:-len("</p>")] \ + ' ' + backlink + "</p>" else: footer.append("\n<p>%s</p>" % backlink) footer.append('</li>') footer.append('</ol>') footer.append('</div>') return text + '\n\n' + '\n'.join(footer) else: return text _naked_lt_re = re.compile(r'<(?![a-z/?\$!])', re.I) _naked_gt_re = re.compile(r'''(?<![a-z0-9?!/'"-])>''', re.I) def _encode_amps_and_angles(self, text): # Smart processing for ampersands and angle brackets that need # to be encoded. text = _AMPERSAND_RE.sub('&', text) # Encode naked <'s text = self._naked_lt_re.sub('<', text) # Encode naked >'s # Note: Other markdown implementations (e.g. Markdown.pl, PHP # Markdown) don't do this. text = self._naked_gt_re.sub('>', text) return text _incomplete_tags_re = re.compile("<(/?\w+[\s/]+?)") def _encode_incomplete_tags(self, text): if self.safe_mode not in ("replace", "escape"): return text return self._incomplete_tags_re.sub("<\\1", text) def _encode_backslash_escapes(self, text): for ch, escape in list(self._escape_table.items()): text = text.replace("\\"+ch, escape) return text _auto_link_re = re.compile(r'<((https?|ftp):[^\'">\s]+)>', re.I) def _auto_link_sub(self, match): g1 = match.group(1) return '<a href="%s">%s</a>' % (g1, g1) _auto_email_link_re = re.compile(r""" < (?:mailto:)? ( [-.\w]+ \@ [-\w]+(\.[-\w]+)*\.[a-z]+ ) > """, re.I | re.X | re.U) def _auto_email_link_sub(self, match): return self._encode_email_address( self._unescape_special_chars(match.group(1))) def _do_auto_links(self, text): text = self._auto_link_re.sub(self._auto_link_sub, text) text = self._auto_email_link_re.sub(self._auto_email_link_sub, text) return text def _encode_email_address(self, addr): # Input: an email address, e.g. "foo@example.com" # # Output: the email address as a mailto link, with each character # of the address encoded as either a decimal or hex entity, in # the hopes of foiling most address harvesting spam bots. E.g.: # # <a href="mailto:foo@e # xample.com">foo # @example.com</a> # # Based on a filter by Matthew Wickline, posted to the BBEdit-Talk # mailing list: <http://tinyurl.com/yu7ue> chars = [_xml_encode_email_char_at_random(ch) for ch in "mailto:" + addr] # Strip the mailto: from the visible part. addr = '<a href="%s">%s</a>' \ % (''.join(chars), ''.join(chars[7:])) return addr def _do_link_patterns(self, text): link_from_hash = {} for regex, repl in self.link_patterns: replacements = [] for match in regex.finditer(text): if hasattr(repl, "__call__"): href = repl(match) else: href = match.expand(repl) replacements.append((match.span(), href)) for (start, end), href in reversed(replacements): # Do not match against links inside brackets. if text[start - 1:start] == '[' and text[end:end + 1] == ']': continue # Do not match against links in the standard markdown syntax. if text[start - 2:start] == '](' or text[end:end + 2] == '")': continue escaped_href = ( href.replace('"', '"') # b/c of attr quote # To avoid markdown <em> and <strong>: .replace('*', self._escape_table['*']) .replace('_', self._escape_table['_'])) link = '<a href="%s">%s</a>' % (escaped_href, text[start:end]) hash = _hash_text(link) link_from_hash[hash] = link text = text[:start] + hash + text[end:] for hash, link in list(link_from_hash.items()): text = text.replace(hash, link) return text def _unescape_special_chars(self, text): # Swap back in all the special characters we've hidden. for ch, hash in list(self._escape_table.items()): text = text.replace(hash, ch) return text def _outdent(self, text): # Remove one level of line-leading tabs or spaces return self._outdent_re.sub('', text) class MarkdownWithExtras(Markdown): """A markdowner class that enables most extras: - footnotes - code-color (only has effect if 'pygments' Python module on path) These are not included: - pyshell (specific to Python-related documenting) - code-friendly (because it *disables* part of the syntax) - link-patterns (because you need to specify some actual link-patterns anyway) """ extras = ["footnotes", "code-color"] # ---- internal support functions def calculate_toc_html(toc): """Return the HTML for the current TOC. This expects the `_toc` attribute to have been set on this instance. """ if toc is None: return None def indent(): return ' ' * (len(h_stack) - 1) lines = [] h_stack = [0] # stack of header-level numbers for level, id, name in toc: if level > h_stack[-1]: lines.append("%s<ul>" % indent()) h_stack.append(level) elif level == h_stack[-1]: lines[-1] += "</li>" else: while level < h_stack[-1]: h_stack.pop() if not lines[-1].endswith("</li>"): lines[-1] += "</li>" lines.append("%s</ul></li>" % indent()) lines.append('%s<li><a href="#%s">%s</a>' % ( indent(), id, name)) while len(h_stack) > 1: h_stack.pop() if not lines[-1].endswith("</li>"): lines[-1] += "</li>" lines.append("%s</ul>" % indent()) return '\n'.join(lines) + '\n' class UnicodeWithAttrs(unicode): """A subclass of unicode used for the return value of conversion to possibly attach some attributes. E.g. the "toc_html" attribute when the "toc" extra is used. """ metadata = None toc_html = None ## {{{ http://code.activestate.com/recipes/577257/ (r1) _slugify_strip_re = re.compile(r'[^\w\s-]') _slugify_hyphenate_re = re.compile(r'[-\s]+') def _slugify(value): """ Normalizes string, converts to lowercase, removes non-alpha characters, and converts spaces to hyphens. From Django's "django/template/defaultfilters.py". """ import unicodedata value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode() value = _slugify_strip_re.sub('', value).strip().lower() return _slugify_hyphenate_re.sub('-', value) ## end of http://code.activestate.com/recipes/577257/ }}} # From http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549 def _curry(*args, **kwargs): function, args = args[0], args[1:] def result(*rest, **kwrest): combined = kwargs.copy() combined.update(kwrest) return function(*args + rest, **combined) return result # Recipe: regex_from_encoded_pattern (1.0) def _regex_from_encoded_pattern(s): """'foo' -> re.compile(re.escape('foo')) '/foo/' -> re.compile('foo') '/foo/i' -> re.compile('foo', re.I) """ if s.startswith('/') and s.rfind('/') != 0: # Parse it: /PATTERN/FLAGS idx = s.rfind('/') pattern, flags_str = s[1:idx], s[idx+1:] flag_from_char = { "i": re.IGNORECASE, "l": re.LOCALE, "s": re.DOTALL, "m": re.MULTILINE, "u": re.UNICODE, } flags = 0 for char in flags_str: try: flags |= flag_from_char[char] except KeyError: raise ValueError("unsupported regex flag: '%s' in '%s' " "(must be one of '%s')" % (char, s, ''.join(list(flag_from_char.keys())))) return re.compile(s[1:idx], flags) else: # not an encoded regex return re.compile(re.escape(s)) # Recipe: dedent (0.1.2) def _dedentlines(lines, tabsize=8, skip_first_line=False): """_dedentlines(lines, tabsize=8, skip_first_line=False) -> dedented lines "lines" is a list of lines to dedent. "tabsize" is the tab width to use for indent width calculations. "skip_first_line" is a boolean indicating if the first line should be skipped for calculating the indent width and for dedenting. This is sometimes useful for docstrings and similar. Same as dedent() except operates on a sequence of lines. Note: the lines list is modified **in-place**. """ DEBUG = False if DEBUG: print("dedent: dedent(..., tabsize=%d, skip_first_line=%r)"\ % (tabsize, skip_first_line)) margin = None for i, line in enumerate(lines): if i == 0 and skip_first_line: continue indent = 0 for ch in line: if ch == ' ': indent += 1 elif ch == '\t': indent += tabsize - (indent % tabsize) elif ch in '\r\n': continue # skip all-whitespace lines else: break else: continue # skip all-whitespace lines if DEBUG: print("dedent: indent=%d: %r" % (indent, line)) if margin is None: margin = indent else: margin = min(margin, indent) if DEBUG: print("dedent: margin=%r" % margin) if margin is not None and margin > 0: for i, line in enumerate(lines): if i == 0 and skip_first_line: continue removed = 0 for j, ch in enumerate(line): if ch == ' ': removed += 1 elif ch == '\t': removed += tabsize - (removed % tabsize) elif ch in '\r\n': if DEBUG: print("dedent: %r: EOL -> strip up to EOL" % line) lines[i] = lines[i][j:] break else: raise ValueError("unexpected non-whitespace char %r in " "line %r while removing %d-space margin" % (ch, line, margin)) if DEBUG: print("dedent: %r: %r -> removed %d/%d"\ % (line, ch, removed, margin)) if removed == margin: lines[i] = lines[i][j+1:] break elif removed > margin: lines[i] = ' '*(removed-margin) + lines[i][j+1:] break else: if removed: lines[i] = lines[i][removed:] return lines def _dedent(text, tabsize=8, skip_first_line=False): """_dedent(text, tabsize=8, skip_first_line=False) -> dedented text "text" is the text to dedent. "tabsize" is the tab width to use for indent width calculations. "skip_first_line" is a boolean indicating if the first line should be skipped for calculating the indent width and for dedenting. This is sometimes useful for docstrings and similar. textwrap.dedent(s), but don't expand tabs to spaces """ lines = text.splitlines(1) _dedentlines(lines, tabsize=tabsize, skip_first_line=skip_first_line) return ''.join(lines) class _memoized(object): """Decorator that caches a function's return value each time it is called. If called later with the same arguments, the cached value is returned, and not re-evaluated. http://wiki.python.org/moin/PythonDecoratorLibrary """ def __init__(self, func): self.func = func self.cache = {} def __call__(self, *args): try: return self.cache[args] except KeyError: self.cache[args] = value = self.func(*args) return value except TypeError: # uncachable -- for instance, passing a list as an argument. # Better to not cache than to blow up entirely. return self.func(*args) def __repr__(self): """Return the function's docstring.""" return self.func.__doc__ def _xml_oneliner_re_from_tab_width(tab_width): """Standalone XML processing instruction regex.""" return re.compile(r""" (?: (?<=\n\n) # Starting after a blank line | # or \A\n? # the beginning of the doc ) ( # save in $1 [ ]{0,%d} (?: <\?\w+\b\s+.*?\?> # XML processing instruction | <\w+:\w+\b\s+.*?/> # namespaced single tag ) [ \t]* (?=\n{2,}|\Z) # followed by a blank line or end of document ) """ % (tab_width - 1), re.X) _xml_oneliner_re_from_tab_width = _memoized(_xml_oneliner_re_from_tab_width) def _hr_tag_re_from_tab_width(tab_width): return re.compile(r""" (?: (?<=\n\n) # Starting after a blank line | # or \A\n? # the beginning of the doc ) ( # save in \1 [ ]{0,%d} <(hr) # start tag = \2 \b # word break ([^<>])*? # /?> # the matching end tag [ \t]* (?=\n{2,}|\Z) # followed by a blank line or end of document ) """ % (tab_width - 1), re.X) _hr_tag_re_from_tab_width = _memoized(_hr_tag_re_from_tab_width) def _xml_escape_attr(attr, skip_single_quote=True): """Escape the given string for use in an HTML/XML tag attribute. By default this doesn't bother with escaping `'` to `'`, presuming that the tag attribute is surrounded by double quotes. """ escaped = _AMPERSAND_RE.sub('&', attr) escaped = (attr .replace('"', '"') .replace('<', '<') .replace('>', '>')) if not skip_single_quote: escaped = escaped.replace("'", "'") return escaped def _xml_encode_email_char_at_random(ch): r = random() # Roughly 10% raw, 45% hex, 45% dec. # '@' *must* be encoded. I [John Gruber] insist. # Issue 26: '_' must be encoded. if r > 0.9 and ch not in "@_": return ch elif r < 0.45: # The [1:] is to drop leading '0': 0x63 -> x63 return '&#%s;' % hex(ord(ch))[1:] else: return '&#%s;' % ord(ch) def _html_escape_url(attr, safe_mode=False): """Replace special characters that are potentially malicious in url string.""" escaped = (attr .replace('"', '"') .replace('<', '<') .replace('>', '>')) if safe_mode: escaped = escaped.replace('+', ' ') escaped = escaped.replace("'", "'") return escaped # ---- mainline class _NoReflowFormatter(optparse.IndentedHelpFormatter): """An optparse formatter that does NOT reflow the description.""" def format_description(self, description): return description or "" def _test(): import doctest doctest.testmod() def main(argv=None): if argv is None: argv = sys.argv if not logging.root.handlers: logging.basicConfig() usage = "usage: %prog [PATHS...]" version = "%prog "+__version__ parser = optparse.OptionParser(prog="markdown2", usage=usage, version=version, description=cmdln_desc, formatter=_NoReflowFormatter()) parser.add_option("-v", "--verbose", dest="log_level", action="store_const", const=logging.DEBUG, help="more verbose output") parser.add_option("--encoding", help="specify encoding of text content") parser.add_option("--html4tags", action="store_true", default=False, help="use HTML 4 style for empty element tags") parser.add_option("-s", "--safe", metavar="MODE", dest="safe_mode", help="sanitize literal HTML: 'escape' escapes " "HTML meta chars, 'replace' replaces with an " "[HTML_REMOVED] note") parser.add_option("-x", "--extras", action="append", help="Turn on specific extra features (not part of " "the core Markdown spec). See above.") parser.add_option("--use-file-vars", help="Look for and use Emacs-style 'markdown-extras' " "file var to turn on extras. See " "<https://github.com/trentm/python-markdown2/wiki/Extras>") parser.add_option("--link-patterns-file", help="path to a link pattern file") parser.add_option("--self-test", action="store_true", help="run internal self-tests (some doctests)") parser.add_option("--compare", action="store_true", help="run against Markdown.pl as well (for testing)") parser.set_defaults(log_level=logging.INFO, compare=False, encoding="utf-8", safe_mode=None, use_file_vars=False) opts, paths = parser.parse_args() log.setLevel(opts.log_level) if opts.self_test: return _test() if opts.extras: extras = {} for s in opts.extras: splitter = re.compile("[,;: ]+") for e in splitter.split(s): if '=' in e: ename, earg = e.split('=', 1) try: earg = int(earg) except ValueError: pass else: ename, earg = e, None extras[ename] = earg else: extras = None if opts.link_patterns_file: link_patterns = [] f = open(opts.link_patterns_file) try: for i, line in enumerate(f.readlines()): if not line.strip(): continue if line.lstrip().startswith("#"): continue try: pat, href = line.rstrip().rsplit(None, 1) except ValueError: raise MarkdownError("%s:%d: invalid link pattern line: %r" % (opts.link_patterns_file, i+1, line)) link_patterns.append( (_regex_from_encoded_pattern(pat), href)) finally: f.close() else: link_patterns = None from os.path import join, dirname, abspath, exists markdown_pl = join(dirname(dirname(abspath(__file__))), "test", "Markdown.pl") if not paths: paths = ['-'] for path in paths: if path == '-': text = sys.stdin.read() else: fp = codecs.open(path, 'r', opts.encoding) text = fp.read() fp.close() if opts.compare: from subprocess import Popen, PIPE print("==== Markdown.pl ====") p = Popen('perl %s' % markdown_pl, shell=True, stdin=PIPE, stdout=PIPE, close_fds=True) p.stdin.write(text.encode('utf-8')) p.stdin.close() perl_html = p.stdout.read().decode('utf-8') if py3: sys.stdout.write(perl_html) else: sys.stdout.write(perl_html.encode( sys.stdout.encoding or "utf-8", 'xmlcharrefreplace')) print("==== markdown2.py ====") html = markdown(text, html4tags=opts.html4tags, safe_mode=opts.safe_mode, extras=extras, link_patterns=link_patterns, use_file_vars=opts.use_file_vars, cli=True) if py3: sys.stdout.write(html) else: sys.stdout.write(html.encode( sys.stdout.encoding or "utf-8", 'xmlcharrefreplace')) if extras and "toc" in extras: log.debug("toc_html: " + str(html.toc_html.encode(sys.stdout.encoding or "utf-8", 'xmlcharrefreplace'))) if opts.compare: test_dir = join(dirname(dirname(abspath(__file__))), "test") if exists(join(test_dir, "test_markdown2.py")): sys.path.insert(0, test_dir) from test_markdown2 import norm_html_from_html norm_html = norm_html_from_html(html) norm_perl_html = norm_html_from_html(perl_html) else: norm_html = html norm_perl_html = perl_html print("==== match? %r ====" % (norm_perl_html == norm_html)) if __name__ == "__main__": sys.exit(main(sys.argv)) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/LICENSE.txt�������������������������������������������������������������������������0000644�0000765�0000024�00000004411�12240460102�015310� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This implementation of Markdown is licensed under the MIT License: The MIT License Copyright (c) 2012 Trent Mick Copyright (c) 2010 ActiveState Software Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. All files in a *source package* of markdown2 (i.e. those available on pypi.python.org and the Google Code project "downloads" page) are under the MIT license. However, in the *subversion repository* there are some files (used for performance and testing purposes) that are under different licenses as follows: - perf/recipes.pprint Python License. This file includes a number of real-world examples of Markdown from the ActiveState Python Cookbook, used for doing some performance testing of markdown2.py. - test/php-markdown-cases/... test/php-markdown-extra-cases/... GPL. These are from the MDTest package announced here: http://six.pairlist.net/pipermail/markdown-discuss/2007-July/000674.html - test/markdown.py GPL 2 or BSD. A copy (currently old) of Python-Markdown -- the other Python Markdown implementation. - test/markdown.php BSD-style. This is PHP Markdown (http://michelf.com/projects/php-markdown/). - test/Markdown.pl: BSD-style A copy of Perl Markdown (http://daringfireball.net/projects/markdown/). �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/Makefile����������������������������������������������������������������������������0000644�0000765�0000024�00000001614�12345160534�015143� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# python-markdown2 Makefile SHELL=/bin/bash .PHONY: all all: .PHONY: test test: cd test && python testall.py .PHONY: testone testone: cd test && python test.py -- -knownfailure .PHONY: pygments pygments: [[ -d deps/pygments ]] || ( \ mkdir -p deps && \ hg clone https://bitbucket.org/birkenfeld/pygments-main deps/pygments) (cd deps/pygments && hg pull && hg update) # And for Python 3 usage: rm -rf deps/pygments3 mkdir -p deps/pygments3 cp -PR deps/pygments/pygments deps/pygments3/pygments 2to3 -w --no-diffs deps/pygments3/pygments clean: rm -rf build dist MANIFEST .PHONY: versioncheck versioncheck: [[ `grep '^__version_info__' lib/markdown2.py | cut -d'(' -f2 | cut -d')' -f1 | sed 's/, /./g'` \ == `grep '^## ' CHANGES.md | head -1 | awk '{print $$3}'` ]] @echo Version check ok. .PHONY: cutarelease cutarelease: versioncheck ./tools/cutarelease.py -f lib/markdown2.py ��������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/MANIFEST.in�������������������������������������������������������������������������0000644�0000765�0000024�00000000405�13357271745�015251� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������include README.txt include TODO.txt include LICENSE.txt include CONTRIBUTORS.txt include CHANGES.md include Makefile include setup.py include setup.cfg include bin/markdown2 include test/api.doctests recursive-include test/tm-cases *.text *.html *.opts *.tags �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/PKG-INFO����������������������������������������������������������������������������0000644�0000765�0000024�00000001537�13402017660�014600� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Metadata-Version: 1.1 Name: markdown2 Version: 2.3.7 Summary: A fast and complete Python implementation of Markdown Home-page: https://github.com/trentm/python-markdown2 Author: Trent Mick Author-email: trentm@gmail.com License: MIT Description: markdown2: A fast and complete Python implementation of Markdown. Markdown is a text-to-HTML filter; it translates an easy-to-read / easy-to-write structured text format into HTML. Markdown's text format is most similar to that of plain text email, and supports features such as headers, *emphasis*, code blocks, blockquotes, and links. -- http://daringfireball.net/projects/markdown/ This is a fast and complete Python implementation of the Markdown spec. See http://github.com/trentm/python-markdown2 for more info. Platform: any �����������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/setup.cfg���������������������������������������������������������������������������0000644�0000765�0000024�00000000167�13402017660�015322� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[aliases] build = sdist bdist_wheel [wheel] universal = 1 [egg_info] tag_svn_revision = 0 tag_date = 0 tag_build = ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/setup.py����������������������������������������������������������������������������0000644�0000765�0000024�00000004062�13357271745�015230� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env python import os import sys from setuptools import setup _top_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.join(_top_dir, "lib")) try: import markdown2 finally: del sys.path[0] classifiers = """\ Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 2 Programming Language :: Python :: 2.6 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Operating System :: OS Independent Topic :: Software Development :: Libraries :: Python Modules Topic :: Software Development :: Documentation Topic :: Text Processing :: Filters Topic :: Text Processing :: Markup :: HTML """ script = (sys.platform == "win32" and "lib\\markdown2.py" or "bin/markdown2") setup( name="markdown2", version=markdown2.__version__, maintainer="Trent Mick", maintainer_email="trentm@gmail.com", author="Trent Mick", author_email="trentm@gmail.com", url="https://github.com/trentm/python-markdown2", license="MIT", platforms=["any"], py_modules=["markdown2"], package_dir={"": "lib"}, scripts=[script], description="A fast and complete Python implementation of Markdown", classifiers=filter(None, classifiers.split("\n")), long_description="""markdown2: A fast and complete Python implementation of Markdown. Markdown is a text-to-HTML filter; it translates an easy-to-read / easy-to-write structured text format into HTML. Markdown's text format is most similar to that of plain text email, and supports features such as headers, *emphasis*, code blocks, blockquotes, and links. -- http://daringfireball.net/projects/markdown/ This is a fast and complete Python implementation of the Markdown spec. See http://github.com/trentm/python-markdown2 for more info. """, ) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/�������������������������������������������������������������������������������0000755�0000765�0000024�00000000000�13402017660�014454� 5����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/api.doctests�������������������������������������������������������������������0000644�0000765�0000024�00000000543�12240460102�016771� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ >>> import markdown2 >>> hasattr(markdown2, "__version__") True >>> hasattr(markdown2, "__version_info__") True >>> str( markdown2.markdown("*boo*") ) '<p><em>boo</em></p>\n' >>> m = markdown2.Markdown() >>> str( m.convert("*boo*") ) '<p><em>boo</em></p>\n' >>> m = markdown2.MarkdownWithExtras() >>> str( m.convert("*boo*") ) '<p><em>boo</em></p>\n' �������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/test.py������������������������������������������������������������������������0000755�0000765�0000024�00000002366�13347747577�016050� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env python # Copyright (c) 2007-2008 ActiveState Software Inc. # License: MIT (http://www.opensource.org/licenses/mit-license.php) """The markdown2 test suite entry point.""" import os from os.path import exists, join, abspath, dirname, normpath import sys import logging import testlib log = logging.getLogger("test") testdir_from_ns = { None: os.curdir, } def setup(): top_dir = dirname(dirname(abspath(__file__))) lib_dir = join(top_dir, "lib") sys.path.insert(0, lib_dir) # Attempt to get 'pygments' on the import path. try: # If already have it, use that one. import pygments except ImportError: pygments_dir = join(top_dir, "deps", "pygments") if sys.version_info[0] <= 2: sys.path.insert(0, pygments_dir) else: sys.path.insert(0, pygments_dir + "3") if __name__ == "__main__": logging.basicConfig() setup() default_tags = [] try: import pygments except ImportError: log.warning("skipping pygments tests ('pygments' module not found)") default_tags.append("-pygments") retval = testlib.harness(testdir_from_ns=testdir_from_ns, default_tags=default_tags) sys.exit(retval) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/test_markdown2.py��������������������������������������������������������������0000644�0000765�0000024�00000046673�13352553746�020027� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env python # Copyright (c) 2007-2008 ActiveState Software Inc. # License: MIT (http://www.opensource.org/licenses/mit-license.php) """Test the Python markdown2.py.""" import os import sys from os.path import join, dirname, abspath, exists, splitext, basename import re from glob import glob from pprint import pprint import unittest import codecs import difflib import doctest from json import loads as json_loads from testlib import TestError, TestSkipped, tag sys.path.insert(0, join(dirname(dirname(abspath(__file__))))) try: import markdown2 finally: del sys.path[0] #---- Python version compat # Use `bytes` for byte strings and `unicode` for unicode strings (str in Py3). if sys.version_info[0] <= 2: py3 = False try: bytes except NameError: bytes = str base_string_type = basestring elif sys.version_info[0] >= 3: py3 = True unicode = str base_string_type = str unichr = chr #---- Test cases class _MarkdownTestCase(unittest.TestCase): """Helper class for Markdown tests.""" maxDiff = None def _assertMarkdownParity(self, text): """Assert that markdown2.py produces same output as Markdown.pl.""" #TODO add normalization python_html = markdown2.markdown(text) perl_html = _markdown_with_perl(text) close_though = "" if python_html != perl_html \ and (python_html.replace('\n', '') == perl_html.replace('\n', '')): close_though = " (close though -- all but EOLs match)" self.assertEqual(python_html, perl_html, _dedent("""\ markdown2.py didn't produce the same output as Markdown.pl%s: ---- text ---- %s ---- Python markdown2.py HTML ---- %s ---- Perl Markdown.pl HTML ---- %s""") % (close_though, _display(text), _display(python_html), _display(perl_html))) def _assertMarkdownPath(self, text_path, encoding="utf-8", opts=None, toc_html_path=None, metadata_path=None): text = codecs.open(text_path, 'r', encoding=encoding).read() html_path = splitext(text_path)[0] + ".html" html = codecs.open(html_path, 'r', encoding=encoding).read() extra = {} if toc_html_path: extra["toc_html"] = codecs.open(toc_html_path, 'r', encoding=encoding).read() extra["toc_html_path"] = toc_html_path if metadata_path: extra["metadata"] = json_loads( codecs.open(metadata_path, 'r', encoding=encoding).read()) extra["metadata_path"] = metadata_path self._assertMarkdown(text, html, text_path, html_path, opts=opts, **extra) def _assertMarkdown(self, text, html, text_path=None, html_path=None, opts=None, toc_html=None, toc_html_path=None, metadata=None, metadata_path=None): """Assert that markdown2.py produces the expected HTML.""" if text_path is None: text_path = "<text content>" if html_path is None: html_path = "<html content>" if opts is None: opts = {} norm_html = norm_html_from_html(html) python_html = markdown2.markdown(text, **opts) python_norm_html = norm_html_from_html(python_html) close_though = "" if python_norm_html != norm_html \ and (python_norm_html.replace('\n', '') == norm_html.replace('\n', '')): close_though = " (close though -- all but EOLs match)" diff = '' if python_norm_html != norm_html: diff = difflib.unified_diff( norm_html.splitlines(1), python_norm_html.splitlines(1), html_path, "markdown2 "+text_path) diff = ''.join(diff) errmsg = _dedent("""\ markdown2.py didn't produce the expected HTML%s: ---- text (escaping: .=space, \\n=newline) ---- %s ---- Python markdown2.py HTML (escaping: .=space, \\n=newline) ---- %s ---- expected HTML (escaping: .=space, \\n=newline) ---- %s ---- diff ---- %s""") % (close_though, _display(text), _display(python_html), _display(html), _indent(diff)) def charreprreplace(exc): if not isinstance(exc, UnicodeEncodeError): raise TypeError("don't know how to handle %r" % exc) if py3: obj_repr = repr(exc.object[exc.start:exc.end])[1:-1] else: # repr -> remote "u'" and "'" obj_repr = repr(exc.object[exc.start:exc.end])[2:-1] return (unicode(obj_repr), exc.end) codecs.register_error("charreprreplace", charreprreplace) self.assertEqual(python_norm_html, norm_html, errmsg) if toc_html: python_toc_html = python_html.toc_html python_norm_toc_html = norm_html_from_html(python_toc_html) norm_toc_html = norm_html_from_html(toc_html) diff = '' if python_norm_toc_html != norm_toc_html: diff = difflib.unified_diff( norm_toc_html.splitlines(1), python_norm_toc_html.splitlines(1), toc_html_path, "`markdown2 %s`.toc_html" % text_path) diff = ''.join(diff) errmsg = _dedent("""\ markdown2.py didn't produce the expected TOC HTML%s: ---- text (escaping: .=space, \\n=newline) ---- %s ---- Python markdown2.py TOC HTML (escaping: .=space, \\n=newline) ---- %s ---- expected TOC HTML (escaping: .=space, \\n=newline) ---- %s ---- diff ---- %s""") % (close_though, _display(text), _display(python_toc_html), _display(toc_html), _indent(diff)) self.assertEqual(python_norm_toc_html, norm_toc_html, errmsg.encode('utf-8', 'charreprreplace')) if metadata: self.assertEqual(python_html.metadata, metadata) def generate_tests(cls): """Add test methods to this class for each test file in `cls.cases_dir'. """ cases_pat = join(dirname(__file__), cls.cases_dir, "*.text") for text_path in glob(cases_pat): # Load an options (`*.opts` file, if any). # It must be a Python dictionary. It will be passed as # kwargs to the markdown function. opts = {} opts_path = splitext(text_path)[0] + ".opts" if exists(opts_path): try: opts = eval(open(opts_path, 'r').read()) except Exception: _, ex, _ = sys.exc_info() print("WARNING: couldn't load `%s' opts file: %s" \ % (opts_path, ex)) toc_html_path = splitext(text_path)[0] + ".toc_html" if not exists(toc_html_path): toc_html_path = None metadata_path = splitext(text_path)[0] + ".metadata" if not exists(metadata_path): metadata_path = None test_func = lambda self, t=text_path, o=opts, c=toc_html_path, \ m=metadata_path: \ self._assertMarkdownPath(t, opts=o, toc_html_path=c, metadata_path=m) tags_path = splitext(text_path)[0] + ".tags" if exists(tags_path): tags = [] for line in open(tags_path): if '#' in line: # allow comments in .tags files line = line[:line.index('#')] tags += line.split() test_func.tags = tags name = splitext(basename(text_path))[0] name = name.replace(' - ', '_') name = name.replace(' ', '_') name = re.sub("[(),]", "", name) test_name = "test_%s" % name setattr(cls, test_name, test_func) generate_tests = classmethod(generate_tests) class TMTestCase(_MarkdownTestCase): cases_dir = "tm-cases" class MarkdownTestTestCase(_MarkdownTestCase): """Test cases from MarkdownTest-1.0.""" cases_dir = "markdowntest-cases" class PHPMarkdownTestCase(_MarkdownTestCase): """Test cases from MDTest.""" cases_dir = "php-markdown-cases" class PHPMarkdownExtraTestCase(_MarkdownTestCase): """Test cases from MDTest. These are all knownfailures because these test non-standard Markdown syntax no implemented in markdown2.py. See <http://www.michelf.com/projects/php-markdown/extra/> for details. """ __tags__ = ["knownfailure"] cases_dir = "php-markdown-extra-cases" class DirectTestCase(_MarkdownTestCase): """These are specific test that I found were broken in Python-markdown (markdown.py). """ def test_slow_hr(self): import time text = """\ * * * This on *almost* looks like an hr, except for the trailing '+'. In older versions of markdown2.py this was pathologically slow: - - - - - - - - - - - - - - - - - - - - - - - - - + """ html = """\ <hr /> <p>This on <em>almost</em> looks like an hr, except for the trailing '+'. In older versions of markdown2.py this was pathologically slow:</p> <p>- - - - - - - - - - - - - - - - - - - - - - - - - +</p> """ start = time.time() self._assertMarkdown(text, html) end = time.time() delta = end - start self.assertTrue(delta < 1.0, "It took more than 1s to process " "'slow-hr'. It took %.2fs. Too slow!" % delta) test_slow_hr.tags = ["perf"] def test_code_in_strong(self): self._assertMarkdown( '**look at `this code` call**', '<p><strong>look at <code>this code</code> call</strong></p>\n') test_code_in_strong.tags = ["code", "strong"] def test_starter_pre(self): self._assertMarkdown( _indent('#!/usr/bin/python\nprint "hi"'), '<pre><code>#!/usr/bin/python\nprint "hi"\n</code></pre>\n') test_starter_pre.tags = ["pre", "recipes"] def test_pre(self): self._assertMarkdown(_dedent('''\ some starter text #!/usr/bin/python print "hi"'''), '<p>some starter text</p>\n\n<pre><code>#!/usr/bin/python\nprint "hi"\n</code></pre>\n') def test_russian(self): ko = '\u043b\u0449' # 'ko' on russian keyboard self._assertMarkdown("## %s" % ko, '<h2>%s</h2>\n' % ko) test_russian.tags = ["unicode", "issue3"] class DocTestsTestCase(unittest.TestCase): def test_api(self): test = doctest.DocFileTest("api.doctests") test.runTest() # Don't bother on Python 3 because (a) there aren't many inline doctests, # and (b) they are more to be didactic than comprehensive test suites. if not py3: def test_internal(self): doctest.testmod(markdown2) #---- internal support stuff _xml_escape_re = re.compile(r'&#(x[0-9A-Fa-f]{2,3}|[0-9]{2,3});') def _xml_escape_sub(match): escape = match.group(1) if escape[0] == 'x': return unichr(int('0'+escape, base=16)) else: return unichr(int(escape)) _markdown_email_link_re = re.compile(r'<a href="(.*?&#.*?)">(.*?)</a>', re.U) def _markdown_email_link_sub(match): href, text = match.groups() href = _xml_escape_re.sub(_xml_escape_sub, href) text = _xml_escape_re.sub(_xml_escape_sub, text) return '<a href="%s">%s</a>' % (href, text) def norm_html_from_html(html): """Normalize (somewhat) Markdown'd HTML. Part of Markdown'ing involves obfuscating email links with randomize encoding. Undo that obfuscation. Also normalize EOLs. """ if not isinstance(html, unicode): html = html.decode('utf-8') html = _markdown_email_link_re.sub( _markdown_email_link_sub, html) if sys.platform == "win32": html = html.replace('\r\n', '\n') return html def _display(s): """Markup the given string for useful display.""" if not isinstance(s, unicode): s = s.decode("utf-8") s = _indent(_escaped_text_from_text(s, "whitespace"), 4) if not s.endswith('\n'): s += '\n' return s def _markdown_with_perl(text): markdown_pl = join(dirname(__file__), "Markdown.pl") if not exists(markdown_pl): raise OSError("`%s' does not exist: get it from " "http://daringfireball.net/projects/markdown/" % markdown_pl) i, o = os.popen2("perl %s" % markdown_pl) i.write(text) i.close() html = o.read() o.close() return html # Recipe: dedent (0.1.2) def _dedentlines(lines, tabsize=8, skip_first_line=False): """_dedentlines(lines, tabsize=8, skip_first_line=False) -> dedented lines "lines" is a list of lines to dedent. "tabsize" is the tab width to use for indent width calculations. "skip_first_line" is a boolean indicating if the first line should be skipped for calculating the indent width and for dedenting. This is sometimes useful for docstrings and similar. Same as dedent() except operates on a sequence of lines. Note: the lines list is modified **in-place**. """ DEBUG = False if DEBUG: print("dedent: dedent(..., tabsize=%d, skip_first_line=%r)"\ % (tabsize, skip_first_line)) indents = [] margin = None for i, line in enumerate(lines): if i == 0 and skip_first_line: continue indent = 0 for ch in line: if ch == ' ': indent += 1 elif ch == '\t': indent += tabsize - (indent % tabsize) elif ch in '\r\n': continue # skip all-whitespace lines else: break else: continue # skip all-whitespace lines if DEBUG: print("dedent: indent=%d: %r" % (indent, line)) if margin is None: margin = indent else: margin = min(margin, indent) if DEBUG: print("dedent: margin=%r" % margin) if margin is not None and margin > 0: for i, line in enumerate(lines): if i == 0 and skip_first_line: continue removed = 0 for j, ch in enumerate(line): if ch == ' ': removed += 1 elif ch == '\t': removed += tabsize - (removed % tabsize) elif ch in '\r\n': if DEBUG: print("dedent: %r: EOL -> strip up to EOL" % line) lines[i] = lines[i][j:] break else: raise ValueError("unexpected non-whitespace char %r in " "line %r while removing %d-space margin" % (ch, line, margin)) if DEBUG: print("dedent: %r: %r -> removed %d/%d"\ % (line, ch, removed, margin)) if removed == margin: lines[i] = lines[i][j+1:] break elif removed > margin: lines[i] = ' '*(removed-margin) + lines[i][j+1:] break else: if removed: lines[i] = lines[i][removed:] return lines def _dedent(text, tabsize=8, skip_first_line=False): """_dedent(text, tabsize=8, skip_first_line=False) -> dedented text "text" is the text to dedent. "tabsize" is the tab width to use for indent width calculations. "skip_first_line" is a boolean indicating if the first line should be skipped for calculating the indent width and for dedenting. This is sometimes useful for docstrings and similar. textwrap.dedent(s), but don't expand tabs to spaces """ lines = text.splitlines(1) _dedentlines(lines, tabsize=tabsize, skip_first_line=skip_first_line) return ''.join(lines) # Recipe: indent (0.2.1) def _indent(s, width=4, skip_first_line=False): """_indent(s, [width=4]) -> 's' indented by 'width' spaces The optional "skip_first_line" argument is a boolean (default False) indicating if the first line should NOT be indented. """ lines = s.splitlines(1) indentstr = ' '*width if skip_first_line: return indentstr.join(lines) else: return indentstr + indentstr.join(lines) # Recipe: text_escape (0.1) def _escaped_text_from_text(text, escapes="eol"): r"""Return escaped version of text. "escapes" is either a mapping of chars in the source text to replacement text for each such char or one of a set of strings identifying a particular escape style: eol replace EOL chars with '\r' and '\n', maintain the actual EOLs though too whitespace replace EOL chars as above, tabs with '\t' and spaces with periods ('.') eol-one-line replace EOL chars with '\r' and '\n' whitespace-one-line replace EOL chars as above, tabs with '\t' and spaces with periods ('.') """ #TODO: # - Add 'c-string' style. # - Add _escaped_html_from_text() with a similar call sig. import re if isinstance(escapes, base_string_type): if escapes == "eol": escapes = {'\r\n': "\\r\\n\r\n", '\n': "\\n\n", '\r': "\\r\r"} elif escapes == "whitespace": escapes = {'\r\n': "\\r\\n\r\n", '\n': "\\n\n", '\r': "\\r\r", '\t': "\\t", ' ': "."} elif escapes == "eol-one-line": escapes = {'\n': "\\n", '\r': "\\r"} elif escapes == "whitespace-one-line": escapes = {'\n': "\\n", '\r': "\\r", '\t': "\\t", ' ': '.'} else: raise ValueError("unknown text escape style: %r" % escapes) # Sort longer replacements first to allow, e.g. '\r\n' to beat '\r' and # '\n'. escapes_keys = list(escapes.keys()) escapes_keys.sort(key=lambda a: len(a), reverse=True) def repl(match): val = escapes[match.group(0)] return val escaped = re.sub("(%s)" % '|'.join([re.escape(k) for k in escapes_keys]), repl, text) return escaped def _one_line_summary_from_text(text, length=78, escapes={'\n':"\\n", '\r':"\\r", '\t':"\\t"}): r"""Summarize the given text with one line of the given length. "text" is the text to summarize "length" (default 78) is the max length for the summary "escapes" is a mapping of chars in the source text to replacement text for each such char. By default '\r', '\n' and '\t' are escaped with their '\'-escaped repr. """ if len(text) > length: head = text[:length-3] else: head = text escaped = _escaped_text_from_text(head, escapes) if len(text) > length: summary = escaped[:length-3] + "..." else: summary = escaped return summary #---- hook for testlib def test_cases(): """This is called by test.py to build up the test cases.""" TMTestCase.generate_tests() yield TMTestCase MarkdownTestTestCase.generate_tests() yield MarkdownTestTestCase PHPMarkdownTestCase.generate_tests() yield PHPMarkdownTestCase PHPMarkdownExtraTestCase.generate_tests() yield PHPMarkdownExtraTestCase yield DirectTestCase yield DocTestsTestCase ���������������������������������������������������������������������markdown2-2.3.7/test/testall.py���������������������������������������������������������������������0000644�0000765�0000024�00000003117�13357265576�016524� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env python # # Run the test suite against all the Python versions we can find. # from __future__ import print_function import sys import os from os.path import dirname, abspath, join import re TOP = dirname(dirname(abspath(__file__))) sys.path.insert(0, join(TOP, "tools")) import which def _python_ver_from_python(python): assert ' ' not in python o = os.popen('''%s -c "import sys; print(sys.version)"''' % python) ver_str = o.read().strip() ver_bits = re.split("\.|[^\d]", ver_str, 2)[:2] ver = tuple(map(int, ver_bits)) return ver def _gen_python_names(): yield "python" for ver in [(2,6), (2,7), (3,3), (3,4), (3,5), (3,6), (3,7)]: yield "python%d.%d" % ver if sys.platform == "win32": yield "python%d%d" % ver def _gen_pythons(): python_from_ver = {} for name in _gen_python_names(): for python in which.whichall(name): ver = _python_ver_from_python(python) if ver not in python_from_ver: python_from_ver[ver] = python for ver, python in sorted(python_from_ver.items()): yield ver, python def testall(): for ver, python in _gen_pythons(): if ver < (2,6) or ver in ((3,0), (3,1), (3,2)): # Don't support Python < 2.6, 3.0/3.1/3.2. continue ver_str = "%s.%s" % ver print("-- test with Python %s (%s)" % (ver_str, python)) assert ' ' not in python rv = os.system("MACOSX_DEPLOYMENT_TARGET= %s test.py -- -knownfailure" % python) if rv: sys.exit(os.WEXITSTATUS(rv)) testall() �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/testlib.py���������������������������������������������������������������������0000644�0000765�0000024�00000062612�13352553746�016521� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!python # Copyright (c) 2000-2008 ActiveState Software Inc. # License: MIT License (http://www.opensource.org/licenses/mit-license.php) """ test suite harness Usage: test --list [<tags>...] # list available tests modules test [<tags>...] # run test modules Options: -v, --verbose more verbose output -q, --quiet don't print anything except if a test fails -d, --debug log debug information -h, --help print this text and exit -l, --list Just list the available test modules. You can also specify tags to play with module filtering. -n, --no-default-tags Ignore default tags -L <directive> Specify a logging level via <logname>:<levelname> For example: codeintel.db:DEBUG This option can be used multiple times. By default this will run all tests in all available "test_*" modules. Tags can be specified to control which tests are run. For example: test python # run tests with the 'python' tag test python cpln # run tests with both 'python' and 'cpln' tags test -- -python # exclude tests with the 'python' tag # (the '--' is necessary to end the option list) The full name and base name of a test module are implicit tags for that module, e.g. module "test_xdebug.py" has tags "test_xdebug" and "xdebug". A TestCase's class name (with and without "TestCase") is an implicit tag for an test_* methods. A "test_foo" method also has "test_foo" and "foo" implicit tags. Tags can be added explicitly added: - to modules via a __tags__ global list; and - to individual test_* methods via a "tags" attribute list (you can use the testlib.tag() decorator for this). """ #TODO: # - Document how tests are found (note the special "test_cases()" and # "test_suite_class" hooks). # - See the optparse "TODO" below. # - Make the quiet option actually quiet. __version_info__ = (0, 6, 6) __version__ = '.'.join(map(str, __version_info__)) import os from os.path import join, basename, dirname, abspath, splitext, \ isfile, isdir, normpath, exists import sys import getopt import glob import time import types import tempfile import unittest from pprint import pprint import imp import optparse import logging import textwrap import traceback #---- globals and exceptions log = logging.getLogger("test") #---- exports generally useful to test cases class TestError(Exception): pass class TestSkipped(Exception): """Raise this to indicate that a test is being skipped. ConsoleTestRunner knows to interpret these at NOT failures. """ pass class TestFailed(Exception): pass def tag(*tags): """Decorator to add tags to test_* functions. Example: class MyTestCase(unittest.TestCase): @testlib.tag("knownfailure") def test_foo(self): #... """ def decorate(f): if not hasattr(f, "tags"): f.tags = [] f.tags += tags return f return decorate #---- timedtest decorator # Use this to assert that a test completes in a given amount of time. # This is from http://www.artima.com/forums/flat.jsp?forum=122&thread=129497 # Including here, becase it might be useful. # NOTE: Untested and I suspect some breakage. TOLERANCE = 0.05 class DurationError(AssertionError): pass def timedtest(max_time, tolerance=TOLERANCE): """ timedtest decorator decorates the test method with a timer when the time spent by the test exceeds max_time in seconds, an Assertion error is thrown. """ def _timedtest(function): def wrapper(*args, **kw): start_time = time.time() try: function(*args, **kw) finally: total_time = time.time() - start_time if total_time > max_time + tolerance: raise DurationError(('Test was too long (%.2f s)' % total_time)) return wrapper return _timedtest #---- module api class Test(object): def __init__(self, ns, testmod, testcase, testfn_name, testsuite_class=None): self.ns = ns self.testmod = testmod self.testcase = testcase self.testfn_name = testfn_name self.testsuite_class = testsuite_class # Give each testcase some extra testlib attributes for useful # introspection on TestCase instances later on. self.testcase._testlib_shortname_ = self.shortname() self.testcase._testlib_explicit_tags_ = self.explicit_tags() self.testcase._testlib_implicit_tags_ = self.implicit_tags() def __str__(self): return self.shortname() def __repr__(self): return "<Test %s>" % self.shortname() def shortname(self): bits = [self._normname(self.testmod.__name__), self._normname(self.testcase.__class__.__name__), self._normname(self.testfn_name)] if self.ns: bits.insert(0, self.ns) return '/'.join(bits) def _flatten_tags(self, tags): """Split tags with '/' in them into multiple tags. '/' is the reserved tag separator and allowing tags with embedded '/' results in one being unable to select those via filtering. As long as tag order is stable then presentation of these subsplit tags should be fine. """ flattened = [] for t in tags: flattened += t.split('/') return flattened def explicit_tags(self): tags = [] if hasattr(self.testmod, "__tags__"): tags += self.testmod.__tags__ if hasattr(self.testcase, "__tags__"): tags += self.testcase.__tags__ testfn = getattr(self.testcase, self.testfn_name) if hasattr(testfn, "tags"): tags += testfn.tags return self._flatten_tags(tags) def implicit_tags(self): tags = [ self.testmod.__name__.lower(), self._normname(self.testmod.__name__), self.testcase.__class__.__name__.lower(), self._normname(self.testcase.__class__.__name__), self.testfn_name, self._normname(self.testfn_name), ] if self.ns: tags.insert(0, self.ns) return self._flatten_tags(tags) def tags(self): return self.explicit_tags() + self.implicit_tags() def doc(self): testfn = getattr(self.testcase, self.testfn_name) return testfn.__doc__ or "" def _normname(self, name): if name.startswith("test_"): return name[5:].lower() elif name.startswith("test"): return name[4:].lower() elif name.endswith("TestCase"): return name[:-8].lower() else: return name def testmod_paths_from_testdir(testdir): """Generate test module paths in the given dir.""" for path in glob.glob(join(testdir, "test_*.py")): yield path for path in glob.glob(join(testdir, "test_*")): if not isdir(path): continue if not isfile(join(path, "__init__.py")): continue yield path def testmods_from_testdir(testdir): """Generate test modules in the given test dir. Modules are imported with 'testdir' first on sys.path. """ testdir = normpath(testdir) for testmod_path in testmod_paths_from_testdir(testdir): testmod_name = splitext(basename(testmod_path))[0] log.debug("import test module '%s'", testmod_path) try: iinfo = imp.find_module(testmod_name, [dirname(testmod_path)]) testabsdir = abspath(testdir) sys.path.insert(0, testabsdir) old_dir = os.getcwd() os.chdir(testdir) try: testmod = imp.load_module(testmod_name, *iinfo) finally: os.chdir(old_dir) sys.path.remove(testabsdir) except TestSkipped: _, ex, _ = sys.exc_info() log.warning("'%s' module skipped: %s", testmod_name, ex) except Exception: _, ex, _ = sys.exc_info() log.warning("could not import test module '%s': %s (skipping, " "run with '-d' for full traceback)", testmod_path, ex) if log.isEnabledFor(logging.DEBUG): traceback.print_exc() else: yield testmod def testcases_from_testmod(testmod): """Gather tests from a 'test_*' module. Returns a list of TestCase-subclass instances. One instance for each found test function. In general the normal unittest TestLoader.loadTests*() semantics are used for loading tests with some differences: - TestCase subclasses beginning with '_' are skipped (presumed to be internal). - If the module has a top-level "test_cases", it is called for a list of TestCase subclasses from which to load tests (can be a generator). This allows for run-time setup of test cases. - If the module has a top-level "test_suite_class", it is used to group all test cases from that module into an instance of that TestSuite subclass. This allows for overriding of test running behaviour. """ class TestListLoader(unittest.TestLoader): suiteClass = list loader = TestListLoader() if hasattr(testmod, "test_cases"): try: for testcase_class in testmod.test_cases(): if testcase_class.__name__.startswith("_"): log.debug("skip private TestCase class '%s'", testcase_class.__name__) continue for testcase in loader.loadTestsFromTestCase(testcase_class): yield testcase except Exception: _, ex, _ = sys.exc_info() testmod_path = testmod.__file__ if testmod_path.endswith(".pyc"): testmod_path = testmod_path[:-1] log.warning("error running test_cases() in '%s': %s (skipping, " "run with '-d' for full traceback)", testmod_path, ex) if log.isEnabledFor(logging.DEBUG): traceback.print_exc() else: class_names_skipped = [] for testcases in loader.loadTestsFromModule(testmod): for testcase in testcases: class_name = testcase.__class__.__name__ if class_name in class_names_skipped: pass elif class_name.startswith("_"): log.debug("skip private TestCase class '%s'", class_name) class_names_skipped.append(class_name) else: yield testcase def tests_from_manifest(testdir_from_ns): """Return a list of `testlib.Test` instances for each test found in the manifest. There will be a test for (a) each "test*" function of (b) each TestCase-subclass in (c) each "test_*" Python module in (d) each test dir in the manifest. If a "test_*" module has a top-level "test_suite_class", it will later be used to group all test cases from that module into an instance of that TestSuite subclass. This allows for overriding of test running behaviour. """ for ns, testdir in testdir_from_ns.items(): for testmod in testmods_from_testdir(testdir): if hasattr(testmod, "test_suite_class"): testsuite_class = testmod.test_suite_class if not issubclass(testsuite_class, unittest.TestSuite): testmod_path = testmod.__file__ if testmod_path.endswith(".pyc"): testmod_path = testmod_path[:-1] log.warning("'test_suite_class' of '%s' module is not a " "subclass of 'unittest.TestSuite': ignoring", testmod_path) else: testsuite_class = None for testcase in testcases_from_testmod(testmod): yield Test(ns, testmod, testcase, testcase._testMethodName, testsuite_class) def tests_from_manifest_and_tags(testdir_from_ns, tags): include_tags = [tag.lower() for tag in tags if not tag.startswith('-')] exclude_tags = [tag[1:].lower() for tag in tags if tag.startswith('-')] for test in tests_from_manifest(testdir_from_ns): test_tags = [t.lower() for t in test.tags()] matching_exclude_tags = [t for t in exclude_tags if t in test_tags] if matching_exclude_tags: #log.debug("test '%s' matches exclude tag(s) '%s': skipping", # test.shortname(), "', '".join(matching_exclude_tags)) continue if not include_tags: yield test else: for tag in include_tags: if tag not in test_tags: #log.debug("test '%s' does not match tag '%s': skipping", # test.shortname(), tag) break else: #log.debug("test '%s' matches tags: %s", test.shortname(), # ' '.join(tags)) yield test def test(testdir_from_ns, tags=[], setup_func=None): log.debug("test(testdir_from_ns=%r, tags=%r, ...)", testdir_from_ns, tags) if setup_func is not None: setup_func() tests = list(tests_from_manifest_and_tags(testdir_from_ns, tags)) if not tests: return None # Groups test cases into a test suite class given by their test module's # "test_suite_class" hook, if any. suite = unittest.TestSuite() suite_for_testmod = None testmod = None for test in tests: if test.testmod != testmod: if suite_for_testmod is not None: suite.addTest(suite_for_testmod) suite_for_testmod = (test.testsuite_class or unittest.TestSuite)() testmod = test.testmod suite_for_testmod.addTest(test.testcase) if suite_for_testmod is not None: suite.addTest(suite_for_testmod) runner = ConsoleTestRunner(sys.stdout) result = runner.run(suite) return result def list_tests(testdir_from_ns, tags): # Say I have two test_* modules: # test_python.py: # __tags__ = ["guido"] # class BasicTestCase(unittest.TestCase): # def test_def(self): # def test_class(self): # class ComplexTestCase(unittest.TestCase): # def test_foo(self): # def test_bar(self): # test_perl/__init__.py: # __tags__ = ["larry", "wall"] # class BasicTestCase(unittest.TestCase): # def test_sub(self): # def test_package(self): # class EclecticTestCase(unittest.TestCase): # def test_foo(self): # def test_bar(self): # The short-form list output for this should look like: # python/basic/def [guido] # python/basic/class [guido] # python/complex/foo [guido] # python/complex/bar [guido] # perl/basic/sub [larry, wall] # perl/basic/package [larry, wall] # perl/eclectic/foo [larry, wall] # perl/eclectic/bar [larry, wall] log.debug("list_tests(testdir_from_ns=%r, tags=%r)", testdir_from_ns, tags) tests = list(tests_from_manifest_and_tags(testdir_from_ns, tags)) if not tests: return WIDTH = 78 if log.isEnabledFor(logging.INFO): # long-form for i, t in enumerate(tests): if i: print() testfile = t.testmod.__file__ if testfile.endswith(".pyc"): testfile = testfile[:-1] print("%s:" % t.shortname()) print(" from: %s#%s.%s" % (testfile, t.testcase.__class__.__name__, t.testfn_name)) wrapped = textwrap.fill(' '.join(t.tags()), WIDTH-10) print(" tags: %s" % _indent(wrapped, 8, True)) if t.doc(): print(_indent(t.doc(), width=2)) else: for t in tests: line = t.shortname() + ' ' if t.explicit_tags(): line += '[%s]' % ' '.join(t.explicit_tags()) print(line) #---- text test runner that can handle TestSkipped reasonably class ConsoleTestResult(unittest.TestResult): """A test result class that can print formatted text results to a stream. Used by ConsoleTestRunner. """ separator1 = '=' * 70 separator2 = '-' * 70 def __init__(self, stream): unittest.TestResult.__init__(self) self.skips = [] self.stream = stream def getDescription(self, test): if test._testlib_explicit_tags_: return "%s [%s]" % (test._testlib_shortname_, ', '.join(test._testlib_explicit_tags_)) else: return test._testlib_shortname_ def startTest(self, test): unittest.TestResult.startTest(self, test) self.stream.write(self.getDescription(test)) self.stream.write(" ... ") def addSuccess(self, test): unittest.TestResult.addSuccess(self, test) self.stream.write("ok\n") def addSkip(self, test, err): why = str(err[1]) self.skips.append((test, why)) self.stream.write("skipped (%s)\n" % why) def addError(self, test, err): if isinstance(err[1], TestSkipped): self.addSkip(test, err) else: unittest.TestResult.addError(self, test, err) self.stream.write("ERROR\n") def addFailure(self, test, err): unittest.TestResult.addFailure(self, test, err) self.stream.write("FAIL\n") def printSummary(self): self.stream.write('\n') self.printErrorList('ERROR', self.errors) self.printErrorList('FAIL', self.failures) def printErrorList(self, flavour, errors): for test, err in errors: self.stream.write(self.separator1 + '\n') self.stream.write("%s: %s\n" % (flavour, self.getDescription(test))) self.stream.write(self.separator2 + '\n') self.stream.write("%s\n" % err) class ConsoleTestRunner(object): """A test runner class that displays results on the console. It prints out the names of tests as they are run, errors as they occur, and a summary of the results at the end of the test run. Differences with unittest.TextTestRunner: - adds support for *skipped* tests (those that raise TestSkipped) - no verbosity option (only have equiv of verbosity=2) - test "short desc" is it 3-level tag name (e.g. 'foo/bar/baz' where that identifies: 'test_foo.py::BarTestCase.test_baz'. """ def __init__(self, stream=sys.stderr): self.stream = stream def run(self, test_or_suite, test_result_class=ConsoleTestResult): """Run the given test case or test suite.""" result = test_result_class(self.stream) start_time = time.time() test_or_suite.run(result) time_taken = time.time() - start_time result.printSummary() self.stream.write(result.separator2 + '\n') self.stream.write("Ran %d test%s in %.3fs\n\n" % (result.testsRun, result.testsRun != 1 and "s" or "", time_taken)) details = [] num_skips = len(result.skips) if num_skips: details.append("%d skip%s" % (num_skips, (num_skips != 1 and "s" or ""))) if not result.wasSuccessful(): num_failures = len(result.failures) if num_failures: details.append("%d failure%s" % (num_failures, (num_failures != 1 and "s" or ""))) num_errors = len(result.errors) if num_errors: details.append("%d error%s" % (num_errors, (num_errors != 1 and "s" or ""))) self.stream.write("FAILED (%s)\n" % ', '.join(details)) elif details: self.stream.write("OK (%s)\n" % ', '.join(details)) else: self.stream.write("OK\n") return result #---- internal support stuff # Recipe: indent (0.2.1) def _indent(s, width=4, skip_first_line=False): """_indent(s, [width=4]) -> 's' indented by 'width' spaces The optional "skip_first_line" argument is a boolean (default False) indicating if the first line should NOT be indented. """ lines = s.splitlines(1) indentstr = ' '*width if skip_first_line: return indentstr.join(lines) else: return indentstr + indentstr.join(lines) #---- mainline #TODO: pass in add_help_option=False and add it ourself here. ## Optparse's handling of the doc passed in for -h|--help handling is ## abysmal. Hence we'll stick with getopt. #def _parse_opts(args): # """_parse_opts(args) -> (options, tags)""" # usage = "usage: %prog [OPTIONS...] [TAGS...]" # parser = optparse.OptionParser(prog="test", usage=usage, # description=__doc__) # parser.add_option("-v", "--verbose", dest="log_level", # action="store_const", const=logging.DEBUG, # help="more verbose output") # parser.add_option("-q", "--quiet", dest="log_level", # action="store_const", const=logging.WARNING, # help="quieter output") # parser.add_option("-l", "--list", dest="action", # action="store_const", const="list", # help="list available tests") # parser.set_defaults(log_level=logging.INFO, action="test") # opts, raw_tags = parser.parse_args() # # # Trim '.py' from user-supplied tags. They might have gotten there # # via shell expansion. # ... # # return opts, raw_tags def _parse_opts(args, default_tags): """_parse_opts(args) -> (log_level, action, tags)""" opts, raw_tags = getopt.getopt(args, "hvqdlL:n", ["help", "verbose", "quiet", "debug", "list", "no-default-tags"]) log_level = logging.WARN action = "test" no_default_tags = False for opt, optarg in opts: if opt in ("-h", "--help"): action = "help" elif opt in ("-v", "--verbose"): log_level = logging.INFO elif opt in ("-q", "--quiet"): log_level = logging.ERROR elif opt in ("-d", "--debug"): log_level = logging.DEBUG elif opt in ("-l", "--list"): action = "list" elif opt in ("-n", "--no-default-tags"): no_default_tags = True elif opt == "-L": # Optarg is of the form '<logname>:<levelname>', e.g. # "codeintel:DEBUG", "codeintel.db:INFO". lname, llevelname = optarg.split(':', 1) llevel = getattr(logging, llevelname) logging.getLogger(lname).setLevel(llevel) # Clean up the given tags. if no_default_tags: tags = [] else: tags = default_tags for raw_tag in raw_tags: if splitext(raw_tag)[1] in (".py", ".pyc", ".pyo", ".pyw") \ and exists(raw_tag): # Trim '.py' from user-supplied tags if it looks to be from # shell expansion. tags.append(splitext(raw_tag)[0]) elif '/' in raw_tag: # Split one '/' to allow the shortname from the test listing # to be used as a filter. tags += raw_tag.split('/') else: tags.append(raw_tag) return log_level, action, tags def harness(testdir_from_ns={None: os.curdir}, argv=sys.argv, setup_func=None, default_tags=None): """Convenience mainline for a test harness "test.py" script. "testdir_from_ns" (optional) is basically a set of directories in which to look for test cases. It is a dict with: <namespace>: <testdir> where <namespace> is a (short) string that becomes part of the included test names and an implicit tag for filtering those tests. By default the current dir is use with an empty namespace: {None: os.curdir} "setup_func" (optional) is a callable that will be called once before any tests are run to prepare for the test suite. It is not called if no tests will be run. "default_tags" (optional) Typically, if you have a number of test_*.py modules you can create a test harness, "test.py", for them that looks like this: #!/usr/bin/env python if __name__ == "__main__": retval = testlib.harness() sys.exit(retval) """ if not logging.root.handlers: logging.basicConfig() try: log_level, action, tags = _parse_opts(argv[1:], default_tags or []) except getopt.error: _, ex, _ = sys.exc_info() log.error(str(ex) + " (did you need a '--' before a '-TAG' argument?)") return 1 log.setLevel(log_level) if action == "help": print(__doc__) return 0 if action == "list": return list_tests(testdir_from_ns, tags) elif action == "test": result = test(testdir_from_ns, tags, setup_func=setup_func) if result is None: return None return len(result.errors) + len(result.failures) else: raise TestError("unexpected action/mode: '%s'" % action) ����������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/����������������������������������������������������������������������0000755�0000765�0000024�00000000000�13402017660�016170� 5����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/ampersands.html�������������������������������������������������������0000644�0000765�0000024�00000000131�13166755316�021224� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>&</p> <p>AT&T</p> <p>AT&T</p> <p><a href="/">AT&T AT&T</a></p> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/ampersands.tags�������������������������������������������������������0000644�0000765�0000024�00000000015�13166755316�021217� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������htmlentities �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/ampersands.text�������������������������������������������������������0000644�0000765�0000024�00000000046�13166755316�021251� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������& AT&T AT&T [AT&T AT&T](/) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/auto_link.html��������������������������������������������������������0000644�0000765�0000024�00000000613�12240460102�021033� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>I can has autolink? <a href="http://icanhascheeseburger.com">http://icanhascheeseburger.com</a></p> <p>Ask garfield: <a href="mailto:garfield@example.com">garfield@example.com</a></p> ���������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/auto_link.text��������������������������������������������������������0000644�0000765�0000024�00000000133�12240460102�021050� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������I can has autolink? <http://icanhascheeseburger.com> Ask garfield: <garfield@example.com> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/auto_link_email_with_underscore.html����������������������������������0000644�0000765�0000024�00000002643�12240460102�025473� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Auto-link email with underscores failed at one point: - <a href="mailto:foo_bar@example.com">foo_bar@example.com</a> - <a href="mailto:foo@_example.com">foo@_example.com</a> - <a href="mailto:foo@an_example.com">foo@an_example.com</a> - <a href="mailto:foo@_example_.com">foo@_example_.com</a> - <a href="mailto:nounderscore@example.com">nounderscore@example.com</a> - <a href="mailto:check_this_out@coolpeople.com">check_this_out@coolpeople.com</a></p> ���������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/auto_link_email_with_underscore.tags����������������������������������0000644�0000765�0000024�00000000010�12240460102�025447� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue26 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/auto_link_email_with_underscore.text����������������������������������0000644�0000765�0000024�00000000317�12240460102�025507� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Auto-link email with underscores failed at one point: - <foo_bar@example.com> - <foo@_example.com> - <foo@an_example.com> - <foo@_example_.com> - <nounderscore@example.com> - <check_this_out@coolpeople.com> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/auto_link_safe_mode.html����������������������������������������������0000644�0000765�0000024�00000000613�12240460102�023035� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>I can has autolink? <a href="http://icanhascheeseburger.com">http://icanhascheeseburger.com</a></p> <p>Ask garfield: <a href="mailto:garfield@example.com">garfield@example.com</a></p> ���������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/auto_link_safe_mode.opts����������������������������������������������0000644�0000765�0000024�00000000024�12240460102�023052� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{'safe_mode': True} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/auto_link_safe_mode.tags����������������������������������������������0000644�0000765�0000024�00000000021�12240460102�023020� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue7 safe_mode ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/auto_link_safe_mode.text����������������������������������������������0000644�0000765�0000024�00000000133�12240460102�023052� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������I can has autolink? <http://icanhascheeseburger.com> Ask garfield: <garfield@example.com> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/basic_safe_mode.html��������������������������������������������������0000644�0000765�0000024�00000002136�13352552071�022147� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>blah [HTML_REMOVED] blah</p> <p>[HTML_REMOVED]yowzer![HTML_REMOVED]</p> <p>blah</p> <p>[HTML_REMOVED]alert(1)[HTML_REMOVED]</p> <p><a href="http://example.com"onclick="alert(1)">link1</a></p> <p><a href="http://example.com" title="title"onclick="alert(1)">link2</a></p> <p><a href="http://example.com>[HTML_REMOVED]alert(1)[HTML_REMOVED]">link3</a></p> <p><a href="http://example.com>[HTML_REMOVED]alert(1)[HTML_REMOVED]">link4 >[HTML_REMOVED]alert(1)[HTML_REMOVED]</a></p> <p><a href="#">link5</a></p> <p><a href="#">link6</a></p> <p><a href="#">link7</a></p> <p><img src="http://example.com/image.gif?h=200&w=500" alt="ok img" /></p> <p><img src="http://example.com"onclick="alert(1)" alt="img" /></p> <p><img src="http://example.com" alt="img2" title="text"onclick="alert(1)" /></p> <p><img src="http://example.com>[HTML_REMOVED]alert(1)[HTML_REMOVED]" alt="img3" /></p> <p><img src="javascript:alert(1)"</p> <p><img src="http://example.com/image.gif?h=200&w=500" alt="ok img" /></p> <p><a href="http://example.com">link ok</a></p> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/basic_safe_mode.opts��������������������������������������������������0000644�0000765�0000024�00000000133�12240460102�022147� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Use the old (for-compat-only) way of specifying "replace" safe mode. {"safe_mode": True} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/basic_safe_mode.tags��������������������������������������������������0000644�0000765�0000024�00000000012�12240460102�022114� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������safe_mode ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/basic_safe_mode.text��������������������������������������������������0000644�0000765�0000024�00000001541�13026003713�022156� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������blah <img src="dangerous"> blah <div>yowzer!</div> blah <script>alert(1)</script> [link1](http://example.com"onclick="alert(1)) [link2](http://example.com "title"onclick="alert(1)") [link3](http://example.com><script>alert(1)</script>) [link4 ><script>alert(1)</script>](http://example.com><script>alert(1)</script>) [link5](javascript:alert('XSS')) [link6](javascript:alert('XSS')) [link7][1] ![ok img](http://example.com/image.gif?h=200&w=500) ![img](http://example.com"onclick="alert(1)) ![img2](http://example.com "text"onclick="alert(1)") ![img3](http://example.com><script>alert(1)</script>) <img src="javascript:alert(1)" [1]: javascript:alert('XSS') ![ok img](http://example.com/image.gif?h=200&w=500) [link ok](http://example.com) ���������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/basic_safe_mode_escape.html�������������������������������������������0000644�0000765�0000024�00000000141�12240460102�023445� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>blah <img src="dangerous"> blah</p> <p><div>yowzer!</div></p> <p>blah</p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/basic_safe_mode_escape.opts�������������������������������������������0000644�0000765�0000024�00000000030�12240460102�023463� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"safe_mode": "escape"} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/basic_safe_mode_escape.tags�������������������������������������������0000644�0000765�0000024�00000000012�12240460102�023434� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������safe_mode ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/basic_safe_mode_escape.text�������������������������������������������0000644�0000765�0000024�00000000072�12240460102�023470� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������blah <img src="dangerous"> blah <div>yowzer!</div> blah ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/blockquote.html�������������������������������������������������������0000644�0000765�0000024�00000000177�12240460102�021223� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>[Trent wrote]</p> <blockquote> <p>no way</p> </blockquote> <p>[Jeff wrote]</p> <blockquote> <p>way</p> </blockquote> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/blockquote.text�������������������������������������������������������0000644�0000765�0000024�00000000053�12240460102�021234� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[Trent wrote] > no way [Jeff wrote] > way �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/blockquote_with_pre.html����������������������������������������������0000644�0000765�0000024�00000000310�12240460102�023111� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<blockquote> <p>Markdown indents blockquotes a couple of spaces necessitating some tweaks for pre-blocks in that blockquote:</p> <pre><code>here is a check for that </code></pre> </blockquote> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/blockquote_with_pre.text����������������������������������������������0000644�0000765�0000024�00000000232�12240460102�023134� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������> Markdown indents blockquotes a couple of spaces > necessitating some tweaks for pre-blocks in that > blockquote: > > here is a check > for that ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/break_on_newline.html�������������������������������������������������0000644�0000765�0000024�00000000315�12345160534�022362� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Ring forth, ye bells,<br /> With clarion sound</p> <p>Forget your knells,<br /> For joys abound.</p> <p>Forget your notes<br /> Of mournful lay,<br /> And from your throats<br /> Pour joy to-day.</p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/break_on_newline.opts�������������������������������������������������0000644�0000765�0000024�00000000041�12345160534�022377� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["break-on-newline"]} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/break_on_newline.text�������������������������������������������������0000644�0000765�0000024�00000000232�12345160534�022400� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ring forth, ye bells, With clarion sound Forget your knells, For joys abound. Forget your notes Of mournful lay, And from your throats Pour joy to-day. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/code_block_with_tabs.html���������������������������������������������0000644�0000765�0000024�00000000176�12240460102�023202� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Test with tabs for <code>_Detab</code>:</p> <pre><code>Code 'block' with some "tabs" and "quotes" </code></pre> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/code_block_with_tabs.tags���������������������������������������������0000644�0000765�0000024�00000000077�12240460102�023174� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������fromphpmarkdown # from PHP Markdown test "Parens in URL.text" �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/code_block_with_tabs.text���������������������������������������������0000644�0000765�0000024�00000000112�12240460102�023210� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Test with tabs for `_Detab`: Code 'block' with some "tabs" and "quotes" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/code_blocks_leading_line.html�����������������������������������������0000644�0000765�0000024�00000000220�12345160534�024015� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code>print "hi" </code></pre> <p>That <em>single</em> leading line was problematic at one time. E.g. Markdown.pl 1.0.1 suffers here.</p> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/code_blocks_leading_line.text�����������������������������������������0000644�0000765�0000024�00000000156�12345160534�024045� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ print "hi" That *single* leading line was problematic at one time. E.g. Markdown.pl 1.0.1 suffers here. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/code_safe_emphasis.html�����������������������������������������������0000644�0000765�0000024�00000000216�12240460102�022646� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is <em>italic</em> and this is <strong>bold</strong>. This is NOT _italic_ and this is __bold__ because --code-safe is turned on.</p> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/code_safe_emphasis.opts�����������������������������������������������0000644�0000765�0000024�00000000036�12240460102�022667� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["code-friendly"]} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/code_safe_emphasis.tags�����������������������������������������������0000644�0000765�0000024�00000000016�12240460102�022636� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������code_friendly ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/code_safe_emphasis.text�����������������������������������������������0000644�0000765�0000024�00000000165�12240460102�022671� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is *italic* and this is **bold**. This is NOT _italic_ and this is __bold__ because --code-safe is turned on. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/codeblock.html��������������������������������������������������������0000644�0000765�0000024�00000000155�12240460102�020774� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code>some code </code></pre> <p>some 'splaining</p> <pre><code>some more code 2 > 1 </code></pre> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/codeblock.text��������������������������������������������������������0000644�0000765�0000024�00000000076�12240460102�021016� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ some code some 'splaining some more code 2 > 1 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/codespans.html��������������������������������������������������������0000644�0000765�0000024�00000000143�12240460102�021023� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><code>This</code> is a code span. And <code>This is one with an `embedded backtick`</code>.</p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/codespans.text��������������������������������������������������������0000644�0000765�0000024�00000000111�12240460102�021036� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������`This` is a code span. And ``This is one with an `embedded backtick` ``. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/codespans_safe_mode.html����������������������������������������������0000644�0000765�0000024�00000000143�12240460102�023025� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><code>This</code> is a code span. And <code>This is one with an `embedded backtick`</code>.</p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/codespans_safe_mode.opts����������������������������������������������0000644�0000765�0000024�00000000024�12240460102�023044� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{'safe_mode': True} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/codespans_safe_mode.tags����������������������������������������������0000644�0000765�0000024�00000000021�12240460102�023012� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue9 safe_mode ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/codespans_safe_mode.text����������������������������������������������0000644�0000765�0000024�00000000111�12240460102�023040� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������`This` is a code span. And ``This is one with an `embedded backtick` ``. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_list_indented.html��������������������������������������������0000644�0000765�0000024�00000000342�12240460102�023356� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>With no indent:</p> <ul> <li>one</li> <li>two</li> </ul> <p>With 4 space indent: * one * two</p> <p>With one tab indent: * one * two</p> <p>With 3 space indent:</p> <ul> <li>one</li> <li>two</li> </ul> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_list_indented.opts��������������������������������������������0000644�0000765�0000024�00000000036�12240460102�023377� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["cuddled-lists"]} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_list_indented.tags��������������������������������������������0000644�0000765�0000024�00000000044�12240460102�023347� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smedberg issue36 extra cuddle-lists ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_list_indented.text��������������������������������������������0000644�0000765�0000024�00000000222�12240460102�023373� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������With no indent: * one * two With 4 space indent: * one * two With one tab indent: * one * two With 3 space indent: * one * two ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_para_and_list.html��������������������������������������������0000644�0000765�0000024�00000001200�13262471302�023334� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>I did these things:</p> <ul> <li>bullet1</li> <li>bullet2</li> <li>bullet3</li> </ul> <p>I did these too:</p> <ul> <li>bullet1</li> <li>bullet2</li> <li>bullet3 this is a longer one.</li> </ul> <p>And these in order:</p> <ol> <li>bullet1</li> <li>bullet2</li> <li>bullet3</li> </ol> <p>Here is an asterisk, * What do you think about it?</p> <p>I suggest using version 8. Oops, now this line is treated as a sub-list.</p> <p>List with single item:</p> <ul> <li>bullet1</li> </ul> <p>Another list with single item:</p> <ul> <li>bullet1</li> </ul> <p>Yet, another list with single item:</p> <ul> <li>bullet1</li> </ul> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_para_and_list.opts��������������������������������������������0000644�0000765�0000024�00000000036�12240460102�023352� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["cuddled-lists"]} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_para_and_list.tags��������������������������������������������0000644�0000765�0000024�00000000044�12240460102�023322� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smedberg issue33 extra cuddle-lists ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_para_and_list.text��������������������������������������������0000644�0000765�0000024�00000000664�13262471302�023371� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������I did these things: * bullet1 * bullet2 * bullet3 I did these too: * bullet1 * bullet2 * bullet3 this is a longer one. And these in order: 1. bullet1 2. bullet2 3. bullet3 Here is an asterisk, * What do you think about it? I suggest using version 8. Oops, now this line is treated as a sub-list. List with single item: * bullet1 Another list with single item: * bullet1 Yet, another list with single item: * bullet1 ����������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_with_para.html������������������������������������������������0000644�0000765�0000024�00000001230�12240460102�022504� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>Cuddled with paragraph</h1> <p><?meta command?> Paragraph preceded by an XML processing instruction.</p> <p><!-- comment --> Paragraph preceded by an HTML/XML comment.</p> <p><img src="bar.png"/> Paragraph preceded by an HTML span element.</p> <div>div1</div> <p>Paragraph preceded by an HTML block element.</p> <h1>Not cuddled with paragraph</h1> <p><?meta command?></p> <p>Paragraph preceded by an XML processing instruction.</p> <!-- comment --> <p>Paragraph preceded by an HTML/XML comment.</p> <p><img src="bar.png"/></p> <p>Paragraph preceded by an HTML span element.</p> <div>div2</div> <p>Paragraph preceded by an HTML block element.</p> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/cuddled_with_para.text������������������������������������������������0000644�0000765�0000024�00000001105�12240460102�022525� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Cuddled with paragraph <?meta command?> Paragraph preceded by an XML processing instruction. <!-- comment --> Paragraph preceded by an HTML/XML comment. <img src="bar.png"/> Paragraph preceded by an HTML span element. <div>div1</div> Paragraph preceded by an HTML block element. # Not cuddled with paragraph <?meta command?> Paragraph preceded by an XML processing instruction. <!-- comment --> Paragraph preceded by an HTML/XML comment. <img src="bar.png"/> Paragraph preceded by an HTML span element. <div>div2</div> Paragraph preceded by an HTML block element. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/CVE-2018-5773.html����������������������������������������������������0000644�0000765�0000024�00000000265�13402012311�020455� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><img src="" onerror=alert(/XSS/) </p> <p></img src="" onerror=alert(/XSS/) </p> <p><img/src="" onerror=alert(/XSS/) </p> <p></img/src="" onerror=alert(/XSS/) </p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/CVE-2018-5773.opts����������������������������������������������������0000644�0000765�0000024�00000000031�13352552071�020505� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"safe_mode": "replace"} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/CVE-2018-5773.text����������������������������������������������������0000644�0000765�0000024�00000000215�13402012311�020470� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<img src="" onerror=alert(/XSS/) </img src="" onerror=alert(/XSS/) <img/src="" onerror=alert(/XSS/) </img/src="" onerror=alert(/XSS/) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/demote_headers.html���������������������������������������������������0000644�0000765�0000024�00000000257�12240460102�022022� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h3>this was h1</h3> <h4>this was h2</h4> <h5>this was h3</h5> <h6>this was h4</h6> <h6>this was h5</h6> <h6>this was h6</h6> <h3>this was h1</h3> <h3>this was h2</h3> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/demote_headers.opts���������������������������������������������������0000644�0000765�0000024�00000000042�12240460102�022033� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": {"demote-headers": 2}} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/demote_headers.text���������������������������������������������������0000644�0000765�0000024�00000000233�12240460102�022034� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# this was h1 ## this was h2 ### this was h3 #### this was h4 ##### this was h5 ###### this was h6 this was h1 =========== this was h2 =========== ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emacs_head_vars.html��������������������������������������������������0000644�0000765�0000024�00000000250�12240460102�022147� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- -*- markdown-extras: code-friendly -*- --> <p>This sentence talks about the Python __init__ method, which I'd rather not be interpreted as Markdown's strong.</p> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emacs_head_vars.opts��������������������������������������������������0000644�0000765�0000024�00000000030�12240460102�022164� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"use_file_vars": True} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emacs_head_vars.tags��������������������������������������������������0000644�0000765�0000024�00000000006�12240460102�022140� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������emacs ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emacs_head_vars.text��������������������������������������������������0000644�0000765�0000024�00000000241�12240460102�022167� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- -*- markdown-extras: code-friendly -*- --> This sentence talks about the Python __init__ method, which I'd rather not be interpreted as Markdown's strong. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emacs_tail_vars.html��������������������������������������������������0000644�0000765�0000024�00000000276�12240460102�022207� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This sentence talks about the Python __init__ method, which I'd rather not be interpreted as Markdown's strong.</p> <!-- Local Variables: markdown-extras: code-friendly End: --> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emacs_tail_vars.opts��������������������������������������������������0000644�0000765�0000024�00000000030�12240460102�022214� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"use_file_vars": True} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emacs_tail_vars.tags��������������������������������������������������0000644�0000765�0000024�00000000006�12240460102�022170� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������emacs ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emacs_tail_vars.text��������������������������������������������������0000644�0000765�0000024�00000000267�12240460102�022227� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This sentence talks about the Python __init__ method, which I'd rather not be interpreted as Markdown's strong. <!-- Local Variables: markdown-extras: code-friendly End: --> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emphasis.html���������������������������������������������������������0000644�0000765�0000024�00000000202�12240460102�020651� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is <em>italic</em> and this is <strong>bold</strong>. This is also <em>italic</em> and this is <strong>bold</strong>.</p> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/emphasis.text���������������������������������������������������������0000644�0000765�0000024�00000000125�12240460102�020675� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is *italic* and this is **bold**. This is also _italic_ and this is __bold__. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/escapes.html����������������������������������������������������������0000644�0000765�0000024�00000003160�12240460102�020471� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>Backslash-escapes: basics</h1> <p>**don't shout**</p> <p>*don't emphasize*</p> <p>_literal underscores_</p> <p>__more literal underscores__</p> <h2>This header has trailing hash marks ##</h2> <h1>Backslash-escapes: links</h1> <p>This is not a [link](/url/).</p> <p>This is a link, not an image link: !<a href="/url/">link</a>.</p> <p>Should this be an <a href="http://autolink\">http://autolink\</a> or not? I'll ask on markdown-discuss. I suspect PHP markdown is considering this NOT an autolink.</p> <p>This is not a [link definition][link1] but <a href="/url/">this is</a>.</p> <h1>Backslash-escapse: code blocks</h1> <p>In a code block:</p> <pre><code>escapes should \*not\* be \_interpreted\_ even \`backticks\` </code></pre> <h1>Backslash-escapse: code spans</h1> <p>Getting backticks and backslash-escapes working correctly with code spans can be tricky:</p> <p><code>a normal code span</code></p> <p><code>need multiple backticks to include a literal ` backtick</code></p> <p><code>`use a leading space to start a code span with a backtick</code></p> <p><code>use a trailing space to end a code span with a backtick`</code></p> <p><code>backslash-escapes \(are\) \*not\* \`interpreted\` in a code span</code></p> <p>`<code>a code span prefixed with a literal backtick</code></p> <p>`not a code span`</p> <p><em>Note A</em>: The <code>(?!`)</code> after the <code>\1</code> group in the <code>_DoCodeSpans()/_do_code_spans()</code> regex is necessary to ensure that a backtick doesn't match at the start of the code block (group <code>\2</code>) in an example like this:</p> <ul> <li>`<code>foo</code></li> </ul> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/escapes.tags����������������������������������������������������������0000644�0000765�0000024�00000000010�12240460102�020452� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue15 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/escapes.text����������������������������������������������������������0000644�0000765�0000024�00000002463�12240460102�020516� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Backslash-escapes: basics \*\*don't shout\*\* \*don't emphasize\* \_literal underscores\_ \_\_more literal underscores\_\_ ## This header has trailing hash marks \#\# # Backslash-escapes: links This is not a \[link](/url/). This is a link, not an image link: \![link](/url/). Should this be an <http://autolink\> or not? I'll ask on markdown-discuss. I suspect PHP markdown is considering this NOT an autolink. This is not a [link definition\][link1] but [this is][link1]. [link1]: /url/ # Backslash-escapse: code blocks In a code block: escapes should \*not\* be \_interpreted\_ even \`backticks\` # Backslash-escapse: code spans Getting backticks and backslash-escapes working correctly with code spans can be tricky: `a normal code span` ``need multiple backticks to include a literal ` backtick`` `` `use a leading space to start a code span with a backtick`` ``use a trailing space to end a code span with a backtick` `` ``backslash-escapes \(are\) \*not\* \`interpreted\` in a code span`` \``a code span prefixed with a literal backtick` \`not a code span\` *Note A*: The `` (?!`) `` after the `\1` group in the `_DoCodeSpans()/_do_code_spans()` regex is necessary to ensure that a backtick doesn't match at the start of the code block (group `\2`) in an example like this: - ``foo` �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue113.html��������������������������������������0000644�0000765�0000024�00000000541�12345160534�024272� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code><script type="text/javascript" src="{{ static_url('shadowbox/shadowbox.js') }}"> </script> <script type="text/javascript"> Shadowbox.init({ handleOversize: "drag" }); window.onload = function() { Shadowbox.setup(".entry-content img", { gallery: "{{post.title}}", counterType: "skip" }); }; </script> </code></pre> ���������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue113.opts��������������������������������������0000644�0000765�0000024�00000000043�12345160534�024310� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue113.tags��������������������������������������0000644�0000765�0000024�00000000042�12345160534�024260� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks issue113 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue113.text��������������������������������������0000644�0000765�0000024�00000000470�12345160534�024313� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������``` <script type="text/javascript" src="{{ static_url('shadowbox/shadowbox.js') }}"> </script> <script type="text/javascript"> Shadowbox.init({ handleOversize: "drag" }); window.onload = function() { Shadowbox.setup(".entry-content img", { gallery: "{{post.title}}", counterType: "skip" }); }; </script> ``` ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue127.html��������������������������������������0000644�0000765�0000024�00000000061�12345160534�024274� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code><div></div> </code></pre> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue127.opts��������������������������������������0000644�0000765�0000024�00000000043�12345160534�024315� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue127.tags��������������������������������������0000644�0000765�0000024�00000000042�12345160534�024265� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks issue127 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue127.text��������������������������������������0000644�0000765�0000024�00000000024�12345160534�024313� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������``` <div></div> ``` ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue135.html��������������������������������������0000644�0000765�0000024�00000000040�12345160534�024270� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code>[] []: </code></pre> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue135.opts��������������������������������������0000644�0000765�0000024�00000000043�12345160534�024314� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue135.tags��������������������������������������0000644�0000765�0000024�00000000042�12345160534�024264� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks issue135 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue135.text��������������������������������������0000644�0000765�0000024�00000000017�12345160534�024314� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������``` [] []: ``` �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue161.html��������������������������������������0000644�0000765�0000024�00000000425�12350633476�024304� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code>here is some code </code></pre> <p>That's using the <em>fenced-code-blocks</em> extra.</p> <p>Here is an empty one (just to check):</p> <pre><code> </code></pre> <p>Here is one at the end of the file:</p> <pre><code> is indentation maintained? </code></pre> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue161.opts��������������������������������������0000644�0000765�0000024�00000000072�12350633476�024323� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"], "safe_mode": "escape"} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue161.tags��������������������������������������0000644�0000765�0000024�00000000031�12350633476�024267� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue161.text��������������������������������������0000644�0000765�0000024�00000000305�12350633476�024321� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������``` here is some code ``` That's using the *fenced-code-blocks* extra. Here is an empty one (just to check): ``` ``` Here is one at the end of the file: ``` is indentation maintained? ``` ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue86.html���������������������������������������0000644�0000765�0000024�00000000276�12345160534�024230� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code># this should not be a heading print "hi" </code></pre> <pre><code># first comment a = 1 # second comment b = 2 </code></pre> <pre><code>void foo() { x = 1; </code></pre> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue86.opts���������������������������������������0000644�0000765�0000024�00000000043�12345160534�024241� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue86.tags���������������������������������������0000644�0000765�0000024�00000000061�12345160534�024212� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks issue86 issue84 issue87 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_issue86.text���������������������������������������0000644�0000765�0000024�00000000213�12345160534�024237� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������``` # this should not be a heading print "hi" ``` ``` # first comment a = 1 # second comment b = 2 ``` ``` void foo() { x = 1; ``` �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_lang_space.html����������������������������0000644�0000765�0000024�00000000333�13354235144�026474� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<div class="codehilite"><pre><span></span><code><span class="k">if</span> <span class="bp">True</span><span class="p">:</span> <span class="k">print</span> <span class="s2">"hi"</span> </code></pre></div> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_lang_space.opts����������������������������0000644�0000765�0000024�00000000043�13165753457�026527� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_lang_space.tags����������������������������0000644�0000765�0000024�00000000042�13230242702�026452� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks pygments ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_lang_space.text����������������������������0000644�0000765�0000024�00000000047�13107107032�026504� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������``` python if True: print "hi" ``` �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_line.html����������������������������������0000644�0000765�0000024�00000000220�12345160534�025321� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code>print "hi" </code></pre> <p>That <em>single</em> leading line was problematic at one time. E.g. Markdown.pl 1.0.1 suffers here.</p> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_line.opts����������������������������������0000644�0000765�0000024�00000000043�12345160534�025345� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_line.tags����������������������������������0000644�0000765�0000024�00000000031�12345160534�025313� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_line.text����������������������������������0000644�0000765�0000024�00000000162�12345160534�025346� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ ``` print "hi" ``` That *single* leading line was problematic at one time. E.g. Markdown.pl 1.0.1 suffers here. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_paragraph.html�����������������������������0000644�0000765�0000024�00000000104�12720476317�026346� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is python code.</p> <pre><code>print 'hello' </code></pre> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_paragraph.opts�����������������������������0000644�0000765�0000024�00000000043�12720476317�026371� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_paragraph.tags�����������������������������0000644�0000765�0000024�00000000032�12720476317�026340� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_leading_paragraph.text�����������������������������0000644�0000765�0000024�00000000053�12720476317�026371� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is python code. ``` print 'hello' ``` �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_safe_highlight.html��������������������������������0000644�0000765�0000024�00000001262�13354235144�025664� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<div class="codehilite"><pre><span></span><code><span class="k">if</span> <span class="bp">True</span><span class="p">:</span> <span class="k">print</span> <span class="s2">"hi"</span> </code></pre></div> <p>That's using the <em>fenced-code-blocks</em> extra with Python syntax coloring, if <code>pygments</code> is installed. See <a href="http://github.github.com/github-flavored-markdown/">http://github.github.com/github-flavored-markdown/</a>.</p> <div class="codehilite"><pre><span></span><code><span class="k">def</span> <span class="nf">foo</span> <span class="nb">puts</span> <span class="s2">"hi"</span> <span class="k">end</span> </code></pre></div> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_safe_highlight.opts��������������������������������0000644�0000765�0000024�00000000072�12374466626�025717� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"], "safe_mode": "escape"} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_safe_highlight.tags��������������������������������0000644�0000765�0000024�00000000042�12374466626�025665� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks pygments ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_safe_highlight.text��������������������������������0000644�0000765�0000024�00000000355�12374466626�025722� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������```python if True: print "hi" ``` That's using the *fenced-code-blocks* extra with Python syntax coloring, if `pygments` is installed. See <http://github.github.com/github-flavored-markdown/>. ```ruby def foo puts "hi" end ``` �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_simple.html����������������������������������������0000644�0000765�0000024�00000000425�12240460102�024173� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code>here is some code </code></pre> <p>That's using the <em>fenced-code-blocks</em> extra.</p> <p>Here is an empty one (just to check):</p> <pre><code> </code></pre> <p>Here is one at the end of the file:</p> <pre><code> is indentation maintained? </code></pre> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_simple.opts����������������������������������������0000644�0000765�0000024�00000000043�12240460102�024210� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_simple.tags����������������������������������������0000644�0000765�0000024�00000000031�12240460102�024156� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_simple.text����������������������������������������0000644�0000765�0000024�00000000305�12240460102�024210� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������``` here is some code ``` That's using the *fenced-code-blocks* extra. Here is an empty one (just to check): ``` ``` Here is one at the end of the file: ``` is indentation maintained? ``` ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_syntax_highlighting.html���������������������������0000644�0000765�0000024�00000001262�13354235144�026772� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<div class="codehilite"><pre><span></span><code><span class="k">if</span> <span class="bp">True</span><span class="p">:</span> <span class="k">print</span> <span class="s2">"hi"</span> </code></pre></div> <p>That's using the <em>fenced-code-blocks</em> extra with Python syntax coloring, if <code>pygments</code> is installed. See <a href="http://github.github.com/github-flavored-markdown/">http://github.github.com/github-flavored-markdown/</a>.</p> <div class="codehilite"><pre><span></span><code><span class="k">def</span> <span class="nf">foo</span> <span class="nb">puts</span> <span class="s2">"hi"</span> <span class="k">end</span> </code></pre></div> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_syntax_highlighting.opts���������������������������0000644�0000765�0000024�00000000043�12240460102�026772� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_syntax_highlighting.tags���������������������������0000644�0000765�0000024�00000000042�12240460102�026742� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks pygments ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_syntax_highlighting.text���������������������������0000644�0000765�0000024�00000000355�12240460102�026777� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������```python if True: print "hi" ``` That's using the *fenced-code-blocks* extra with Python syntax coloring, if `pygments` is installed. See <http://github.github.com/github-flavored-markdown/>. ```ruby def foo puts "hi" end ``` �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_syntax_indentation.html����������������������������0000644�0000765�0000024�00000000450�13354235144�026637� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<div class="codehilite"><pre><span></span><code><span class="k">def</span> <span class="nf">foo</span><span class="p">():</span> <span class="k">print</span> <span class="s2">"foo"</span> <span class="k">print</span> <span class="s2">"bar"</span> </code></pre></div> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_syntax_indentation.opts����������������������������0000644�0000765�0000024�00000000043�12345160534�026655� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_syntax_indentation.tags����������������������������0000644�0000765�0000024�00000000056�12345160534�026632� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks pygments indentation ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/fenced_code_blocks_syntax_indentation.text����������������������������0000644�0000765�0000024�00000000072�12345160534�026656� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������```python def foo(): print "foo" print "bar" ``` ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes.html��������������������������������������������������������0000644�0000765�0000024�00000002254�12345160534�021105� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is a para with a footnote.<sup class="footnote-ref" id="fnref-1"><a href="#fn-1">1</a></sup></p> <p>This is another para with a footnote<sup class="footnote-ref" id="fnref-2"><a href="#fn-2">2</a></sup> in it. Actually it has two<sup class="footnote-ref" id="fnref-3"><a href="#fn-3">3</a></sup> of them. No, three<sup class="footnote-ref" id="fnref-4"><a href="#fn-4">4</a></sup>.</p> <div class="footnotes"> <hr /> <ol> <li id="fn-1"> <p>Here is the body of the first footnote. <a href="#fnref-1" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> </li> <li id="fn-2"> <p>And of the second footnote.</p> <p>This one has multiple paragraphs. <a href="#fnref-2" class="footnoteBackLink" title="Jump back to footnote 2 in the text.">↩</a></p> </li> <li id="fn-3"> <p>Here is a footnote body that starts on next line. <a href="#fnref-3" class="footnoteBackLink" title="Jump back to footnote 3 in the text.">↩</a></p> </li> <li id="fn-4"> <p>quickie "that looks like a link ref if not careful" <a href="#fnref-4" class="footnoteBackLink" title="Jump back to footnote 4 in the text.">↩</a></p> </li> </ol> </div> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes.opts��������������������������������������������������������0000644�0000765�0000024�00000000032�12240460102�021102� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["footnotes"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes.text��������������������������������������������������������0000644�0000765�0000024�00000000572�12240460102�021112� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is a para with a footnote.[^1] This is another para with a footnote[^2] in it. Actually it has two[^3] of them. No, three[^4]. [^1]: Here is the body of the first footnote. [^2]: And of the second footnote. This one has multiple paragraphs. [^3]: Here is a footnote body that starts on next line. [^4]: quickie "that looks like a link ref if not careful" ��������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_custom.html�������������������������������������������������0000644�0000765�0000024�00000002240�13057576607�022507� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is a para with a footnote.<sup class="footnote-ref" id="fnref-1"><a href="#fn-1">1</a></sup></p> <p>This is another para with a footnote<sup class="footnote-ref" id="fnref-2"><a href="#fn-2">2</a></sup> in it. Actually it has two<sup class="footnote-ref" id="fnref-3"><a href="#fn-3">3</a></sup> of them. No, three<sup class="footnote-ref" id="fnref-4"><a href="#fn-4">4</a></sup>.</p> <div class="footnotes"> <hr /> <ol> <li id="fn-1"> <p>Here is the body of the first footnote. <a href="#fnref-1" class="footnoteBackLink" title="Yo Dawg, I heard you came from 1.">↩</a></p> </li> <li id="fn-2"> <p>And of the second footnote.</p> <p>This one has multiple paragraphs. <a href="#fnref-2" class="footnoteBackLink" title="Yo Dawg, I heard you came from 2.">↩</a></p> </li> <li id="fn-3"> <p>Here is a footnote body that starts on next line. <a href="#fnref-3" class="footnoteBackLink" title="Yo Dawg, I heard you came from 3.">↩</a></p> </li> <li id="fn-4"> <p>quickie "that looks like a link ref if not careful" <a href="#fnref-4" class="footnoteBackLink" title="Yo Dawg, I heard you came from 4.">↩</a></p> </li> </ol> </div> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_custom.opts�������������������������������������������������0000644�0000765�0000024�00000000125�13057576607�022530� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["footnotes"], "footnote_title" : "Yo Dawg, I heard you came from %d." } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_custom.text�������������������������������������������������0000644�0000765�0000024�00000000572�13057576607�022535� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is a para with a footnote.[^1] This is another para with a footnote[^2] in it. Actually it has two[^3] of them. No, three[^4]. [^1]: Here is the body of the first footnote. [^2]: And of the second footnote. This one has multiple paragraphs. [^3]: Here is a footnote body that starts on next line. [^4]: quickie "that looks like a link ref if not careful" ��������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_letters.html������������������������������������������������0000644�0000765�0000024�00000001754�12345160534�022653� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is a para with a footnote.<sup class="footnote-ref" id="fnref-foo"><a href="#fn-foo">1</a></sup></p> <p>This is another para with a footnote<sup class="footnote-ref" id="fnref-hyphen-ated"><a href="#fn-hyphen-ated">2</a></sup> in it. Actually it has two<sup class="footnote-ref" id="fnref-Capital"><a href="#fn-Capital">3</a></sup> of them.</p> <div class="footnotes"> <hr /> <ol> <li id="fn-foo"> <p>Here is the body of the first footnote. <a href="#fnref-foo" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> </li> <li id="fn-hyphen-ated"> <p>And of the second footnote.</p> <p>This one has multiple paragraphs. <a href="#fnref-hyphen-ated" class="footnoteBackLink" title="Jump back to footnote 2 in the text.">↩</a></p> </li> <li id="fn-Capital"> <p>Here is a footnote body that starts on next line. <a href="#fnref-Capital" class="footnoteBackLink" title="Jump back to footnote 3 in the text.">↩</a></p> </li> </ol> </div> ��������������������markdown2-2.3.7/test/tm-cases/footnotes_letters.opts������������������������������������������������0000644�0000765�0000024�00000000032�12240460102�022644� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["footnotes"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_letters.tags������������������������������������������������0000644�0000765�0000024�00000000012�12240460102�022613� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������footnotes ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_letters.text������������������������������������������������0000644�0000765�0000024�00000000523�12240460102�022650� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is a para with a footnote.[^foo] This is another para with a footnote[^hyphen-ated] in it. Actually it has two[^Capital] of them. [^foo]: Here is the body of the first footnote. [^hyphen-ated]: And of the second footnote. This one has multiple paragraphs. [^Capital]: Here is a footnote body that starts on next line. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_markup.html�������������������������������������������������0000644�0000765�0000024�00000001442�12345160534�022462� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is a para with a footnote.<sup class="footnote-ref" id="fnref-1"><a href="#fn-1">1</a></sup></p> <p>This is another para with a footnote.<sup class="footnote-ref" id="fnref-2"><a href="#fn-2">2</a></sup></p> <div class="footnotes"> <hr /> <ol> <li id="fn-1"> <p>And the <strong>body</strong> of the footnote has <code>markup</code>. For example, a <a href="http://digg.com">link to digg</a>. And some code:</p> <pre><code>print "Hello, World!" </code></pre> <p><a href="#fnref-1" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> </li> <li id="fn-2"> <p>This body has markup too, <em>but</em> doesn't end with a code block. <a href="#fnref-2" class="footnoteBackLink" title="Jump back to footnote 2 in the text.">↩</a></p> </li> </ol> </div> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_markup.opts�������������������������������������������������0000644�0000765�0000024�00000000032�12240460102�022461� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["footnotes"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_markup.tags�������������������������������������������������0000644�0000765�0000024�00000000012�12240460102�022430� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������footnotes ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_markup.text�������������������������������������������������0000644�0000765�0000024�00000000455�12240460102�022471� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is a para with a footnote.[^1] This is another para with a footnote.[^2] [^1]: And the **body** of the footnote has `markup`. For example, a [link to digg](http://digg.com). And some code: print "Hello, World!" [^2]: This body has markup too, *but* doesn't end with a code block. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_safe_mode_escape.html���������������������������������������0000644�0000765�0000024�00000000725�12345160534�024430� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is a para with a footnote.<sup class="footnote-ref" id="fnref-1"><a href="#fn-1">1</a></sup></p> <div class="footnotes"> <hr /> <ol> <li id="fn-1"> <p>Here is the <em>body</em> of <span class="yo">the</span> footnote.</p> <p><div class="blah">And here is the second para of the footnote.</div> <a href="#fnref-1" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> </li> </ol> </div> �������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_safe_mode_escape.opts���������������������������������������0000644�0000765�0000024�00000000061�12240460102�024426� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"safe_mode": "escape", "extras": ["footnotes"]} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_safe_mode_escape.tags���������������������������������������0000644�0000765�0000024�00000000024�12240460102�024376� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������safe_mode footnotes ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_safe_mode_escape.text���������������������������������������0000644�0000765�0000024�00000000271�12240460102�024430� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is a para with a footnote.[^1] [^1]: Here is the <em>body</em> of <span class="yo">the</span> footnote. <div class="blah">And here is the second para of the footnote.</div> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_underscores.html��������������������������������������������0000644�0000765�0000024�00000001424�12345160534�023517� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>memcpy<em>from</em>tvm</p> <p>Testing<sup class="footnote-ref" id="fnref-1"><a href="#fn-1">1</a></sup>, more testing <sup class="footnote-ref" id="fnref-2"><a href="#fn-2">2</a></sup>, more<sup class="footnote-ref" id="fnref-3"><a href="#fn-3">3</a></sup>.</p> <div class="footnotes"> <hr /> <ol> <li id="fn-1"> <p>memcpy<em>from</em>tvm <a href="#fnref-1" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> </li> <li id="fn-2"> <p><code>memcpy_from_tvm</code> <a href="#fnref-2" class="footnoteBackLink" title="Jump back to footnote 2 in the text.">↩</a></p> </li> <li id="fn-3"> <p>memcpy_from_tvm <a href="#fnref-3" class="footnoteBackLink" title="Jump back to footnote 3 in the text.">↩</a></p> </li> </ol> </div> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_underscores.opts��������������������������������������������0000644�0000765�0000024�00000000032�12240460102�023516� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["footnotes"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_underscores.tags��������������������������������������������0000644�0000765�0000024�00000000010�12240460102�023463� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue27 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/footnotes_underscores.text��������������������������������������������0000644�0000765�0000024�00000000202�12240460102�023514� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������memcpy_from_tvm Testing[^1], more testing [^2], more[^3]. [^1]: memcpy_from_tvm [^2]: `memcpy_from_tvm` [^3]: memcpy\_from\_tvm ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header.html�����������������������������������������������������������0000644�0000765�0000024�00000000111�12240460102�020267� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>an h1</h1> <h2>an h2</h2> <h1>another h1</h1> <h2>another h2</h2> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header.text�����������������������������������������������������������0000644�0000765�0000024�00000000111�12271077401�020321� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# an h1 ## an h2 another h1 ========== another h2 ---------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_atx_no_preceeding_space.html�����������������������������������0000644�0000765�0000024�00000000037�12345160534�025222� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>an h1</h1> <h2>an h2</h2> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_atx_no_preceeding_space.text�����������������������������������0000644�0000765�0000024�00000000020�12345160534�025232� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#an h1 ##an h2 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_1.html�����������������������������������������������������0000644�0000765�0000024�00000000271�12240460102�021355� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="fruit-i-like">Fruit I Like</h1> <ul> <li>apples</li> <li>bananas</li> </ul> <h1 id="trents-fav-veggies">Trent's fav Veggies</h1> <ul> <li>carrots</li> <li>lettuce</li> </ul> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_1.opts�����������������������������������������������������0000644�0000765�0000024�00000000033�12240460102�021372� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["header-ids"]} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_1.tags�����������������������������������������������������0000644�0000765�0000024�00000000021�12240460102�021340� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra header-ids ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_1.text�����������������������������������������������������0000644�0000765�0000024�00000000121�12240460102�021367� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Fruit I Like - apples - bananas # Trent's fav Veggies - carrots - lettuce �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_2.html�����������������������������������������������������0000644�0000765�0000024�00000000301�12240460102�021350� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="foo-fruit-i-like">Fruit I Like</h1> <ul> <li>apples</li> <li>bananas</li> </ul> <h1 id="foo-trents-fav-veggies">Trent's fav Veggies</h1> <ul> <li>carrots</li> <li>lettuce</li> </ul> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_2.opts�����������������������������������������������������0000644�0000765�0000024�00000000042�12240460102�021373� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": {"header-ids": "foo"}} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_2.tags�����������������������������������������������������0000644�0000765�0000024�00000000021�12240460102�021341� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra header-ids ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_2.text�����������������������������������������������������0000644�0000765�0000024�00000000121�12240460102�021370� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Fruit I Like - apples - bananas # Trent's fav Veggies - carrots - lettuce �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_3.html�����������������������������������������������������0000644�0000765�0000024�00000000271�12240460102�021357� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="fruit-i-like">Fruit I Like</h1> <ul> <li>apples</li> <li>bananas</li> </ul> <h2 id="trents-fav-veggies">Trent's fav Veggies</h2> <ul> <li>carrots</li> <li>lettuce</li> </ul> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_3.opts�����������������������������������������������������0000644�0000765�0000024�00000000033�12240460102�021374� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["header-ids"]} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_3.tags�����������������������������������������������������0000644�0000765�0000024�00000000021�12240460102�021342� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra header-ids ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_3.text�����������������������������������������������������0000644�0000765�0000024�00000000155�12240460102�021400� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Fruit I Like ============ - apples - bananas Trent's fav Veggies ------------------- - carrots - lettuce �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_4.html�����������������������������������������������������0000644�0000765�0000024�00000000444�12240460102�021362� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- -*- coding: utf-8 -*- --> <h1 id="fruit-really-likes">Fruit заголовок <em>really</em> likes</h1> <ul> <li>apples</li> <li>bananas</li> </ul> <h1 id="trents-fav-veggies-stuff">Trent's <strong>fav</strong> Veggies & stuff</h1> <ul> <li>carrots</li> <li>lettuce</li> </ul> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_4.opts�����������������������������������������������������0000644�0000765�0000024�00000000033�12240460102�021375� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["header-ids"]} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_4.tags�����������������������������������������������������0000644�0000765�0000024�00000000031�12240460102�021344� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra header-ids unicode �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_4.text�����������������������������������������������������0000644�0000765�0000024�00000000227�12240460102�021401� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- -*- coding: utf-8 -*- --> # Fruit заголовок *really* likes - apples - bananas # Trent's **fav** Veggies & stuff - carrots - lettuce �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_5.html�����������������������������������������������������0000644�0000765�0000024�00000000356�12240460102�021365� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="section-1">Section 1</h1> <h2 id="intro">Intro</h2> <h2 id="deep-stuff">Deep stuff</h2> <h1 id="section-2">Section 2</h1> <h2 id="intro-2">Intro</h2> <h2 id="deep-stuff-2">Deep stuff</h2> <h2 id="more-stuff">More stuff</h2> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_5.opts�����������������������������������������������������0000644�0000765�0000024�00000000033�12240460102�021376� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["header-ids"]} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_5.tags�����������������������������������������������������0000644�0000765�0000024�00000000021�12240460102�021344� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra header-ids ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/header_ids_5.text�����������������������������������������������������0000644�0000765�0000024�00000000132�12240460102�021375� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Section 1 ## Intro ## Deep stuff # Section 2 ## Intro ## Deep stuff ## More stuff ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/headers_tag_friendly.html���������������������������������������������0000644�0000765�0000024�00000000035�12345160534�023222� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>#tag</p> <h2>header</h2> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/headers_tag_friendly.opts���������������������������������������������0000644�0000765�0000024�00000000035�12345160534�023243� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["tag-friendly"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/headers_tag_friendly.tags���������������������������������������������0000644�0000765�0000024�00000000023�12345160534�023211� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra tag-friendly �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/headers_tag_friendly.text���������������������������������������������0000644�0000765�0000024�00000000020�12345160534�023234� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#tag ## header ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/highlightjs_lang.html�������������������������������������������������0000644�0000765�0000024�00000001060�13131301574�022357� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<pre><code class="cpp">here is some cpp code </code></pre> <pre><code class="lang-cpp">some lang-cpp code </code></pre> <pre><code class="language-cpp">and some language-cpp code </code></pre> <pre><code class="nohighlight">some code without highlighting </code></pre> <p>That's using the <em>fenced-code-blocks</em> and <em>highlightjs-lang</em> extra.</p> <p>Here is an empty one (just to check):</p> <pre><code class="cpp"> </code></pre> <p>Here is one at the end of the file:</p> <pre><code class="cpp"> is indentation maintained? </code></pre> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/highlightjs_lang.opts�������������������������������������������������0000644�0000765�0000024�00000000067�13131301574�022406� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["fenced-code-blocks", "highlightjs-lang"]} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/highlightjs_lang.tags�������������������������������������������������0000644�0000765�0000024�00000000052�13131301574�022351� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra fenced-code-blocks highlightjs-lang ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/highlightjs_lang.text�������������������������������������������������0000644�0000765�0000024�00000000560�13131301574�022403� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������```cpp here is some cpp code ``` ```lang-cpp some lang-cpp code ``` ```language-cpp and some language-cpp code ``` ```nohighlight some code without highlighting ``` That's using the *fenced-code-blocks* and *highlightjs-lang* extra. Here is an empty one (just to check): ```cpp ``` Here is one at the end of the file: ```cpp is indentation maintained? ``` ������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/hr.html���������������������������������������������������������������0000644�0000765�0000024�00000000115�12240460102�017454� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Dashes:</p> <hr /> <hr /> <hr /> <hr /> <pre><code>--- </code></pre> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/hr.text���������������������������������������������������������������0000644�0000765�0000024�00000000052�12240460102�017474� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Dashes: --- --- --- --- --- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/hr_length.html��������������������������������������������������������0000644�0000765�0000024�00000000222�12345160534�021030� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>horizontal rules need to be at least 3 characters</h1> <p>-</p> <p>*</p> <p>_</p> <p>--</p> <p>**</p> <p>__</p> <hr /> <hr /> <hr /> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/hr_length.text��������������������������������������������������������0000644�0000765�0000024�00000000130�12345160534�021046� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# horizontal rules need to be at least 3 characters - * _ -- ** __ --- *** ___ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/hr_spaces.html��������������������������������������������������������0000644�0000765�0000024�00000001225�12315212345�021024� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>On the number of spaces in horizontal rules: The spec is fuzzy: "If you wish, you may use spaces between the hyphens or asterisks." Markdown.pl 1.0.1's hr regexes limit the number of spaces between the hr chars to one or two. We'll reproduce that limit here.</p> <h1>no spaces</h1> <hr /> <hr /> <hr /> <h1>one space</h1> <hr /> <hr /> <hr /> <h1>one space with some leading space</h1> <hr /> <hr /> <hr /> <h1>two spaces</h1> <hr /> <hr /> <hr /> <h1>three spaces (these shouldn't be hr)</h1> <p>- - -</p> <p>* * *</p> <p>_ _ _</p> <h1>one or two spaces</h1> <hr /> <hr /> <hr /> <h1>longer</h1> <hr /> <hr /> <hr /> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/hr_spaces.text��������������������������������������������������������0000644�0000765�0000024�00000001166�12315212665�021055� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������On the number of spaces in horizontal rules: The spec is fuzzy: "If you wish, you may use spaces between the hyphens or asterisks." Markdown.pl 1.0.1's hr regexes limit the number of spaces between the hr chars to one or two. We'll reproduce that limit here. # no spaces --- *** ___ # one space - - - * * * _ _ _ # one space with some leading space - - - * * * _ _ _ # two spaces - - - * * * _ _ _ # three spaces (these shouldn't be hr) - - - * * * _ _ _ # one or two spaces - - - * * * _ _ _ # longer - - - - - - - - * * * * * * * * _ _ _ ___ _ _ _ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/html5_block_tags.html�������������������������������������������������0000644�0000765�0000024�00000000255�12240460102�022271� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<aside>This should *not* be emphasized.</aside> <section> Likewise *this* emphasis should be ignored. </section> <p>The <em>emphasis</em> above should be ignored.</p> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/html5_block_tags.tags�������������������������������������������������0000644�0000765�0000024�00000000007�12240460102�022256� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue57�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/html5_block_tags.text�������������������������������������������������0000644�0000765�0000024�00000000237�12240460102�022311� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<aside>This should *not* be emphasized.</aside> <section> Likewise *this* emphasis should be ignored. </section> The *emphasis* above should be ignored. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/html_classes.html�����������������������������������������������������0000644�0000765�0000024�00000001477�12445726100�021552� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<table class="table table-striped"> <thead> <tr> <th>Header 1</th> <th><em>Header</em> 2</th> </tr> </thead> <tbody> <tr> <td><code>Cell 1</code></td> <td><a href="http://example.com">Cell 2</a> link</td> </tr> <tr> <td>Cell 3</td> <td><strong>Cell 4</strong></td> </tr> </tbody> </table> <table class="table table-striped"> <tbody> <tr><td><em>Year</em></td><td><em>Temperature (low)</em></td><td><em>Temperature (high)</em></td></tr> <tr><td>1900</td><td>-10</td><td>25</td></tr> <tr><td>1910</td><td>-15</td><td>30</td></tr> <tr><td>1920</td><td>-10</td><td>32</td></tr> </tbody> </table> <p>For example:</p> <pre class="syntaxcolor"><code class="codesyntaxcolor">if cond: print doit() </code></pre> <p><img src="http://www.google.com/images/logo.gif" alt="the google logo" class="custom-image-class" /></p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/html_classes.opts�����������������������������������������������������0000644�0000765�0000024�00000000341�12445726100�021560� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "extras": { "tables": {}, "wiki-tables": {}, "html-classes": { "pre": "syntaxcolor", "code": "codesyntaxcolor", "img": "custom-image-class", "table": "table table-striped" } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/html_classes.tags�����������������������������������������������������0000644�0000765�0000024�00000000055�12240460102�021521� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extras html-classes knownfailure code.as.com �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/html_classes.text�����������������������������������������������������0000644�0000765�0000024�00000000602�12445726100�021557� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������| Header 1 | *Header* 2 | | -------- | -------- | | `Cell 1` | [Cell 2](http://example.com) link | | Cell 3 | **Cell 4** | || *Year* || *Temperature (low)* || *Temperature (high)* || || 1900 || -10 || 25 || || 1910 || -15 || 30 || || 1920 || -10 || 32 || For example: if cond: print doit() ![the google logo][logo] [logo]: http://www.google.com/images/logo.gif ������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/img_in_link.html������������������������������������������������������0000644�0000765�0000024�00000000477�12240460102�021335� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This example from <a href="http://orestis.gr/en/blog/2007/05/28/python-markdown-problems/">http://orestis.gr/en/blog/2007/05/28/python-markdown-problems/</a>:</p> <p><a href="http://www.google.com/" title="click to visit Google.com"><img src="http://www.google.com/images/logo.gif" alt="the google logo" /></a></p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/img_in_link.text������������������������������������������������������0000644�0000765�0000024�00000000353�12240460102�021346� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This example from <http://orestis.gr/en/blog/2007/05/28/python-markdown-problems/>: [![the google logo][logo]][google] [logo]: http://www.google.com/images/logo.gif [google]: http://www.google.com/ "click to visit Google.com" �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/incorrect_list_parse.html���������������������������������������������0000644�0000765�0000024�00000000466�12422360626�023305� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>Section one</h1> <ol> <li><p>Test li 1</p> <pre><code>111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111 1 </code></pre></li> </ol> <h1>Section two</h1> <ol> <li><p>Test li 2</p> <ol> <li>subli a</li> <li>subli b</li> </ol></li> <li><p>Test li 3</p></li> </ol> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/incorrect_list_parse.tags���������������������������������������������0000644�0000765�0000024�00000000011�12422360626�023261� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue165 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/incorrect_list_parse.text���������������������������������������������0000644�0000765�0000024�00000000333�12422360626�023316� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Section one 1. Test li 1 111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111 1 # Section two 1. Test li 2 1. subli a 2. subli b 1. Test li 3 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/inline_links.html�����������������������������������������������������0000644�0000765�0000024�00000000371�13010427526�021536� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>an inline <a href="/url/">link</a></p> <p>a <a href="/url/" title="title">link "with" title</a></p> <p>an inline <img src="/url/" alt="image link" /></p> <p>an <img src="/url/" alt="image "with" title" title="title" /></p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/inline_links.text�����������������������������������������������������0000644�0000765�0000024�00000000207�12240460102�021543� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������an inline [link](/url/) a [link "with" title](/url/ "title") an inline ![image link](/url/) an ![image "with" title](/url/ "title") �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue21_gt_escaping.html����������������������������������������������0000644�0000765�0000024�00000000165�12240460102�022706� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>http://code.google.com/p/python-markdown2/issues/detail?id=21</p> <p>></p> <p><></p> <p><b></p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue21_gt_escaping.opts����������������������������������������������0000644�0000765�0000024�00000000030�12240460102�022716� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"safe_mode": "escape"} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue21_gt_escaping.tags����������������������������������������������0000644�0000765�0000024�00000000017�12240460102�022674� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue21 escape �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue21_gt_escaping.text����������������������������������������������0000644�0000765�0000024�00000000112�12240460102�022716� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������http://code.google.com/p/python-markdown2/issues/detail?id=21 > <> <b> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue2_safe_mode_borks_markup.html������������������������������������0000644�0000765�0000024�00000000256�12240460102�025044� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h2>Heading 2</h2> <p>blah [HTML_REMOVED]alert('this should be removed')[HTML_REMOVED] <strong>blah</strong></p> <p>[HTML_REMOVED]alert('as should this')[HTML_REMOVED]</p> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue2_safe_mode_borks_markup.opts������������������������������������0000644�0000765�0000024�00000000031�12240460102�025054� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"safe_mode": "replace"} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue2_safe_mode_borks_markup.tags������������������������������������0000644�0000765�0000024�00000000012�12240460102�025024� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������safe_mode ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue2_safe_mode_borks_markup.text������������������������������������0000644�0000765�0000024�00000000170�12240460102�025057� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Heading 2 blah <script>alert('this should be removed')</script> **blah** <script>alert('as should this')</script> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue3_bad_code_color_hack.html���������������������������������������0000644�0000765�0000024�00000001007�13354235144�024260� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- -*- coding: utf-8 -*- --> <h2>заголовок</h2> <p>Example from <a href="http://code.google.com/p/python-markdown2/issues/detail?id=3#c8">http://code.google.com/p/python-markdown2/issues/detail?id=3#c8</a>.</p> <p>Some python code:</p> <div class="codehilite"><pre><span></span><code><span class="c1"># комментарий</span> <span class="k">if</span> <span class="bp">True</span><span class="p">:</span> <span class="k">print</span> <span class="s2">"hi"</span> </code></pre></div> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue3_bad_code_color_hack.opts���������������������������������������0000644�0000765�0000024�00000000033�12240460102�024262� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["code-color"]} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue3_bad_code_color_hack.tags���������������������������������������0000644�0000765�0000024�00000000051�12240460102�024233� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra code-color unicode pygments issue3 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue3_bad_code_color_hack.text���������������������������������������0000644�0000765�0000024�00000000345�12240460102�024267� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- -*- coding: utf-8 -*- --> ## заголовок Example from <http://code.google.com/p/python-markdown2/issues/detail?id=3#c8>. Some python code: :::python # комментарий if True: print "hi"�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue52_hang.html�����������������������������������������������������0000644�0000765�0000024�00000000005�12240460102�021335� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������blah ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue52_hang.tags�����������������������������������������������������0000644�0000765�0000024�00000000025�12240460102�021331� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue52 knownfailure �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue52_hang.text�����������������������������������������������������0000644�0000765�0000024�00000000436�12240460102�021365� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + howdy + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Privacy Policy: http://www.PetitionOnline.org/privacy-pets.html + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue54_escape_link_title.html����������������������������������������0000644�0000765�0000024�00000001027�12240460102�024105� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a href="http://example.com" title="lorem [ipsum] dolor <sit> amet">foo</a></p> <p><img src="http://example.com/foo.gif" alt="fooimg" title="lorem [ipsum] dolor <sit> amet" /></p> <p><img src="http://example.com/foo.gif" alt=""this" [is] my <alt> text" title="lorem [ipsum] dolor <sit> amet" /></p> <p><a href="http://example.com" title="lorem [ipsum] dolor <sit> amet">bar</a></p> <p><img src="http://example.com/bar.png" alt="barimg" title="lorem [ipsum] dolor <sit> amet" /></p> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue54_escape_link_title.tags����������������������������������������0000644�0000765�0000024�00000000010�12240460102�024066� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue54 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/issue54_escape_link_title.text����������������������������������������0000644�0000765�0000024�00000000573�12240460102�024132� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[foo](http://example.com "lorem [ipsum] dolor <sit> amet") ![fooimg](http://example.com/foo.gif "lorem [ipsum] dolor <sit> amet") !["this" [is] my <alt> text](http://example.com/foo.gif "lorem [ipsum] dolor <sit> amet") [bar][id] ![barimg][idimg] [id]: http://example.com "lorem [ipsum] dolor <sit> amet" [idimg]: http://example.com/bar.png "lorem [ipsum] dolor <sit> amet" �������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_defn_alt_title_delims.html���������������������������������������0000644�0000765�0000024�00000000630�12240460102�024374� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Alternative delimiters for <a href="http://daringfireball.net/projects/markdown/syntax#link" title="link syntax">link definitions</a> are allowed -- as of Markdown 1.0.2, I think. Hence, <a href="http://daringfireball.net/projects/markdown/syntax#link" title="link syntax">this link</a> and <a href="http://daringfireball.net/projects/markdown/syntax#link" title="link syntax">this link</a> work too.</p> ��������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_defn_alt_title_delims.text���������������������������������������0000644�0000765�0000024�00000000614�12240460102�024416� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Alternative delimiters for [link definitions][link1] are allowed -- as of Markdown 1.0.2, I think. Hence, [this link][link2] and [this link][link3] work too. [link1]: http://daringfireball.net/projects/markdown/syntax#link "link syntax" [link2]: http://daringfireball.net/projects/markdown/syntax#link 'link syntax' [link3]: http://daringfireball.net/projects/markdown/syntax#link (link syntax) ��������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_defn_spaces_in_url.html������������������������������������������0000644�0000765�0000024�00000000455�13026003713�023715� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is <a href="javascript:alert("hi there");">a link</a> and <a href="javascript:alert("hi again");" title="that's twice now">another</a>.</p> <p>This is a <a href="/images/thumbs/phpThumb.php?src=/archive/img/1241/1241_10_game.jpg&w=200">crazy one</a> from issue18.</p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_defn_spaces_in_url.tags������������������������������������������0000644�0000765�0000024�00000000010�12240460102�023666� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue18 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_defn_spaces_in_url.text������������������������������������������0000644�0000765�0000024�00000000373�12240460102�023730� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is [a link][1] and [another][2]. This is a [crazy one][3] from issue18. [1]: javascript:alert("hi there"); [2]: javascript:alert("hi again"); "that's twice now" [3]: /images/thumbs/phpThumb.php?src=/archive/img/1241/1241_10_game.jpg&w=200 () ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_nofollow.html����������������������������������������������������0000644�0000765�0000024�00000001436�13053342564�021744� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a rel="nofollow" href="http://example.com">link</a></p> <p><a rel="nofollow" href="http://example.com/test#fragment">foo</a></p> <p><a href="#fragment">bar</a></p> <p>Pre-block:</p> <pre><code>Here is a raw link: <a href="http://example.com/one">one</a> </code></pre> <p>Raw HTML links: <a rel="nofollow" href="http://example.com/two">two</a> <a rel="nofollow" href="http://example.com/three" rel="nofollow">three</a> <a rel="nofollow" href="http://example.com/four" rel="foo">four</a> <a>five</a> <a rel="nofollow" href="//example.com/six">six</a> <A rel="nofollow" HREF="http://example.com/seven">seven</A> <a rel="nofollow" foo=bar href="http://example.com/eight">eight</a> <a rel="nofollow" href="http://example.com/test#fragment">nine</a> <a href="#fragment">ten</a> </p> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_nofollow.opts����������������������������������������������������0000644�0000765�0000024�00000000031�12345160534�021751� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["nofollow"]} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_nofollow.tags����������������������������������������������������0000644�0000765�0000024�00000000030�12345160534�021721� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extras issue74 issue104 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_nofollow.text����������������������������������������������������0000644�0000765�0000024�00000001100�13053342564�021750� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[link](http://example.com) [foo](http://example.com/test#fragment) [bar](#fragment) Pre-block: Here is a raw link: <a href="http://example.com/one">one</a> <p>Raw HTML links: <a href="http://example.com/two">two</a> <a href="http://example.com/three" rel="nofollow">three</a> <a href="http://example.com/four" rel="foo">four</a> <a>five</a> <a href="//example.com/six">six</a> <A HREF="http://example.com/seven">seven</A> <a foo=bar href="http://example.com/eight">eight</a> <a href="http://example.com/test#fragment">nine</a> <a href="#fragment">ten</a> </p> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns.html����������������������������������������������������0000644�0000765�0000024�00000000403�12240460102�021720� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a href="http://code.activestate.com/recipes/123/">Recipe 123</a> and <a href="http://bugs.activestate.com/show_bug.cgi?id=234">Komodo bug 234</a> are related.</p> <p><a href="http://www.python.org/dev/peps/pep-0042/">PEP 42</a> might be related too.</p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns.opts����������������������������������������������������0000644�0000765�0000024�00000000546�12240460102�021751� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["link-patterns"], "link_patterns": [ (re.compile("recipe\s+(\d+)", re.I), r"http://code.activestate.com/recipes/\1/"), (re.compile("(?:komodo\s+)?bug\s+(\d+)", re.I), r"http://bugs.activestate.com/show_bug.cgi?id=\1"), (re.compile("PEP\s+(\d+)", re.I), lambda m: "http://www.python.org/dev/peps/pep-%04d/" % int(m.group(1))), ], } ����������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns.text����������������������������������������������������0000644�0000765�0000024�00000000110�12240460102�021733� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Recipe 123 and Komodo bug 234 are related. PEP 42 might be related too.��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_double_hit.html�����������������������������������������0000644�0000765�0000024�00000000272�12240460102�024122� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>There once was a <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=123">Mozilla bug 123</a> and a <a href="http://bugs.activestate.com/show_bug.cgi?id=123">Komodo bug 123</a>.</p> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_double_hit.opts�����������������������������������������0000644�0000765�0000024�00000000406�12240460102�024142� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["link-patterns"], "link_patterns": [ (re.compile(r'mozilla\s+bug\s+(\d+)', re.I), r'http://bugzilla.mozilla.org/show_bug.cgi?id=\1'), (re.compile("(?:komodo\s+)?bug\s+(\d+)", re.I), r"http://bugs.activestate.com/show_bug.cgi?id=\1"), ], } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_double_hit.tags�����������������������������������������0000644�0000765�0000024�00000000016�12240460102�024110� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������link_patterns ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_double_hit.text�����������������������������������������0000644�0000765�0000024�00000000067�12240460102�024144� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������There once was a Mozilla bug 123 and a Komodo bug 123. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_edge_cases.html�����������������������������������������0000644�0000765�0000024�00000000145�12240460102�024065� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a href="http://foo.com/blah_blah_blah/123">Blah 123</a> becomes a line with two underscores.</p> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_edge_cases.opts�����������������������������������������0000644�0000765�0000024�00000000206�12240460102�024104� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["link-patterns"], "link_patterns": [ (re.compile("Blah\s+(\d+)", re.I), r"http://foo.com/blah_blah_blah/\1"), ], } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_edge_cases.tags�����������������������������������������0000644�0000765�0000024�00000000016�12240460102�024054� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������link_patterns ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_edge_cases.text�����������������������������������������0000644�0000765�0000024�00000000056�12240460102�024106� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Blah 123 becomes a line with two underscores. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_markdown_syntax.html������������������������������������0000644�0000765�0000024�00000000356�13347747577�025300� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a href="Recipe 123">This is a markdown link</a></p> <p><a href="Recipe 123" title="Recipe 123">This is a markdown link with title</a></p> <p>[Recipe 123]</p> <p><a href="http://code.activestate.com/recipes/123/">Recipe 123</a></p> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_markdown_syntax.opts������������������������������������0000644�0000765�0000024�00000000215�13347747577�025313� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["link-patterns"], "link_patterns": [ (re.compile("recipe\s+(\d+)", re.I), r"http://code.activestate.com/recipes/\1/"), ], }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_patterns_markdown_syntax.text������������������������������������0000644�0000765�0000024�00000000176�13347747577�025320� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[This is a markdown link](Recipe 123) [This is a markdown link with title](Recipe 123 "Recipe 123") [Recipe 123] Recipe 123��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_safe_urls.html���������������������������������������������������0000644�0000765�0000024�00000000440�13230242702�022050� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a href="https://www.example.com">Safe link 1</a></p> <p><a href="http://www.example.com">Safe link 2</a></p> <p><a href="ftp://www.example.com">Safe link 3</a></p> <p><a href="#anchor">Safe link 4</a></p> <p><a href="#">Unsafe link 1</a></p> <p><a href="#">Unsafe link 2</a></p> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_safe_urls.opts���������������������������������������������������0000644�0000765�0000024�00000000030�13230242702�022064� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"safe_mode": "escape"} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_safe_urls.tags���������������������������������������������������0000644�0000765�0000024�00000000012�13230242702�022035� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������safe_mode ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_safe_urls.text���������������������������������������������������0000644�0000765�0000024�00000000322�13230242702�022067� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[Safe link 1](https://www.example.com) [Safe link 2](http://www.example.com) [Safe link 3](ftp://www.example.com) [Safe link 4](#anchor) [Unsafe link 1](unknown://www.example.com) [Unsafe link 2](example) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_with_blank.html��������������������������������������������������0000644�0000765�0000024�00000000252�13053342564�022222� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a target="_blank" href="http://www.example.com">Ref</a></p> <p><a href="#bar">Foo</a></p> <p><a target="_blank" href="http://www.example.com/two#three">One</a></p> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_with_blank.opts��������������������������������������������������0000644�0000765�0000024�00000000043�12725722750�022245� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["target-blank-links"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_with_blank.tags��������������������������������������������������0000644�0000765�0000024�00000000020�12725722750�022211� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extras issue213 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/link_with_blank.text��������������������������������������������������0000644�0000765�0000024�00000000124�13053342564�022240� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[Ref](http://www.example.com) [Foo](#bar) [One](http://www.example.com/two#three) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/lists.html������������������������������������������������������������0000644�0000765�0000024�00000000221�12240460102�020177� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>count:</p> <ul> <li>one</li> <li>two</li> <li>three</li> </ul> <p>count in spanish:</p> <ol> <li>uno</li> <li>dos</li> <li>tres</li> </ol> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/lists.text������������������������������������������������������������0000644�0000765�0000024�00000000106�12240460102�020221� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������count: * one * two * three count in spanish: 1. uno 2. dos 3. tres ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/lists2.html�����������������������������������������������������������0000644�0000765�0000024�00000000242�12240460102�020264� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>mixed bullets:</p> <ul> <li>a</li> <li>b</li> <li>c</li> </ul> <p>ul followed by ol:</p> <ul> <li>a</li> <li>b</li> </ul> <ol> <li>1</li> <li>2</li> </ol> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/lists2.tags�����������������������������������������������������������0000644�0000765�0000024�00000000010�12240460102�020247� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue16 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/lists2.text�����������������������������������������������������������0000644�0000765�0000024�00000000105�12240460102�020302� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������mixed bullets: * a - b + c ul followed by ol: - a - b 1. 1 2. 2 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/long_link.html��������������������������������������������������������0000644�0000765�0000024�00000002156�13010427526�021037� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>works</h1> <p><a href="http://tuxdeluxe.org/node/287">wever installation of Kunnafonix was resisted by many of the local organizations they had to work with The local "computer person" resented a solution that was so easy to use that it undermined the power and prestige they received by being the person to consult when a Windows computer had problems</a></p> <h1>issue 24: these fail</h1> <p><a href="http://tuxdeluxe.org/node/287">wever installation of Kunnafonix was resisted by many of the local organizations they had to work with The local "computer person" resented a solution that was so easy to use that it undermined the power and prestige they received by being the person to consult when a Windows computer had problems</a></p> <p><a href="http://tuxdeluxe.org/node/287">However installation of Kunnafonix was resisted by many of the local organizations they had to work with The local "computer person" resented a solution that was so easy to use that it undermined the power and prestige they received by being the person to consult when a Windows computer had problems</a></p> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/long_link.tags��������������������������������������������������������0000644�0000765�0000024�00000000010�12240460102�021003� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue24 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/long_link.text��������������������������������������������������������0000644�0000765�0000024�00000002015�12240460102�021040� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# works [wever installation of Kunnafonix was resisted by many of the local organizations they had to work with The local "computer person" resented a solution that was so easy to use that it undermined the power and prestige they received by being the person to consult when a Windows computer had problems](http://tuxdeluxe.org/node/287) # issue 24: these fail [wever installation of Kunnafonix was resisted by many of the local organizations they had to work with The local "computer person" resented a solution that was so easy to use that it undermined the power and prestige they received by being the person to consult when a Windows computer had problems](http://tuxdeluxe.org/node/287) [However installation of Kunnafonix was resisted by many of the local organizations they had to work with The local "computer person" resented a solution that was so easy to use that it undermined the power and prestige they received by being the person to consult when a Windows computer had problems](http://tuxdeluxe.org/node/287) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/markdown_in_html.html�������������������������������������������������0000644�0000765�0000024�00000001343�12240460102�022403� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="using-headings-to-test-toc-and-markdown-in-html-together">Using headings to test toc and markdown-in-html together</h1> <ul> <li>apples</li> <li>bananas</li> </ul> <div> <p>This is <em>true</em> markdown text.</p> </div> <div class="bar"> <h2 id="this-too">This <strong>too</strong>.</h2> <p>And a paragraph</p> </div> <div class="foo"> <p>And <strong>this</strong>.</p> </div> <section> <p>And even <strong>this</strong> in an HTML5 block tag.</p> </section> <h1 id="veggies">Veggies</h1> <ul> <li>carrots</li> <li>lettuce</li> </ul> <!-- This isn't currently supported (as it is in PHP Markdown), but it might be one day. --> <table> <tr> <td markdown="1">This is *true* markdown text.</td> </tr> </table> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/markdown_in_html.opts�������������������������������������������������0000644�0000765�0000024�00000000050�12240460102�022416� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["markdown-in-html", "toc"]} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/markdown_in_html.tags�������������������������������������������������0000644�0000765�0000024�00000000033�12240460102�022370� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown-in-html toc extra �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/markdown_in_html.text�������������������������������������������������0000644�0000765�0000024�00000001045�12240460102�022422� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Using headings to test toc and markdown-in-html together - apples - bananas <div markdown="1"> This is *true* markdown text. </div> <div class="bar" markdown="1"> ## This **too**. And a paragraph </div> <div markdown="1" class="foo"> And **this**. </div> <section markdown="1"> And even **this** in an HTML5 block tag. </section> # Veggies - carrots - lettuce <!-- This isn't currently supported (as it is in PHP Markdown), but it might be one day. --> <table> <tr> <td markdown="1">This is *true* markdown text.</td> </tr> </table> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/metadata.html���������������������������������������������������������0000644�0000765�0000024�00000000171�13122004071�020624� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>The real text</h1> <p>This should be parsed as before</p> <p>This should not be included in the metadata: test</p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/metadata.opts���������������������������������������������������������0000644�0000765�0000024�00000000031�12240460102�020641� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["metadata"]} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/metadata.tags���������������������������������������������������������0000644�0000765�0000024�00000000027�12240460102�020617� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra metadata issue78 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/metadata.text���������������������������������������������������������0000644�0000765�0000024�00000000454�13122004071�020650� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- test: abc this-is : a hyphen test leading~space : is okay And: some, cvs, data, which, you, must, parse, yourself empty : and some: > long value that goes multiline another: example --- # The real text This should be parsed as before This should not be included in the metadata: test ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/metadata2.html��������������������������������������������������������0000644�0000765�0000024�00000000171�13122004071�020706� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>The real text</h1> <p>This should be parsed as before</p> <p>This should not be included in the metadata: test</p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/metadata2.opts��������������������������������������������������������0000644�0000765�0000024�00000000031�12732035532�020736� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["metadata"]} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/metadata2.tags��������������������������������������������������������0000644�0000765�0000024�00000000027�12732035532�020714� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra metadata issue78 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/metadata2.text��������������������������������������������������������0000644�0000765�0000024�00000000453�13122004071�020731� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������test: abc this-is : a hyphen test leading~space : is okay And: some, cvs, data, which, you, must, parse, yourself empty : another long: > long value that goes multiline another: example # The real text This should be parsed as before This should not be included in the metadata: test ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/mismatched_footnotes.html���������������������������������������������0000644�0000765�0000024�00000001212�12345160534�023274� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is sentence has a footnote foo<sup class="footnote-ref" id="fnref-foo"><a href="#fn-foo">1</a></sup> and whamo[^whamo].</p> <p>This is another para with a numbered footnote<sup class="footnote-ref" id="fnref-6"><a href="#fn-6">2</a></sup>.</p> <div class="footnotes"> <hr /> <ol> <li id="fn-foo"> <p>Here is the body of the footnote foo. <a href="#fnref-foo" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> </li> <li id="fn-6"> <p>Here is the body of the footnote 6. <a href="#fnref-6" class="footnoteBackLink" title="Jump back to footnote 2 in the text.">↩</a></p> </li> </ol> </div> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/mismatched_footnotes.opts���������������������������������������������0000644�0000765�0000024�00000000032�12240460102�023300� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["footnotes"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/mismatched_footnotes.text���������������������������������������������0000644�0000765�0000024�00000000372�12240460102�023306� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is sentence has a footnote foo[^foo] and whamo[^whamo]. This is another para with a numbered footnote[^6]. [^foo]: Here is the body of the footnote foo. [^bar]: Here is the body of the footnote bar. [^6]: Here is the body of the footnote 6. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/missing_link_defn.html������������������������������������������������0000644�0000765�0000024�00000000127�12240460102�022530� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is a [missing link][missing] and a <a href="http://foo.com">used link</a>.</p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/missing_link_defn.text������������������������������������������������0000644�0000765�0000024�00000000157�12240460102�022553� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ This is a [missing link][missing] and a [used link][used]. [used]: http://foo.com [unused]: http://foo.com �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/nested_list.html������������������������������������������������������0000644�0000765�0000024�00000000266�12240460102�021367� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>shopping list:</p> <ul> <li>veggies <ul> <li>carrots</li> <li>lettuce</li> </ul></li> <li>fruits <ul> <li>oranges</li> <li>apples</li> <li><em>peaches</em></li> </ul></li> </ul> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/nested_list.text������������������������������������������������������0000644�0000765�0000024�00000000152�12240460102�021401� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������shopping list: - veggies + carrots + lettuce - fruits + oranges + apples + *peaches* ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/nested_list_safe_mode.html��������������������������������������������0000644�0000765�0000024�00000000266�12240460102�023371� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>shopping list:</p> <ul> <li>veggies <ul> <li>carrots</li> <li>lettuce</li> </ul></li> <li>fruits <ul> <li>oranges</li> <li>apples</li> <li><em>peaches</em></li> </ul></li> </ul> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/nested_list_safe_mode.opts��������������������������������������������0000644�0000765�0000024�00000000024�12240460102�023402� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{'safe_mode': True} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/nested_list_safe_mode.tags��������������������������������������������0000644�0000765�0000024�00000000021�12240460102�023350� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue9 safe_mode ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/nested_list_safe_mode.text��������������������������������������������0000644�0000765�0000024�00000000152�12240460102�023403� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������shopping list: - veggies + carrots + lettuce - fruits + oranges + apples + *peaches* ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/not_quite_a_list.html�������������������������������������������������0000644�0000765�0000024�00000000611�12240460102�022406� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<ul> <li>This</li> <li>is</li> <li>a list.</li> </ul> <p>And:</p> <ul> <li><em>This</em> is</li> <li>a list</li> <li>too.</li> </ul> <p>However, because ASCII art can have long dash/asterisk lines let ensure that:</p> <p>- - - - - - - This isn't a list.</p> <p>* * Nor is this a list.</p> <p>- - - Or this.</p> <p>- - - - - - - - - - + hi there ascii art - - - - - - - - - - +</p> �����������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/not_quite_a_list.text�������������������������������������������������0000644�0000765�0000024�00000000432�12240460102�022427� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������- This - is - a list. And: * *This* is * a list * too. However, because ASCII art can have long dash/asterisk lines let ensure that: - - - - - - - This isn't a list. * * Nor is this a list. - - - Or this. - - - - - - - - - - + hi there ascii art - - - - - - - - - - + ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/numbering.html��������������������������������������������������������0000644�0000765�0000024�00000002366�12753232173�021061� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is an image with a caption</p> <p><img src="https://consequenceofsound.files.wordpress.com/2015/10/screen-shot-2015-10-17-at-6-57-13-pm.png?w=807"</img></p> <figcaption class="imagenumbers" id="counter-ref-rickroll">Image 1: Let's Rick Roll You</figcaption> <p>And we can refer to the rickrolling image as Image <a class="imagenumbers" href="#counter-ref-rickroll">1</a>. There is a second image of something else</p> <p><img src="https://wonderifyouwonder.files.wordpress.com/2012/02/anchor.jpg"></img></p> <figcaption class="imagenumbers" id="counter-ref-kent">Figure 2: I for one welcome our new insect overlords</figcaption> <p>So we can refer to Figure <a class="imagenumbers" href="#counter-ref-rickroll">1</a> and Figure <a class="imagenumbers" href="#counter-ref-kent">2</a> separately.</p> <h1>Here is a table</h1> <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> <td>Cell 4</td> </tr> </tbody> </table> <figcaption class="tablenumbers" id="counter-ref-exampletable">Table 1: An example table</figcaption> <p>Which we can refer to as table <a class="tablenumbers" href="#counter-ref-exampletable">1</a></p> <p>And so we are done.</p> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/numbering.opts��������������������������������������������������������0000644�0000765�0000024�00000000032�13165754567�021104� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["numbering"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/numbering.text��������������������������������������������������������0000644�0000765�0000024�00000002365�12753232173�021100� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>This is an image with a caption</p> <p><img src="https://consequenceofsound.files.wordpress.com/2015/10/screen-shot-2015-10-17-at-6-57-13-pm.png?w=807"</img></p> <figcaption class="imagenumbers" id="counter-ref-rickroll">Image 1: Let's Rick Roll You</figcaption> <p>And we can refer to the rickrolling image as Image <a class="imagenumbers" href="#counter-ref-rickroll">1</a>. There is a second image of something else</p> <p><img src="https://wonderifyouwonder.files.wordpress.com/2012/02/anchor.jpg"></img></p> <figcaption class="imagenumbers" id="counter-ref-kent">Figure 2: I for one welcome our new insect overlords</figcaption> <p>So we can refer to Figure <a class="imagenumbers" href="#counter-ref-rickroll">1</a> and Figure <a class="imagenumbers" href="#counter-ref-kent">2</a> separately.</p> <h1>Here is a table</h1> <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> <td>Cell 4</td> </tr> </tbody> </table> <figcaption class="tablenumbers" id="counter-ref-exampletable">Table 1: An example table</figcaption> <p>Which we can refer to as table <a class="tablenumbers" href="#counter-ref-exampletable">1</a></p> <p>And so we are done.</p>���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/parens_in_url_4.html��������������������������������������������������0000644�0000765�0000024�00000000125�12240460102�022127� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a href="/url(test)" title="title">Inline link 4 with non-escaped parens</a>.</p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/parens_in_url_4.tags��������������������������������������������������0000644�0000765�0000024�00000000077�12240460102�022127� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������fromphpmarkdown # from PHP Markdown test "Parens in URL.text" �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/parens_in_url_4.text��������������������������������������������������0000644�0000765�0000024�00000000077�12240460102�022155� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[Inline link 4 with non-escaped parens](</url(test)> "title"). �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/pi_and_xinclude.html��������������������������������������������������0000644�0000765�0000024�00000000317�12240460102�022174� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>'xml' Extra</h1> <?meta @notes @workinprogress?> <p>Here comes the part that i'm still quite unsure about, but anyway:</p> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter_1.md"/> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/pi_and_xinclude.opts��������������������������������������������������0000644�0000765�0000024�00000000024�12240460102�022210� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["xml"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/pi_and_xinclude.tags��������������������������������������������������0000644�0000765�0000024�00000000020�12240460102�022155� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������xml pi xinclude ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/pi_and_xinclude.text��������������������������������������������������0000644�0000765�0000024�00000000313�12240460102�022210� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������'xml' Extra =========== <?meta @notes @workinprogress?> Here comes the part that i'm still quite unsure about, but anyway: <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter_1.md"/> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/pyshell.html����������������������������������������������������������0000644�0000765�0000024�00000000574�12240460102�020534� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>From Recipe 302035</h1> <p>Some examples:</p> <pre><code>>>> nprint(9876543210) '9 876 543 210' >>> nprint(987654321, period=1, delimiter=",") '9,8,7,6,5,4,3,2,1,0' </code></pre> <p>Indented a bit:</p> <pre><code>>>> 1 + 1 2 </code></pre> <p>Cuddled to previous para (and at end of document):</p> <pre><code>>>> 2 + 2 4 </code></pre> ������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/pyshell.opts����������������������������������������������������������0000644�0000765�0000024�00000000030�12240460102�020540� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["pyshell"]} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/pyshell.text����������������������������������������������������������0000644�0000765�0000024�00000000362�12240460102�020547� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# From Recipe 302035 Some examples: >>> nprint(9876543210) '9 876 543 210' >>> nprint(987654321, period=1, delimiter=",") '9,8,7,6,5,4,3,2,1,0' Indented a bit: >>> 1 + 1 2 Cuddled to previous para (and at end of document): >>> 2 + 2 4 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/raw_html.html���������������������������������������������������������0000644�0000765�0000024�00000000143�12240460102�020661� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Hi, <span foo="*bar*"><em>there</em></span>. <!-- *blah* --> blah</p> <div> **ack** </div> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/raw_html.text���������������������������������������������������������0000644�0000765�0000024�00000000126�12240460102�020702� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Hi, <span foo="*bar*">*there*</span>. <!-- *blah* --> blah <div> **ack** </div> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/ref_links.html��������������������������������������������������������0000644�0000765�0000024�00000000143�12240460102�021020� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a href="http://www.google.com/">Google</a> is fast <img src="/img/star.png" alt="star" />.</p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/ref_links.text��������������������������������������������������������0000644�0000765�0000024�00000000130�12240460102�021034� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[Google][] is fast ![star][]. [google]: http://www.google.com/ [star]: /img/star.png ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/smarty_pants.html�����������������������������������������������������0000644�0000765�0000024�00000007337�12240460102�021604� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h2>Simple substitutions</h2> <p>Here I interrupt myself with an en dash – no, now it’s with—an em dash.</p> <p>And finally…wait for it, and again with spaces…I’ve tested ellipses…and also with even more spaces.</p> <h2>Escapes</h2> <p>Before getting to the hard stuff, I’ll run through all the escape sequences — they shouldn’t need to become HTML entities.</p> <pre><code>\\ \" \' \` \- \. \> </code></pre> <p>The “smarty-pants” extra adds escapes for 'single quotes' and "double quotes" in case you want to force dumb quotes.</p> <h2>Quotation marks</h2> <p>You’ll notice that I began this document with a quotation to test a potential error: $ is zero-width and \s is one-width, and you can’t have both in a backreference. Meanwhile, I’ve this paragraph has tested contractions four times; ’tis close, but this last apostrophe should fool the regex.</p> <p>“This text” tests to see whether an adjacent <p> tag messes up detection of quotation marks.</p> <p>The docs say, “You can open and close quotations with quotation marks, and they don’t both have to be single or double.” So ‘this” works. And “this.’ And finally, ‘this.’</p> <p>Most of the corrections are consistent with what a word processor might do when autoformatting:</p> <ul> <li>When a single- or double-prime falls between text and whitespace, it opens facing the text.</li> <li>Edge case: in “British grammar”, quotations are closed just before punctuation, so a closing quotation mark may be followed not by whitespace but by one of ,;.?!</li> <li>Other edge cases: nested quotation marks, or perhaps an apostrophe (see directly above) neighboring a quotation mark. The only “easy” solution is to have such quotation marks adjust to actual text, or if they’re only neighbored by whitespace and/or quotation marks, wait for those quotation marks to pick a direction, and then match it. Ick!</li> <li>Other edge cases: opening or closing quotations just within parentheses or brackets of some kind, generally in code, etc. Transformations here are <strong>not</strong> supported because said transformations are only meant to apply to plain English or other natural language; trying to satisfy such edge cases would lead to a slippery slope and bloat.</li> </ul> <h3>Edge case: contractions</h3> <p>A single-prime can be surrounded by text, in which case it becomes an apostrophe and opens left.</p> <p>For common contractions, a space single-prime non-space combination should produce an apostrophe (&#8217;) instead of an opening scare quote (&#8216;).</p> <p>Here is the full list: ’tis, ’twas, ’twer, ’neath, ’o, ’n, ’round, ’bout, ’twixt, ’nuff, ’fraid, ’sup <br /> The full list, capitalized: ’Tis, ’Twas, ’Twer, ’Neath, ’O, ’N, ’Round, ’Bout, ’Twixt, ’Nuff, ’Fraid, ’Sup <br /> And normal text: ‘random ‘stuff ‘that ‘shouldn’t ‘be ‘detected ‘as ‘contractions <br /> And years: ’29 ’91 ‘1942 ‘2001 ‘2010</p> <p>Like quotation marks, the year shorthand expects a year, e.g. '29, to be followed by whitespace or sentence-ending punctuation. Numbers like '456.7 will throw it off, but those aren’t entered very often.</p> <p>These transformations don’t consider whether or not the contraction was preceded by whitespace. If it was preceded by text, then it would have been converted by the standard contraction rule (see the first line of this section).</p> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/smarty_pants.opts�����������������������������������������������������0000644�0000765�0000024�00000000035�12240460102�021611� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["smarty-pants"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/smarty_pants.tags�����������������������������������������������������0000644�0000765�0000024�00000000025�12240460102�021561� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smarty-pants issue42 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/smarty_pants.text�����������������������������������������������������0000644�0000765�0000024�00000006176�12240460102�021624� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Simple substitutions Here I interrupt myself with an en dash -- no, now it's with---an em dash. And finally...wait for it, and again with spaces. . .I've tested ellipses . . . and also with even more spaces. ## Escapes Before getting to the hard stuff, I'll run through all the escape sequences --- they shouldn't need to become HTML entities. \\ \" \' \` \- \. \> The "smarty-pants" extra adds escapes for \'single quotes\' and \"double quotes\" in case you want to force dumb quotes. ## Quotation marks You'll notice that I began this document with a quotation to test a potential error: $ is zero-width and \\s is one-width, and you can't have both in a backreference. Meanwhile, I've this paragraph has tested contractions four times; 'tis close, but this last apostrophe should fool the regex. "This text" tests to see whether an adjacent <p> tag messes up detection of quotation marks. The docs say, "You can open and close quotations with quotation marks, and they don't both have to be single or double." So 'this" works. And "this.' And finally, 'this.' Most of the corrections are consistent with what a word processor might do when autoformatting: * When a single- or double-prime falls between text and whitespace, it opens facing the text. * Edge case: in "British grammar", quotations are closed just before punctuation, so a closing quotation mark may be followed not by whitespace but by one of ,;.?! * Other edge cases: nested quotation marks, or perhaps an apostrophe (see directly above) neighboring a quotation mark. The only "easy" solution is to have such quotation marks adjust to actual text, or if they're only neighbored by whitespace and/or quotation marks, wait for those quotation marks to pick a direction, and then match it. Ick! * Other edge cases: opening or closing quotations just within parentheses or brackets of some kind, generally in code, etc. Transformations here are **not** supported because said transformations are only meant to apply to plain English or other natural language; trying to satisfy such edge cases would lead to a slippery slope and bloat. ### Edge case: contractions A single-prime can be surrounded by text, in which case it becomes an apostrophe and opens left. For common contractions, a space single-prime non-space combination should produce an apostrophe (&#8217;) instead of an opening scare quote (&#8216;). Here is the full list: 'tis, 'twas, 'twer, 'neath, 'o, 'n, 'round, 'bout, 'twixt, 'nuff, 'fraid, 'sup The full list, capitalized: 'Tis, 'Twas, 'Twer, 'Neath, 'O, 'N, 'Round, 'Bout, 'Twixt, 'Nuff, 'Fraid, 'Sup And normal text: 'random 'stuff 'that 'shouldn't 'be 'detected 'as 'contractions And years: '29 '91 '1942 '2001 '2010 Like quotation marks, the year shorthand expects a year, e.g. \'29, to be followed by whitespace or sentence-ending punctuation. Numbers like \'456.7 will throw it off, but those aren't entered very often. These transformations don't consider whether or not the contraction was preceded by whitespace. If it was preceded by text, then it would have been converted by the standard contraction rule (see the first line of this section). ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/smarty_pants_image_links.html�����������������������������������������0000644�0000765�0000024�00000000473�12240460102�024140� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><img src="/path/to/image.jpg" alt="alt text" /></p> <p>How about <img src="/path/to/image.jpg" alt="alt text" /> in other paragraph content?</p> <p>How about <img src="/path/to/image.jpg" alt="" /> sans alt text?</p> <p>How about a <a href="http://example.com" title="with a title">regular link</a> here?</p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/smarty_pants_image_links.opts�����������������������������������������0000644�0000765�0000024�00000000035�12240460102�024153� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["smarty-pants"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/smarty_pants_image_links.tags�����������������������������������������0000644�0000765�0000024�00000000025�12240460102�024123� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������smarty-pants issue76 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/smarty_pants_image_links.text�����������������������������������������0000644�0000765�0000024�00000000336�12240460102�024156� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������![alt text](/path/to/image.jpg) How about ![alt text](/path/to/image.jpg) in other paragraph content? How about ![](/path/to/image.jpg) sans alt text? How about a [regular link](http://example.com "with a title") here? ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/spoiler.html����������������������������������������������������������0000644�0000765�0000024�00000000777�12441155220�020543� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>[First]</p> <blockquote class="spoiler"> <p>This is a spoiler</p> </blockquote> <p>[Second]</p> <blockquote> <p>! But this is <br /> not a spoiler</p> </blockquote> <p>[Third]</p> <blockquote class="spoiler"> <p>A multi-line spoiler <br /> has ! multiple times</p> </blockquote> <p>[Fourth]</p> <blockquote class="spoiler"> <p>Alignment <br /> has no effect <br /> on spoilers</p> </blockquote> <p>[Last]</p> <blockquote class="spoiler"> <p><- still a spoiler</p> </blockquote> �markdown2-2.3.7/test/tm-cases/spoiler.opts����������������������������������������������������������0000644�0000765�0000024�00000000027�12441155220�020550� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["spoiler"]}���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/spoiler.text����������������������������������������������������������0000644�0000765�0000024�00000000341�12441155220�020546� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[First] >! This is a spoiler [Second] >! But this is > not a spoiler [Third] >! A multi-line spoiler >! has ! multiple times [Fourth] >! Alignment > ! has no effect > ! on spoilers [Last] > ! <- still a spoiler �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/strike.html�����������������������������������������������������������0000644�0000765�0000024�00000000127�12575716600�020371� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><strike>This is strike line.</strike></p> <p>So is <strike>this</strike> word.</p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/strike.opts�����������������������������������������������������������0000644�0000765�0000024�00000000027�12575716600�020411� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["strike"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/strike.tags�����������������������������������������������������������0000644�0000765�0000024�00000000016�12575716600�020360� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extras strike ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/strike.text�����������������������������������������������������������0000644�0000765�0000024�00000000057�12575716600�020413� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������~~This is strike line.~~ So is ~~this~~ word. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/sublist-ordered-para.html���������������������������������������������0000644�0000765�0000024�00000000623�12345160534�023113� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>Fails (or used to)</h1> <ol> <li>one</li> <li><p>two</p> <ul> <li>sub one</li> <li>sub two</li> </ul></li> <li><p>three</p></li> </ol> <h1>Works</h1> <ol> <li>one</li> <li><p>two</p> <ul> <li>sub one</li> <li>sub two</li> </ul></li> <li><p>three</p></li> </ol> <h1>Works too</h1> <ol> <li>one</li> <li><p>two</p> <ol> <li>sub one</li> <li>sub two</li> </ol></li> <li><p>three</p></li> </ol> �������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/sublist-ordered-para.tags���������������������������������������������0000644�0000765�0000024�00000000010�12345160534�023073� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue67 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/sublist-ordered-para.text���������������������������������������������0000644�0000765�0000024�00000000315�12345160534�023131� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Fails (or used to) 1. one 2. two - sub one - sub two 3. three # Works 1. one 2. two - sub one - sub two 3. three # Works too 1. one 2. two 1. sub one 2. sub two 3. three �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/sublist-para.html�����������������������������������������������������0000644�0000765�0000024�00000001204�12240460102�021451� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Some quick thoughts from a coder's perspective:</p> <ul> <li><p>The source will be available in a Mercurial ...</p></li> <li><p>Komodo is a Mozilla-based application...</p> <ul> <li>Get a slightly tweaked mozilla build (C++, JavaScript, XUL).</li> <li>Get a slightly tweaks Python build (C).</li> <li>Add a bunch of core logic (Python)...</li> <li>Add Komodo chrome (XUL, JavaScript, CSS, DTDs).</li> </ul> <p><p>What this means is that work on and add significant functionality...</p></li> <li><p>Komodo uses the same extension mechanisms as Firefox...</p></li> <li><p>Komodo builds and runs on Windows, Linux and ...</p></li> </ul></p> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/sublist-para.tags�����������������������������������������������������0000644�0000765�0000024�00000000115�12240460102�021443� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������questionable # <p><p> isn't really correct, but Markdown.pl does the same ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/sublist-para.text�����������������������������������������������������0000644�0000765�0000024�00000001023�12240460102�021470� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Some quick thoughts from a coder's perspective: - The source will be available in a Mercurial ... - Komodo is a Mozilla-based application... - Get a slightly tweaked mozilla build (C++, JavaScript, XUL). - Get a slightly tweaks Python build (C). - Add a bunch of core logic (Python)... - Add Komodo chrome (XUL, JavaScript, CSS, DTDs). What this means is that work on and add significant functionality... - Komodo uses the same extension mechanisms as Firefox... - Komodo builds and runs on Windows, Linux and ... �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/syntax_color.html�����������������������������������������������������0000644�0000765�0000024�00000002036�13354235144�021610� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Here is some sample code:</p> <div class="codehilite"><pre><span></span><code><span class="kn">import</span> <span class="nn">sys</span> <span class="k">def</span> <span class="nf">main</span><span class="p">(</span><span class="n">argv</span><span class="o">=</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">):</span> <span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">()</span> <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">'hi'</span><span class="p">)</span> </code></pre></div> <p>and:</p> <div class="codehilite"><pre><span></span><code><span class="n">use</span> <span class="s1">'zlib'</span> <span class="nb">sub</span> <span class="n">main</span><span class="p">(</span><span class="n">argv</span><span class="p">)</span> <span class="nb">puts</span> <span class="s1">'hi'</span> <span class="k">end</span> </code></pre></div> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/syntax_color.opts�����������������������������������������������������0000644�0000765�0000024�00000000033�12240460102�021607� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["code-color"]} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/syntax_color.tags�����������������������������������������������������0000644�0000765�0000024�00000000032�12240460102�021557� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra code-color pygments ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/syntax_color.text�����������������������������������������������������0000644�0000765�0000024�00000000331�12240460102�021607� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Here is some sample code: :::python import sys def main(argv=sys.argv): logging.basicConfig() log.info('hi') and: :::ruby use 'zlib' sub main(argv) puts 'hi' end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/syntax_color_opts.html������������������������������������������������0000644�0000765�0000024�00000001775�13354235144�022666� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Here is some sample code:</p> <div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><code><span style="color: #008000; font-weight: bold">import</span> <span style="color: #0000FF; font-weight: bold">sys</span> <span style="color: #008000; font-weight: bold">def</span> <span style="color: #0000FF">main</span>(argv<span style="color: #666666">=</span>sys<span style="color: #666666">.</span>argv): logging<span style="color: #666666">.</span>basicConfig() log<span style="color: #666666">.</span>info(<span style="color: #BA2121">'hi'</span>) </code></pre></div> <p>and:</p> <div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span><code>use <span style="color: #BA2121">'zlib'</span> <span style="color: #008000">sub</span> main(argv) <span style="color: #008000">puts</span> <span style="color: #BA2121">'hi'</span> <span style="color: #008000; font-weight: bold">end</span> </code></pre></div> ���markdown2-2.3.7/test/tm-cases/syntax_color_opts.opts������������������������������������������������0000644�0000765�0000024�00000000060�12240460102�022654� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": {"code-color": {"noclasses": True}}} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/syntax_color_opts.tags������������������������������������������������0000644�0000765�0000024�00000000032�12240460102�022624� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra code-color pygments ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/syntax_color_opts.text������������������������������������������������0000644�0000765�0000024�00000000331�12240460102�022654� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Here is some sample code: :::python import sys def main(argv=sys.argv): logging.basicConfig() log.info('hi') and: :::ruby use 'zlib' sub main(argv) puts 'hi' end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/tables.html�����������������������������������������������������������0000644�0000765�0000024�00000011031�13073230773�020332� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1>table no pipes</h1> <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> <td>Cell 4</td> </tr> </tbody> </table> <h1>tables with leading pipe</h1> <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> <td>Cell 4</td> </tr> </tbody> </table> <h1>tables with full bars</h1> <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> <td>Cell 4</td> </tr> </tbody> </table> <h1>tables with mixed bars</h1> <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> <td>Cell 4</td> </tr> </tbody> </table> <h1>tables with bars and leading spacing</h1> <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> <td>Cell 4</td> </tr> </tbody> </table> <p><em>Note:</em> This fails in GFM but works with PHP-Markdown.</p> <h1>table with cuddled following content</h1> <table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> <td>Cell 4</td> </tr> </tbody> </table> <p>after</p> <p><em>Note:</em> This passes GFM, but fails in PHP-Markdown.</p> <h1>FAIL: table with cuddled leading content</h1> <p>before | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | | Cell 3 | Cell 4 |</p> <h1>single column single leading bar</h1> <table> <thead> <tr> <th>Header 1</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> </tr> <tr> <td>Cell 3</td> </tr> </tbody> </table> <h1>single column single trailing bar</h1> <table> <thead> <tr> <th>Header 1</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> </tr> <tr> <td>Cell 3</td> </tr> </tbody> </table> <h1>single column full bars</h1> <table> <thead> <tr> <th>Header 1</th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> </tr> <tr> <td>Cell 3</td> </tr> </tbody> </table> <h1>narrow col 1</h1> <table> <thead> <tr> <th>H</th> </tr> </thead> <tbody> <tr> <td>1</td> </tr> <tr> <td>2</td> </tr> </tbody> </table> <p><em>Note:</em> This works in PHP-Markdown, fails in GFM.</p> <h1>narrow col 2</h1> <table> <thead> <tr> <th>He</th> </tr> </thead> <tbody> <tr> <td>1</td> </tr> <tr> <td>2</td> </tr> </tbody> </table> <p><em>Note:</em> This works in PHP-Markdown, fails in GFM.</p> <h1>narrow col 3</h1> <table> <thead> <tr> <th>He</th> </tr> </thead> <tbody> <tr> <td>1</td> </tr> <tr> <td>2</td> </tr> </tbody> </table> <p><em>Note:</em> Works in both PHP-Markdown and GFM.</p> <h1>FAIL: no dash</h1> <p>| He | | :: | | 1 | | 2 |</p> <p><em>Note</em>: This fails in GFM and <em>sort of</em> works in PHP-Markdown, where it sets to align=center. I'm going to make this <em>fail</em> in markdown2.py, i.e. the rule is it must have at least a single dash in there.</p> <h1>table with markup in cells</h1> <table> <thead> <tr> <th>Header 1</th> <th><em>Header</em> 2</th> </tr> </thead> <tbody> <tr> <td><code>Cell 1</code></td> <td><a href="http://example.com">Cell 2</a> link</td> </tr> <tr> <td>Cell 3</td> <td><strong>Cell 4</strong></td> </tr> </tbody> </table> <h1>table in blockquote</h1> <blockquote> <table> <thead> <tr> <th>One</th> <th>Two</th> <th>Three</th> </tr> </thead> <tbody> <tr> <td>grinch</td> <td>stole</td> <td>xmas</td> </tr> <tr> <td>green</td> <td><strong>eggs</strong></td> <td>ham</td> </tr> </tbody> </table> <p>-- Dr. Seuss</p> </blockquote> <h1>table with blank cells</h1> <table> <thead> <tr> <th>Header 1</th> <th></th> </tr> </thead> <tbody> <tr> <td>Cell 1</td> <td></td> </tr> <tr> <td></td> <td>Cell 4</td> </tr> </tbody> </table> <h1>table in blockquote with empty cells</h1> <blockquote> <table> <thead> <tr> <th></th> <th>Two</th> <th>Three</th> </tr> </thead> <tbody> <tr> <td>grinch</td> <td>stole</td> <td></td> </tr> <tr> <td>green</td> <td><strong>eggs</strong></td> <td>ham</td> </tr> </tbody> </table> <p>-- Dr. Seuss</p> </blockquote> <h1>escaping of pipes</h1> <table> <thead> <tr> <th>A</th> <th>|</th> <th>C | C</th> </tr> </thead> <tbody> <tr> <td>||</td> <td>BB</td> <td>C</td> </tr> </tbody> </table> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/tables.opts�����������������������������������������������������������0000644�0000765�0000024�00000000027�12422360626�020354� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["tables"]} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/tables.tags�����������������������������������������������������������0000644�0000765�0000024�00000000015�12422360626�020322� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra tables �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/tables.text�����������������������������������������������������������0000644�0000765�0000024�00000004416�13073230773�020363� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# table no pipes Header 1 | Header 2 -------- | -------- Cell 1 | Cell 2 Cell 3 | Cell 4 # tables with leading pipe | Header 1 | Header 2 | -------- | -------- | Cell 1 | Cell 2 | Cell 3 | Cell 4 # tables with full bars | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | | Cell 3 | Cell 4 | # tables with mixed bars Header 1 | Header 2 | -------- | -------- Cell 1 | Cell 2 | | Cell 3 | Cell 4 | # tables with bars and leading spacing | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | | Cell 3 | Cell 4 | *Note:* This fails in GFM but works with PHP-Markdown. # table with cuddled following content | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | | Cell 3 | Cell 4 | after *Note:* This passes GFM, but fails in PHP-Markdown. # FAIL: table with cuddled leading content before | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | | Cell 3 | Cell 4 | # single column single leading bar | Header 1 | -------- | Cell 1 | Cell 3 # single column single trailing bar Header 1 | -------- | Cell 1 | Cell 3 | # single column full bars | Header 1 | | -------- | | Cell 1 | | Cell 3 | # narrow col 1 | H | | - | | 1 | | 2 | *Note:* This works in PHP-Markdown, fails in GFM. # narrow col 2 | He | | -- | | 1 | | 2 | *Note:* This works in PHP-Markdown, fails in GFM. # narrow col 3 | He | | --- | | 1 | | 2 | *Note:* Works in both PHP-Markdown and GFM. # FAIL: no dash | He | | :: | | 1 | | 2 | *Note*: This fails in GFM and *sort of* works in PHP-Markdown, where it sets to align=center. I'm going to make this *fail* in markdown2.py, i.e. the rule is it must have at least a single dash in there. # table with markup in cells | Header 1 | *Header* 2 | | -------- | -------- | | `Cell 1` | [Cell 2](http://example.com) link | | Cell 3 | **Cell 4** | # table in blockquote > | One | Two | Three | > | --- | --- | --- | > |grinch|stole|xmas| > |green|**eggs**|ham| > > -- Dr. Seuss # table with blank cells | Header 1 | | | -------- | -------- | | Cell 1 | | | | Cell 4 | # table in blockquote with empty cells > | | Two | Three | > | --- | --- | --- | > |grinch|stole|| > |green|**eggs**|ham| > > -- Dr. Seuss # escaping of pipes | A | \| | C \| C | |--- |--- | ------ | |\|\|| BB | C | ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/task_list.html��������������������������������������������������������0000644�0000765�0000024�00000000263�13047404203�021052� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<ul> <li><input type="checkbox" class="task-list-item-checkbox" checked disabled> item1</li> <li><input type="checkbox" class="task-list-item-checkbox" disabled> item2</li> </ul> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/task_list.opts��������������������������������������������������������0000644�0000765�0000024�00000000031�12733125736�021100� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["task_list"]}�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/task_list.tags��������������������������������������������������������0000644�0000765�0000024�00000000030�12733125736�021050� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra task_list issue216��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/task_list.text��������������������������������������������������������0000644�0000765�0000024�00000000032�12733125736�021100� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������- [x] item1 - [ ] item2 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_1.html������������������������������������������������������������0000644�0000765�0000024�00000000224�12240460102�020051� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="fruit">Fruit</h1> <ul> <li>apples</li> <li>bananas</li> </ul> <h1 id="veggies">Veggies</h1> <ul> <li>carrots</li> <li>lettuce</li> </ul> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_1.opts������������������������������������������������������������0000644�0000765�0000024�00000000024�12240460102�020070� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["toc"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_1.tags������������������������������������������������������������0000644�0000765�0000024�00000000012�12240460102�020036� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������toc extra ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_1.text������������������������������������������������������������0000644�0000765�0000024�00000000075�12240460102�020075� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Fruit - apples - bananas # Veggies - carrots - lettuce �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_2.html������������������������������������������������������������0000644�0000765�0000024�00000000571�12240460102�020057� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="readme-for-blah">README for Blah</h1> <h2 id="introduction">Introduction</h2> <h2 id="the-meat">The Meat</h2> <h3 id="beef">Beef</h3> <h5 id="steak">Steak</h5> <h5 id="burgers">Burgers</h5> <h3 id="chicken">Chicken</h3> <h3 id="pork">Pork</h3> <h4 id="mmmmmmmm-bacon">Mmmmmmmm, bacon</h4> <h1 id="at-the-top-level-again">At the <em>top</em> level again!?</h1> ���������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_2.opts������������������������������������������������������������0000644�0000765�0000024�00000000024�12240460102�020071� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["toc"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_2.tags������������������������������������������������������������0000644�0000765�0000024�00000000012�12240460102�020037� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������toc extra ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_2.text������������������������������������������������������������0000644�0000765�0000024�00000000242�12240460102�020072� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# README for Blah ## Introduction ## The Meat ### Beef ##### Steak ##### Burgers ### Chicken ### Pork #### Mmmmmmmm, bacon # At the *top* level again!? ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_3.html������������������������������������������������������������0000644�0000765�0000024�00000000571�12345160534�020074� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="readme-for-blah">README for Blah</h1> <h2 id="introduction">Introduction</h2> <h2 id="the-meat">The Meat</h2> <h3 id="beef">Beef</h3> <h5 id="steak">Steak</h5> <h5 id="burgers">Burgers</h5> <h3 id="chicken">Chicken</h3> <h3 id="pork">Pork</h3> <h4 id="mmmmmmmm-bacon">Mmmmmmmm, bacon</h4> <h1 id="at-the-top-level-again">At the <em>top</em> level again!?</h1> ���������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_3.opts������������������������������������������������������������0000644�0000765�0000024�00000000024�12345160534�020106� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["toc"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_3.tags������������������������������������������������������������0000644�0000765�0000024�00000000012�12345160534�020054� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������toc extra ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_3.text������������������������������������������������������������0000644�0000765�0000024�00000000266�12345160534�020115� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������README for Blah =============== ## Introduction The Meat -------- ### Beef ##### Steak ##### Burgers ### Chicken ### Pork #### Mmmmmmmm, bacon # At the *top* level again!? ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_4.html������������������������������������������������������������0000644�0000765�0000024�00000000331�13034776726�020103� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="python">Python</h1> <h2 id="-1">蟒蛇</h2> <ul> <li>外形特性</li> <li>生活习性</li> </ul> <h2 id="markdown">Markdown</h2> <h2 id="-2">标记语言</h2> <ul> <li>类型</li> <li>历史</li> </ul> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_4.opts������������������������������������������������������������0000644�0000765�0000024�00000000024�13034776726�020123� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["toc"]} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_4.tags������������������������������������������������������������0000644�0000765�0000024�00000000012�13034776726�020071� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������toc extra ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_4.text������������������������������������������������������������0000644�0000765�0000024�00000000144�13034776726�020125� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Python ## 蟒蛇 - 外形特性 - 生活习性 ## Markdown ## 标记语言 - 类型 - 历史 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_5.html������������������������������������������������������������0000644�0000765�0000024�00000000224�13361166412�020071� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="fruit">Fruit</h1> <ul> <li>apples</li> <li>bananas</li> </ul> <h1 id="veggies">Veggies</h1> <ul> <li>carrots</li> <li>lettuce</li> </ul> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_5.opts������������������������������������������������������������0000644�0000765�0000024�00000000042�13361166412�020110� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["toc", "header-ids"]} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_5.tags������������������������������������������������������������0000644�0000765�0000024�00000000012�13361166412�020056� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������toc extra ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_5.text������������������������������������������������������������0000644�0000765�0000024�00000000075�13361166412�020115� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Fruit - apples - bananas # Veggies - carrots - lettuce �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_depth.html��������������������������������������������������������0000644�0000765�0000024�00000000571�13203367544�021042� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<h1 id="readme-for-blah">README for Blah</h1> <h2 id="introduction">Introduction</h2> <h2 id="the-meat">The Meat</h2> <h3 id="beef">Beef</h3> <h5 id="steak">Steak</h5> <h5 id="burgers">Burgers</h5> <h3 id="chicken">Chicken</h3> <h3 id="pork">Pork</h3> <h4 id="mmmmmmmm-bacon">Mmmmmmmm, bacon</h4> <h1 id="at-the-top-level-again">At the <em>top</em> level again!?</h1> ���������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_depth.opts��������������������������������������������������������0000644�0000765�0000024�00000000056�13203367544�021061� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "extras": { "toc": {"depth": 3} } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_depth.tags��������������������������������������������������������0000644�0000765�0000024�00000000012�13203367544�021022� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������toc extra ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/toc_depth.text��������������������������������������������������������0000644�0000765�0000024�00000000242�13203367544�021055� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# README for Blah ## Introduction ## The Meat ### Beef ##### Steak ##### Burgers ### Chicken ### Pork #### Mmmmmmmm, bacon # At the *top* level again!? ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/tricky_anchors.html���������������������������������������������������0000644�0000765�0000024�00000000622�12240460102�022070� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><a href="/url/">with [brackets][] in text</a></p> <p><a href="/url/" title="a title">with [[brackets][]] in text</a></p> <p><a href="/url/">full link [like](/this/) in text</a></p> <p><a href="/url/">full link to img <img src="/this/" alt="like" /> is ok</a></p> <p>[only open <a href="/url/" title="a title">bracket(/in/) text</a></p> <p><a href="/in/">only close bracket</a> text](/url/)</p> ��������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/tricky_anchors.text���������������������������������������������������0000644�0000765�0000024�00000000414�12240460102�022107� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������[with [brackets][] in text](/url/) [with [[brackets][]] in text](/url/ "a title") [full link [like](/this/) in text](/url/) [full link to img ![like](/this/) is ok](/url/) [only open [bracket(/in/) text](/url/ 'a title') [only close bracket](/in/) text](/url/) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/two_comments.html�����������������������������������������������������0000644�0000765�0000024�00000000126�12240460102�021563� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><!-- comment one --> paragraph one</p> <p>paragraph two</p> <!-- comment two --> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/two_comments.text�����������������������������������������������������0000644�0000765�0000024�00000000110�12240460102�021574� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!-- comment one --> paragraph one paragraph two <!-- comment two --> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/underline_in_autolink.html��������������������������������������������0000644�0000765�0000024�00000000347�12240460102�023433� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p>Eric wrote up a (long) intro to writing UDL definitions a while back on his blog: <a href="http://blogs.activestate.com/ericp/2007/01/kid_adding_a_ne.html">http://blogs.activestate.com/ericp/2007/01/kid_adding_a_ne.html</a></p> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/underline_in_autolink.text��������������������������������������������0000644�0000765�0000024�00000000224�12240460102�023445� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Eric wrote up a (long) intro to writing UDL definitions a while back on his blog: <http://blogs.activestate.com/ericp/2007/01/kid_adding_a_ne.html> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/wiki_tables.html������������������������������������������������������0000644�0000765�0000024�00000001347�12240460102�021350� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<table> <tbody> <tr><td><em>Year</em></td><td><em>Temperature (low)</em></td><td><em>Temperature (high)</em></td></tr> <tr><td>1900</td><td>-10</td><td>25</td></tr> <tr><td>1910</td><td>-15</td><td>30</td></tr> <tr><td>1920</td><td>-10</td><td>32</td></tr> </tbody> </table> <h1>just one line</h1> <table> <tbody> <tr><td>foo</td><td>bar</td><td>baz</td></tr> </tbody> </table> <h1>blockquote</h1> <blockquote> <table> <tbody> <tr><td>grinch</td><td>stole</td><td>xmas</td></tr> <tr><td>green</td><td><strong>eggs</strong></td><td>ham</td></tr> </tbody> </table> <p>-- Dr. Seuss</p> </blockquote> <h1>end of file</h1> <table> <tbody> <tr><td>ResourceNotFound</td><td>If :login does not exist</td></tr> </tbody> </table> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/wiki_tables.opts������������������������������������������������������0000644�0000765�0000024�00000000034�12240460102�021361� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"extras": ["wiki-tables"]} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/wiki_tables.tags������������������������������������������������������0000644�0000765�0000024�00000000032�12240460102�021330� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������extra wiki-tables issue66 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/wiki_tables.text������������������������������������������������������0000644�0000765�0000024�00000000477�12240460102�021373� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������|| *Year* || *Temperature (low)* || *Temperature (high)* || || 1900 || -10 || 25 || || 1910 || -15 || 30 || || 1920 || -10 || 32 || # just one line ||foo||bar||baz|| # blockquote > ||grinch||stole||xmas|| > ||green||**eggs**||ham|| > > -- Dr. Seuss # end of file ||ResourceNotFound||If :login does not exist|| �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/xss_quotes.html�������������������������������������������������������0000644�0000765�0000024�00000000174�13026003713�021271� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<p><img src="http://static.reddit.com/reddit.com.header.png" onload="alert('javascript injected')" alt="a" /></p> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/xss_quotes.tags�������������������������������������������������������0000644�0000765�0000024�00000000010�12240460102�021244� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issue30 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/test/tm-cases/xss_quotes.text�������������������������������������������������������0000644�0000765�0000024�00000000142�12662470163�021320� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������![a][b] [b]: http://static.reddit.com/reddit.com.header.png" onload="alert('javascript injected') ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������markdown2-2.3.7/TODO.txt����������������������������������������������������������������������������0000644�0000765�0000024�00000006430�12660151162�015007� 0����������������������������������������������������������������������������������������������������ustar �nick����������������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������- py3: py2.4 test (broken?) - add "smarty-pants" extra to wiki - add "html-classes" extra to wiki - more on the "code-color" extra wiki page - better "Extras" wiki page that shows a quick example of each with link for more details. Mention "extensions" for gjuice. - add description of demote-headers extras to wiki - find more unicode edge cases (look for any usage of md5() and make that unicode) - bug: can't have '<\w+' in a code span or code block with safe_mode if there is a '>' somewhere later in the document. E.g. code.as.com-beta/CHANGES.md. It captures all of that. Right answer is to not count code spans or code blocks. - add an issue for this - test cases - idea: better sanitation re-write? lot of work - idea: Change all <,>,& emission from markdown processing to something like {LT}, {GT}, {AMP}, {OPENTAG:$tag[:$class]} (first checking for conflicts and escaping those out of the way). Then do sanitization at the end: escape: escape all <,>,& with entities remove: not supported whitelist: (new) build a reasonable default whitelist of patterns to keep. Takes "extras" argument (and hook for subclassing) to for custom whitelist. Google Code (was it?) had some list of reasonable whitelist stuff. Then unescape these special chars. The use of OPENTAG above would make "html-classes" extra trivial. - test safe_mode on HTML in footnotes - http://www.freewisdom.org/projects/python-markdown/Available_Extensions - Extras.wiki desc of code-color option. Not sure I love the ":::name" markup for the lexer name. - update MDTest 1.1? (see http://six.pairlist.net/pipermail/markdown-discuss/2007-September/000815.html) update MDTest tests from http://git.michelf.com/mdtest/ - I see ref to Markdown.pl 1.0.2 (http://six.pairlist.net/pipermail/markdown-discuss/2007-August/000756.html) Update to that? Yes. Copy, at least, in showdown package. - take a look at other examples/test-cases from http://adlcommunity.net/help.php?file=advanced_markdown.html - get on http://en.wikipedia.org/wiki/Markdown - ask about remaining two MarkdownTest test failures - fix the r135 xml option, add xml extra for it (see email) - perhaps some extras from Maruku and PHP Markdown extra (http://maruku.rubyforge.org/maruku.html#extra) - tables (tho I don't really like the syntax, prefer google codes, see below) - markdown inside literal HTML (if 'markdown="1|true"' attr) - automatic toc generation (wanted that anyway, no a fan of maruku syntax for this) - weird markup in headers and links (does markdown2.py handle this?) - meta-data syntax? One example of this is ids for headers. How about automatically assigning header ids from the name (a la rest)? - at-the-top email-style headers? - maruku's footnote links are 'fn:1' and 'fnref:1' for a footnote id of 'blah'. If this is the PHP Markdown Extras way, then should follow that. - googlecode wiki markup ideas? (http://code.google.com/p/support/wiki/WikiSyntax) - ~~strikeout~~ - <http://daringfireball.net/2004/12/markdown_licensing> at bottom has a wish list: - simple "cite" for blockquote. How about: [Zaphod Breeblebrox] > blah blah > blah - look at http://markedapp.com/ screencast? ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������