| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This is experimental. More of the HTMLParser methods need to be fleshed
out. So far the basic stuff works as long as there is no invalid HTML in
the document.
|
|
|
|
|
|
| |
Part of the discussion in #798.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
|
|
|
|
| |
Closes #786.
|
|
|
|
|
| |
Recursively run substitution to handle overlapping matches.
Fixes #458.
|
|
|
|
|
|
| |
All whitespace characters should be treated the same by inline patterns.
Previoulsy, emphasis patterns were only accounting for spaces, but not
other whitepsace characters such as newlines. Fixes #783.
|
|
|
|
|
| |
Adjust pattern to allow for escaped hashes, but take care to not treat
escaped escapes before hashes as escaped hashes. Close #762.
|
|
|
| |
Use a vendored Pep562 backport to simulate Python 3.7's new PEP 562 feature. For Python3.7 and later, default to the official implementation.
|
| |
|
|
|
| |
Previously only newlines preceded by whitespace were collapsed. Fixes #742.
|
|
|
|
| |
This essentially implements the closest we can get to PEP 562 which allows for modules to control `__dir__` and `__getattr__` in order to deprecate attributes. Here we provide a wrapper class for the module in `util`. If a module has attributes that need to deprecated, we derive from the wrapper class and define the attributes as functions with the `property` decorator and the provided `deprecated` decorator. The class is instantiated with the module's `__name__` attribute and the class will properly replace the module with the wrapped module. When accessing the depracted attributes, a warning is raised. Closes #739.
|
|
|
|
|
|
|
|
| |
Update version format to be PEP 440 compliant in preparation for #732.
Add `pyproject.toml` file and configure tox to use it. Define requirement for `setuptools>=36` which validates and normalizes the version format.
|
|
|
|
| |
Block level elements should be defined per instance, not as base class variables.
|
|
|
|
|
|
| |
Add a config to set the footnote separator. Also remove rel/rev as they aren't really compatible with HTML5 and we already have classes set for refs and backrefs.
Fixes 723.
|
|
|
|
|
| |
Fixes #725
|
| |
|
|
|
|
| |
Related to #709.
|
| |
|
|
|
|
| |
Fixes #712.
|
|
|
|
| |
... for backward compatibility with older (<3.0) versions.
|
| |
|
|
|
|
|
|
|
|
| |
New `toc_tokens` attribute on Markdown class.
Contains the raw tokens used to build the Table of Contents. Users can
use this to build their own custom Table of Contents rather than needing
to parse the HTML available on the `toc` attribute of the Markdown
class.
|
|
|
|
|
| |
Allows users and/or extensions to alter the list of block level
elements. The old implementation remains with a DeprecationWarning.
Fixes #575.
|
|
|
|
|
|
| |
In the past, most of the config was defined using globals. Today all of
the config is held on the class instance. Therefore, the `md_globals`
parameter is no longer necessary.
|
|
|
|
|
|
|
|
|
| |
The smart_strong extension has been removed and its behavior is now the
default (smart em and smart strong are the default). The legacy_em
extension restores legacy behavior (no smart em or smart strong).
This completes the removal of keywords. All parser behavior is now
modified by extensions, not by keywords on the Markdown class.
|
|
|
|
| |
This was adapted from 11408e50 of the md3 branch.
|
|
|
|
|
|
|
|
|
|
| |
Serializer should only escape & in attributes if not part of &
Better regex avoid Unicode and `_` in amp detection.
In general, we don't want to escape already escaped content, but with code content, we want literal representations of escaped content, so have code content explicitly escape its content before placing in AtomicStrings.
Closes #669.
|
|
|
|
| |
Fixes #435.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, instances of the Markdown class were represented as any one
of 'md', 'md_instance', or 'markdown'. This inconsistency made it
difficult when developing extensions, or just maintaining the existing
code. Now, all instances are consistently represented as 'md'.
The old attributes on class instances still exist, but raise a
DeprecationWarning when accessed. Also on classes where the instance was
optional, the attribute always exists now and is simply None if no
instance was provided (previously the attribute wouldn't exist).
|
|
|
| |
Fixes #689.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All processors and patterns now get "registered" to a Registry.
Each item is given a name (string) and a priority. The name is for
later reference and the priority can be either an integer or float
and is used to sort. Priority is sorted from highest to lowest. A
Registry instance is a list-like iterable with the items auto-sorted
by priority. If two items have the same priority, then they are
listed in the order there were "registered". Registering a new
item with the same name as an already registered item replaces
the old item with the new item (however, the new item is sorted by
its newly assigned priority). To remove an item, "deregister" it by
name or index.
A backwards compatible shim is included so that existing simple
extensions should continue to work. DeprecationWarnings will
be raised for any code which calls the old API.
Fixes #418.
|
| |
|
| |
|
|
|
| |
Because of the missing comma, the last two tags in the list, `meta` and `param` are interpreted as a single string literal `"metaparam"`, so the serializer fails to correctly produce empty elements for `<meta>` and `<param>` tags.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Additional CSS classes names can be appended to the admonition name
using spaces as separators.
The following markdown:
!!! note floatright
This is a floating note.
Generates the following HTML code:
<div class="admonition note floatright">
<p class="admonition-title">Note</p>
<p>This is a floating note.</p>
</div>
|
| |
|
|
|
|
|
|
|
| |
If you have existing documents that use the legacy attributes format,
then you should enable the legacy_attrs extension for those documents.
Everyone is encouraged to use the attr_list extension going forward.
Closes #643. Work adapted from 0005d7a of the md3 branch.
|
|
|
|
|
|
|
|
|
| |
Should be 100% coverage now. The ProcessingInstruction needed to be
imported directly from ElementTree as PY27 was using a PIProxy which
resulted in a bug. Interestingly, PY3 worked fine.
Also removed the encoding code as it was not used. Besides it was only
ever accessable from a private function.
|
|
|
|
| |
Fixes #679.
|
|
|
|
| |
Fixes #671
|
| |
|
|
|
|
|
| |
Also refactor from regex to a list and add comments to explain why the
elements are in the list for future reference. Fixes #543.
|
| |
|
|
|
|
|
| |
Strip only the space character and not things like nbsp in tables. Fixes #635.
|
|
|
|
|
|
|
|
|
|
|
| |
We started with the numbers before HTML5 was a thing and we thought
there might be an XHTML2. Today, we know that all we have are HTML style
tags and XHTML style tags. Nothing else really matters in the real
world.
Note that if '(x)html1' '(x)html4' or '(x)html5' are passed in, the
number is stripped/ignored. Users shouldn't need to change their code
for this.
|
|
|
|
| |
Add new InlineProcessor class that handles inline processing much better and allows for more flexibility. This adds new InlineProcessors that no longer utilize unnecessary pretext and posttext captures. New class can accept the buffer that is being worked on and manually process the text without regex and return new replacement bounds. This helps us to handle links in a better way and handle nested brackets and logic that is too much for regular expression. The refactor also allows image links to have links/paths with spaces like links. Ref #551, #613, #590, #161.
|
|
|
|
|
|
|
|
| |
In the past Markdown used to pass extension config settings to the
Extension class via a positional argument named `config`. That was
deprecated in 2.6 in favor of using keyword arguments (`**kwargs`).
Support has been completely dropped. Only keyword arguments are
accepted.
|
| |
|