markdown2 v1.0.1.12 Release Notes

    • [Issue 26] Fix bug where email auto linking wouldn't work for emails with underscores. E.g. Mail me: <[email protected]> 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'<p>Here is <a href="http://www.python.org/dev/peps/pep-0042/">PEP 42</a>.</p>\n'