summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Bump version to 3.43.4Waylan Limberg2022-07-154-41/+47
| | | Cleaned up the release notes.
* Move backslash unescaping to treeprocessorWaylan Limberg2022-07-156-8/+82
| | | | | | | | | | By unescaping backslash escapes in a treeprocessor, the text is properly escaped during serialization. Fixes #1131. As it is recognized that various third-party extensions may be calling the old class at `postprocessors.UnescapePostprocessor` the old class remains in the codebase, but has been deprecated and will be removed in a future release. The new class `treeprocessors.UnescapeTreeprocessor` should be used instead.
* fixed some spelling mistakesBastian Venthur2022-06-175-8/+8
|
* Remove redundant lines from PrettifyTreeprocessorId3aFly2022-06-131-2/+0
| | | Lines in 409 and 410 are part of an if-condition-block. However, they are called identically L411 and L412 outside of the if-block anyways. Fixes #1267.
* Remove previously deprecated objectsWaylan Limberg2022-05-2710-292/+36
| | | This completely removes all objects which were deprecated in version 3.0 (this change will be included in version 3.4). Given the time that has passed, and the fact that older unmaintained extensions are not likely to support the new minimum Python version, this is little concern about breaking older extensions.
* Update PrettifyTreeprocessor `<pre><code>` handlingfourpoints2022-05-273-3/+43
| | | Fixes #1263.
* Add None check to PrettifyTreeprocessorfourpoints2022-05-252-1/+2
| | | Fixes #1261.
* Drop support for PY36Waylan Limberg2022-05-249-274/+14
| | | | | | | | Python dropped support on 2021-12-23. Our policy (#760) is to drop support on the next point release after Python does. * Remove py36 tests * Test multiple recent versions of pypy * Remove pep562 backport
* Only enumerate extension entry points when requiredAarni Koskela2022-05-243-10/+14
|
* Pass language to Pygments formatter in CodeHiliteLiang-Bo Wang2022-05-185-9/+199
| | | | | | | | * Add an extra option `lang_str` to pass the language of the code block to the specified Pygments formatter. * Include an example custom Pygments formatter in the documentation that includes the language of the code in the output using the new option. Resolves #1255.
* Use `@deprecated` for __setitem__ and __delitem__ of Registry.L2022-05-162-13/+3
|
* Use `@deprecated` for Registry.add()L2022-05-162-7/+2
|
* Support for custom Pygments formatterShrikant Sharat Kandula2022-05-095-4/+161
| | | | | This adds configuration support for using a custom Pygments formatter, either by giving the string name, or a custom formatter class (or callable).
* Support custom CSS class on TOC elementJannis Vajen2022-05-055-1/+56
| | | Closes #1224
* Footnotes improvementsysard2022-05-054-7/+68
| | | | | | | | | | | | | * footnotes: Allow to use backlink title without footnote number - The placeholder '{}' is optional. So a user can choose to include or not the footnote number in the backlink text. - The modification is backward compatible with configurations using the old '%d' placeholder. * footnotes: Allow to use custom superscript text - The addition of a new SUPERSCRIPT_TEXT option allows to specify a placeholder receiving the footnote number for the superscript text.
* fixed link #1154ireznikov2022-05-051-1/+1
|
* Update th/td to use style attributeGaige B Paulsen2022-05-058-641/+943
| | | | | | | | | | This allows better interoperation with CSS style sheets, as the align object on the TH is skipped if the css uses 'text-align: inherit' and the previous 'text-align' is used instead (or the default: left). Added an override to restore the original `align` behavior Moved existing tests to the new test infrastructure Added new tests to test the configuration parameter Updated documentation to document the configuration parameter.
* Bump version to 3.3.73.3.7Waylan Limberg2022-05-052-2/+2
|
* Add markdown-link-check github action.Waylan Limberg2022-05-053-12/+12
| | | | Replaces CLI action run through tox. Closes #1243.
* Ensure fenced code attributes are properly escaped.Waylan Limberg2022-05-043-15/+29
| | | Fixes #1247.
* extensions: copy config dict on each highlighted blockGert van Dijk2022-04-184-2/+81
| | | | | | | | | This fixes a bug where any subsequent highlighted block with codehilite would result in the omission of the style setting, because it was popped off the dict. It would then fall back to pygments_style 'default' after the first block. Fixes #1240
* Fix typos and remove trailing spacesKian-Meng Ang2022-04-1010-38/+38
|
* [style]: fix various typos in docstrings and commentsFlorian Best2022-03-1822-39/+39
|
* Disallow square brackets in reference link ids.Waylan Limberg2022-01-103-1/+39
| | | | | | We already disallow right square brackets. This also disallows left square brackets, which ensures link references will be less likely to collide with standard links in some weird edge cases. Fixes #1209.
* Bump version to 3.3.63.3.6Waylan Limberg2021-11-172-1/+5
|
* update install requires to drop quotesZiyang Liu2021-11-171-1/+1
|
* Bump version to 3.3.53.3.5Waylan Limberg2021-11-162-2/+2
|
* Support Python 3.10Waylan Limberg2021-11-165-12/+16
| | | Fixes #1124.
* Ensure <summary> tags are parsed correctly.Waylan Limberg2021-11-034-3/+25
| | | | Fixes #1079.
* Fix one more misplaced changelog entryDmitry Shachnev2021-08-112-2/+2
| | | | | | PR #1102 was included in 3.3.4, not 3.3.0. Also fix a typo in another changelog entry.
* Improve email address validation for Automatic LinksCarlos2021-08-113-4/+68
|
* Fix changelog entry in wrong placefacelessuser2021-08-092-1/+1
| | | | | Changelog entry from hash e11cd255cae5fd3c5ef5fdd6352cd28e212fd328 was placed in the wrong place.
* Re-use compiled regex for block level checksHebaruSan2021-08-092-1/+4
|
* Don't process shebangs in codehilite when processing fenced codeIsaac Muse2021-08-045-3/+37
| | | Fixes #1156.
* Fix cache error in CIfacelessuser2021-08-041-1/+1
| | | | | If cache is desired, we should look into this in the future and do it properly.
* Remove download_url from setup.py (#1164)Waylan Limberg2021-07-301-1/+0
| | | | This is an old, outdated key which is simply moved into `project_urls`. As it offers no value, it is being removed. Fixes Python-Markdown#1163.
* Better toc detectionCharles de Beauchesne2021-07-273-1/+15
| | | Fixes #1160.
* add cache to workflows using actions/setup-nodeOscar Dominguez2021-07-061-1/+2
|
* document footnote's need for reset() between multiple runsPeter Kaminski2021-07-061-0/+28
| | | | | | The footnote docs page doesn't mention the need to run `reset()` between multiple runs of the `markdown.Markdown` class. This change adapts and adds language from the `extensions/api.md` page to explain what to do and why.
* Remove SO attributions to sidestep licensing greynessJarek Głowacki2021-07-011-9/+12
|
* Newline at end of READMEAli Hosseinverdi2021-06-151-0/+1
|
* Fix missing space in CLI option helpjohnthagen2021-06-011-1/+1
|
* Fix link to extensions tutorialJannis Vajen2021-05-261-1/+1
| | | The previous link was pointing at a stale wiki page.
* Fix cubic ReDoS in fenced code and referencesB. Caller2021-05-072-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two regular expressions were vulerable to Regular Expression Denial of Service (ReDoS). Crafted strings containing a long sequence of spaces could cause Denial of Service by making markdown take a long time to process. This represents a vulnerability when untrusted user input is processed with the markdown package. ReferencesProcessor: https://github.com/Python-Markdown/markdown/blob/4acb949256adc535d6e6cd8/markdown/blockprocessors.py#L559-L563 e.g.: ```python import markdown markdown.markdown('[]:0' + ' ' * 4321 + '0') ``` FencedBlockPreprocessor (requires fenced_code extension): https://github.com/Python-Markdown/markdown/blob/a11431539d08e14b0bd821c/markdown/extensions/fenced_code.py#L43-L54 e.g.: ```python import markdown markdown.markdown('```' + ' ' * 4321, extensions=['fenced_code']) ``` Both regular expressions had cubic worst-case complexity, so doubling the number of spaces made processing take 8 times as long. The cubic behaviour can be seen as follows: ``` $ time python -c "import markdown; markdown.markdown('[]:0' + ' ' * 1000 + '0')" python -c "import markdown; markdown.markdown('[]:0' + ' ' * 1000 + '0')" 1.25s user 0.02s system 99% cpu 1.271 total $ time python -c "import markdown; markdown.markdown('[]:0' + ' ' * 2000 + '0')" python -c "import markdown; markdown.markdown('[]:0' + ' ' * 2000 + '0')" 9.01s user 0.02s system 99% cpu 9.040 total $ time python -c "import markdown; markdown.markdown('[]:0' + ' ' * 4000 + '0')" python -c "import markdown; markdown.markdown('[]:0' + ' ' * 4000 + '0')" 74.86s user 0.27s system 99% cpu 1:15.38 total ``` Both regexes had three `[ ]*` groups separated by optional groups, in effect making the regex `[ ]*[ ]*[ ]*`. Discovered using [regexploit](https://github.com/doyensec/regexploit).
* Fix minor typosMatthieu Bacconnier2021-05-021-6/+6
|
* toc: Do not remove diacritical marks when slugify_unicode is usedDmitry Shachnev2021-03-243-8/+25
| | | | | | | Update the existing test and add a new one to make sure that the behavior of default slugify function has not changed. Fixes #1118.
* Bump version to 3.3.43.3.4Waylan Limberg2021-02-242-2/+2
|
* Ensure permalinks and ankorlinks are not restricted by toc_depthWaylan Limberg2021-02-246-217/+426
| | | | | | | | | | | | This fixes a regression which was introduced with support for toc_depth. Relevant tests have been moved and updated to the new framework. Fixes #1107. The test framework also received an addition. The assertMarkdownRenders method now accepts a new keyword expected_attrs which consists of a dict of attrs and expected values. Each is checked against the attr of the Markdown instance. This was needed to check the value of md.toc and md.toc_tokens in some of the included tests.
* Fix minor grammatical errorTani N-K2021-02-151-1/+1
| | | | Corrected "shorte" to "short"
* Replace links to freewisdom.orgWaylan Limberg2021-02-064-6/+5
| | | | | | | | | Yuri's site (freewisdom.org) has gone offline. I have linked to his GitHub profile instead. Also, the developer's email address (markdown@freewisdom.org) has been replaced with a new address (python.markdown@gmail.com). The new address simply forwards all incoming messages to the project developer (@waylan) and deletes the messages.