summaryrefslogtreecommitdiff
path: root/markdown
Commit message (Collapse)AuthorAgeFilesLines
...
* Unescape IDs in TOC.Waylan Limberg2019-11-251-1/+8
| | | | | | The slugify function will stript the STX and ETX characters from placeholders for backslash excaped characters. Therefore, we need to unescape any text before passing it to slugify. Fixes #864.
* Show readable error on Python2Waylan Limberg2019-11-251-5/+12
| | | | | | | | | Ensures anyone still using Python 2 gets a readable error message. This does not specify a specific version number to remove the maintenance burden of updating it with each future release. It will likely get removed in the next few releases as it will have served its purpose by then. Fixes #871.
* Bump version to 3.2.dev0.Waylan Limberg2019-11-251-1/+1
| | | | | | As per the Contributing Guide, this should have happened before we commited various 3.2 related changes. In any event, version 3.2 is now officially in development status.
* Drop support for Python 2.7 (#865)Hugo van Kemenade2019-10-2433-178/+111
| | | | | | | * Python syntax upgraded using `pyupgrade --py3-plus` * Travis no longer uses `sudo`. See https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration See #760 for Python Version Support Timeline and related dicussion.
* Always wrap CodeHilite code in <code> tags (#862)Tim Martin2019-09-301-1/+2
| | | Pygments added the `wrapcode` option in version 2.4. Users need to have 2.4+ installed to see the change. However, as earlier versions accepted arbitrary keywords passed to the HTMLFormatter, no error will be raised if the user has an older version of Pygments installed.
* Separate Markdown parsing in HTML to separate extension (#859)Isaac Muse2019-09-042-71/+103
| | | | | Move Markdown parsing from the extra extension to a separate extension called md_in_html.
* Refactor em strong to consolidate code and fix issue #792Isaac Muse2019-09-032-17/+199
|
* Optimize HTML_RE from quadratic time to linear (#804)Anders Kaseorg2019-08-141-1/+1
| | | | | | Remove misleading escaped_chars_in_js test Signed-off-by: Anders Kaseorg <andersk@mit.edu>
* fix(typo): successfullyСаша Черных2019-06-161-1/+1
| | | | | | | | | | | | | ### 1. Summary I fix a typo in a word “successfully”. ### 2. Argumentation + [**Cambridge Dictionary**](https://dictionary.cambridge.org/dictionary/english/successfully) + [**Merriam-Webster**](https://www.merriam-webster.com/dictionary/successful) + [**Lexico (powered by Oxford)**](https://www.lexico.com/en/definition/successfully) Thanks.
* Use https:// links where availableJon Dufresne2019-06-1219-24/+24
|
* Bump version to 3.1.13.1.1Waylan Limberg2019-05-201-1/+1
|
* Prefer public packaging module to pkg_resources' private copy of it (#826)Dmitry Shachnev2019-05-161-1/+4
| | | | | | Some distributions of `pkg_resources` remove the vendored copy of `packaging. Additionally, the vendored copy is not publicly documented and should not be relied on exclusively. Regardless, if `pkg_resources` is installed at all, then we can be fairly certain one of `packaging` or `pkg_resources._vendor.packaging` will be available. That being the case, there is no need to list `packaging` as a dependency. Fixes #825.
* Comply with PEP517 (#824)Dmitry Shachnev2019-05-152-34/+54
| | | | | | | | Add pep517check environment to tox Split version info into a separate file, load it using importlib Fixes #823.
* Bump version to 3.13.1Waylan Limberg2019-03-251-1/+1
|
* Update CLI to support PyYAML 5.1Waylan Limberg2019-03-141-3/+11
| | | | | | | This should avoid any warnings. We use `unsafe_load` because users may need to pass in actual Python objects. As this is only available from the CLI, the user has much worse problems if an attacker can use this as an attach vector.
* Optimize several regexes from quadratic time to linear timeAnders Kaseorg2019-03-061-5/+5
| | | | | | Part of the discussion in #798. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
* Add support for a range to toc_depth.Klaus Mueller2019-02-221-4/+12
| | | | Closes #786.
* Handle overlapping raw HTML matches (#770)Philip Trauner2019-02-071-3/+8
| | | | | Recursively run substitution to handle overlapping matches. Fixes #458.
* Emphasis pattern treats newlines as whitespace (#785)Waylan Limberg2019-02-071-1/+1
| | | | | | 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.
* Allow hashes to be escaped in headers (#763)Isaac Muse2018-12-221-1/+1
| | | | | Adjust pattern to allow for escaped hashes, but take care to not treat escaped escapes before hashes as escaped hashes. Close #762.
* Use a PEP562 implementation for deprecating attributes (#757)Isaac Muse2018-12-223-59/+267
| | | 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.
* add: use stacklevel=2 with warningDaniel Hahler2018-11-141-3/+9
|
* Collapse all whitespace in reference ids (#743)Isaac Muse2018-10-301-1/+1
| | | Previously only newlines preceded by whitespace were collapsed. Fixes #742.
* Deprecate version and version_info (#740)Isaac Muse2018-10-252-5/+66
| | | | 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.
* Up version to 3.1.dev0 (#736)Waylan Limberg2018-10-211-14/+20
| | | | | | | | 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.
* Ensure block elements are defined per instancefacelessuser2018-10-091-12/+12
| | | | Block level elements should be defined per instance, not as base class variables.
* foot note adjustments (#728)Isaac Muse2018-10-091-8/+6
| | | | | | 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.
* Fix double escaping of block code (#727)Isaac Muse2018-10-071-1/+8
| | | | | Fixes #725
* Bump version to 3.0.13.0.1Waylan Limberg2018-09-261-1/+1
|
* Support version_info for backward compat.Waylan Limberg2018-09-261-0/+1
| | | | Related to #709.
* Also update RE_AMP in serializers.pyDmitry Shachnev2018-09-251-1/+1
|
* Make ENTITY_RE support hexadecimal entitiesissue712Dmitry Shachnev2018-09-251-2/+2
| | | | Fixes #712.
* Bring back the old version variable (#709)Filipp Lepalaan2018-09-221-0/+3
| | | | ... for backward compatibility with older (<3.0) versions.
* Bump version to 3.03.0Waylan Limberg2018-09-211-1/+1
|
* Support custom labels in TOC. (#700)Waylan Limberg2018-09-051-2/+9
| | | | | | | | 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.
* Move isBlockLevel to class. (#693)Waylan Limberg2018-07-316-28/+47
| | | | | Allows users and/or extensions to alter the list of block level elements. The old implementation remains with a DeprecationWarning. Fixes #575.
* Deprecate md_globals from extension API. (#697)Waylan Limberg2018-07-3119-19/+35
| | | | | | 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.
* smart_emphasis keyword > legacy_em extension.Waylan Limberg2018-07-315-58/+40
| | | | | | | | | 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.
* Remove lazy_ol keyword. Use sane_lists extension instead.Waylan Limberg2018-07-313-3/+4
| | | | This was adapted from 11408e50 of the md3 branch.
* Fix double escaping of amp in attributes (#670)Isaac Muse2018-07-294-7/+23
| | | | | | | | | | Serializer should only escape & in attributes if not part of &amp; 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.
* Consistent copyright headers.Waylan Limberg2018-07-2713-25/+257
| | | | Fixes #435.
* All Markdown instances are now 'md'. (#691)Waylan Limberg2018-07-2714-83/+130
| | | | | | | | | | | | 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).
* Add 'style' to block level elementsWaylan Limberg2018-07-271-1/+1
| | | Fixes #689.
* Replace homegrown OrderedDict with purpose-built Registry. (#688)Waylan Limberg2018-07-2726-333/+316
| | | | | | | | | | | | | | | | | | | 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.
* More acurate Extension type error msg.Waylan Limberg2018-07-241-3/+5
|
* Add toc_depth parameter to toc extensionJesús Fernández2018-07-241-2/+7
|
* Add missing comma in HTML_EMPTYzyxw592018-07-241-1/+1
| | | 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.
* Add the possibility to set additional classesWhiteWinterWolf2018-07-241-2/+4
| | | | | | | | | | | | | | | | | 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>
* Add support for PY37 and PYPY3.Waylan Limberg2018-07-241-1/+1
|
* Moved enable_attributes keyword to extension: legacy_attrs.Waylan Limberg2018-07-244-41/+51
| | | | | | | 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.