| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This adds configuration support for using a custom Pygments formatter,
either by giving the string name, or a custom formatter class (or
callable).
|
|
|
|
|
|
|
|
|
|
| |
The HTML parser has been completely replaced. The new HTML parser is built on Python's html.parser.HTMLParser, which alleviates various bugs and simplifies maintenance of the code.
The md_in_html extension has been rebuilt on the new HTML Parser, which drastically simplifies it. Note that raw HTML elements with a markdown attribute defined are now converted to ElementTree Elements and are rendered by the serializer. Various bugs have been fixed.
Link reference parsing, abbreviation reference parsing and footnote reference parsing has all been moved from preprocessors to blockprocessors, which allows them to be nested within other block level elements. Specifically, this change was necessary to maintain the current behavior in the rebuilt md_in_html extension. A few random edge-case bugs (see the included tests) were resolved in the process.
Closes #595, closes #780, closes #830 and closes #1012.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we'd unescape both `>` and `>` to the same
string because we were running the & => & replacement first.
By changing the order of this replacement, we now convert:
`> >` => `> >`
as expected.
Fixes #988.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add `language-` prefix to output when syntax highlighting is
disabled for both codehilite and fenced_code extensions.
* Add `lang_prefix` config option to customize the prefix.
* Add a 'pygments' env to tox which runs the tests with Pygments
installed. Pygments is locked to a specific version in the env.
* Updated codehilite to accept any Pygments options.
* Refactor fenced code attributes.
- ID attr is defined on `pre` tag.
- Add support for attr_list extension, which allows setting arbitrary
attributes.
- When syntax highlighting is enabled, any pygments options can
be defined per block in the attr list.
- For backward compatibility, continue to support `hi_lines` outside
of an attr_list. That is the only attr other than lang which is allowed
without the brackets (`{}`) of an attr list. Note that if the brackets
exist, then everything, including lang and hl_lines, must be within
them.
* Resolves #775. Resolves #334. Addresses #652.
|
| |
|
|
|
|
|
| |
* Move Patterns sections. Fixes #729.
* Rewrite tree processor docs. Fixes #949.
|
|
|
| |
Resolves #892.
|
|
|
|
|
| |
Fixed #812.
|
|
|
| |
In computing, `whitespace` is a word. See https://en.wikipedia.org/wiki/Whitespace_character.
|
| |
|
|
|
|
| |
And other docs cleanup.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Deprecated naming support is removed:
* Removed special treatment for modules in `markdown.extensions`
* Removed support for `mdx_` prefixes.
Support for Entry Point names added:
Support for "short names" are now implemented with entry points.
Therefore all the users who call extension names as `toc` will not
get errors as the builtin extensions all have entry points defined
which match the old "short names" for modules in
`markdown.extensions`. The benefit is that any extension can offer
the same support without requiring the user to manually copy a file
to that location on the file system (way to many extension authors
have included such instructions in their installation documentation).
The one odd thing about this is that we have been issuing a
DeprecationWarning for short names and now they are fully supported
again. But I think it's the right thing to do.
Support for using dot notation is not removed. After all, it was never
deprecated. And we shouldn't "force" entry points. There are plenty of
reasons why users may not want that and not all of them can be
resolved by using class instances instead.
All of the following ways to load an extension are valid:
# Class instance
from markdown.extensions.toc import TocExtension
markdown.markdown(src, extensions=[TocExtension()]
# Entry point name
markdown.markdown(src, extensions=['toc'])
# Dot notation with class
markdown.markdown(src, extensions=['markdown.extensions.toc:TocExtension'])
# Dot notation without class
markdown.markdown(src, extensions=['markdown.extensions.toc'])
|
| |
|
|
|
|
|
|
| |
* Install deps.
* Ensure test fails if deps are missing.
* Update dictionary for recent docs changes.
|
|
|
|
|
| |
Ancestry exclusion for inline patterns.
Adds the ability for an inline pattern to define a list of ancestor tag names that should be avoided. If a pattern would create a descendant of one of the listed tag names, the pattern will not match. Fixes #596.
|
| |
|
| |
|
| |
|
|
Not sure this is the best way to go, but it works. I'm not crazy about
running the spellcheck against the built docs, but aspell has a builtin
option to easily ignore everything in `<code>` tags which greatly simplfies
things.
I looked at Doug Hellmans' sphinxcontrib-spelling package which does
something similar for Sphinx. However, as Sphinx uses rST and the rST
parser outputs a parse tree, Doug is essentially taking that parse tree
and running the spellcheck on the appropriate parts (skipping code, etc.).
He did a nice [writeup][5] of his development process if you are interested.
As Python-Markdown's parse tree is represented as HTML (through ElementTree)
I would have to use HTML anyway. And [PyEnchant][2] doesn't currently have
good support for HTML. So I used [aspell][3], with inspiration from the
[git-spell-check][4] hook.
[1]: http://sphinxcontrib-spelling.readthedocs.org/en/latest/index.html
[2]: https://pythonhosted.org/pyenchant/
[3]: http://aspell.net/
[4]: https://github.com/mprpic/git-spell-check
[5]: http://doughellmann.com/2011/05/26/creating-a-spelling-checker-for-restructuredtext-documents.html
|