summaryrefslogtreecommitdiff
path: root/markdown/extensions
Commit message (Collapse)AuthorAgeFilesLines
* Make sure regex patterns are raw stringsregex-fixesfacelessuser2017-12-202-12/+12
| | | | Python 3.6 is starting to reject invalid escapes. Regular expression patterns should be raw strings to avoid having regex escapes being mistaken for invalid string escapes. Ref #611.
* Switch docs to MKDocs (#602)Waylan Limberg2017-12-0617-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | Fixes #601. Merged in 6f87b32 from the md3 branch and did a lot of cleanup. Changes include: * Removed old docs build tool, templates, etc. * Added MkDocs config file, etc. * filename.txt => filename.md * pythonhost.org/Markdown => Python-Markdown.github.io * Markdown lint and other cleanup. * Automate pages deployment in makefile with `mkdocs gh-deploy` Assumes a git remote is set up named "pages". Do git remote add pages https://github.com/Python-Markdown/Python-Markdown.github.io.git ... before running `make deploy` the first time.
* Loosen whitespace requirements for admonitions.Waylan Limberg2017-03-051-2/+2
| | | | | | | Also consume to the end of the first line of any admonition. Everything after the title is discarded. However, the only thing that will match should be whitespace so it should be a non-issue. Fixes #550.
* Fix regression of single column tables (#540)Isaac Muse2017-01-261-9/+40
| | | | | | Single column tables are valid tables, so add back in the accidentally removed functionality of allowing single column tables, but with one exception -- table bodies should not render empty (an empty `<tbody>` is invalid HTML. Fixes #539.
* Fix footnote parsing of footnote content (#536)Isaac Muse2017-01-231-13/+20
| | | | | | | Fixes #412 and #493. First we parse footnote content as its own document avoid quirks with using li as a parent. Second, we surround placeholders with STX and ETX to prevent them from interfering with inline parsing; this is also consistent with how placeholders are used everywhere else in Python Markdown.
* Create additional references for duplicate footnotes (#534)Isaac Muse2017-01-231-5/+93
| | | | | | Track when we find duplicate footnote references and create unique ids for them. Then add an additional tree-processor after inline to go back and update the footnotes with additional back references that link to the duplicate footnote references. Fixes #468.
* Tables: Improvements (#530)Isaac Muse2017-01-191-26/+53
| | | | | | | Tables now handle escaped pipes when testing, in table borders, and in the inline content. To achieve properly, a bug had to be fixed related to appending escaped chars to the Markdown class. Now appended chars only appear in the current instance. Lastly the first backtick in a table can be escaped rounding out the last corner case.
* Update fenced code extension to match codehilite lang regex. (#529)Waylan Limberg2017-01-181-1/+1
| | | Related to #527.
* codehilite: detect languages with funny names (#527)Grant Mathews2017-01-171-1/+1
| | | Extend the language regex to match things like 'C#' and 'VB.Net'.
* Better handling of backticks in tables (#524)Isaac Muse2017-01-111-40/+62
| | | | At some point the logic of counting backticks and determining if they are odd or even was used to parse a row's text into cells. Unfortunately this approach broke expected code parsing logic in a table. We essentially traded one bug for another. This fixes table backtick handling and restores sane backtick logic while preserving existing fixes. (issue #449)
* Add blank lines after toplevel function definitions.Dmitry Shachnev2016-11-181-0/+1
| | | | This fixes warnings with pycodestyle ≥ 2.1, see PyCQA/pycodestyle#400.
* lists are not tables - fixes #478 (#507)Adam Wood2016-10-261-1/+2
|
* getiterator to iter (#501)Brandon Chinn2016-09-291-1/+1
|
* Merge branch 'master' of https://github.com/waylan/Python-MarkdownWaylan Limberg2016-09-232-3/+4
|\
| * Fix table alignment when seperator contains spaces (#489)eph2016-08-151-0/+1
| | | | | | | | | | | | | | | | | | | | * Fix table alignment when seperator contains spaces eg. seperator like "------ | :----- | :----: | -----: | ------" * Update tests for table * Delete the newline at the end of tables.html
| * Fix another issue with attribute lists (with multiple ‘=’ signs)Dmitry Shachnev2016-06-131-3/+3
| |
* | Don't allow equal signs in attr_list keys.Waylan Limberg2016-09-231-3/+3
|/ | | | | | This will probably not result in the output intending by the author, but the syntax would be incorrect so the author needs to edit the document anyway. We just need to ensure the parser does not crash here. Fixes #498.
* Attribute lists are not permitted to contain newlines. Fixes #482.Waylan Limberg2016-06-121-1/+1
|
* Merge branch 'master' of https://github.com/waylan/Python-MarkdownWaylan Limberg2016-04-111-0/+1
|\
| * Support CodeHilite option use_pygments in fenced_codeMartin Morgenstern2016-04-111-0/+1
| |
* | Remove unnessecary if statement.Waylan Limberg2016-04-111-5/+1
|/ | | | | | The statement will never evaluate False, so its not needed. Also, Unicode is not valid for PY3, so its better to not include it. Fixes #470.
* toc: Remove children from header element after iteratingDmitry Shachnev2016-03-171-1/+2
| | | | Removing items while iterating can result in wrong behavior. Refs #461.
* Fix handling of characters after backtick in tables.Dmitry Shachnev2015-11-071-1/+1
| | | | Fixes #440. Thanks @jandecaluwe for the bug report.
* Fixed handling of table cell splitMustafa Haddara2015-10-241-2/+49
|
* Fix find footnote placeholder to recurseGustav Tiger2015-08-291-1/+3
|
* Override regex for html inline pattern when smart_angled_quotes is trueDmitry Shachnev2015-06-201-1/+6
| | | | | Add a restriction that the closing angled quote should not be duplicate, so that we can use our own pattern for handling duplicate quotes.
* Revert "smarty: Use a separate processor for angled quotes"Dmitry Shachnev2015-06-191-8/+4
| | | | | | | That commit caused a regression where `<<` and `>>` inside code blocks were wrongly replaced with double quotes. This reverts commit 5029d829c1532f31adc9acbf54d88bb469a69a4f.
* smarty: Use a separate processor for angled quotesDmitry Shachnev2015-06-151-4/+8
| | | | Run that processor before inline processor to fix the test failure.
* Updated BlockProcessor to new-style class. Changed subclasses to use super().Kar Epker2015-06-011-2/+2
|
* Changed formatting of regex strings. Fixed flake8 issues.Kar Epker2015-06-011-6/+4
|
* Changed line continuations to satisfy pylint.Kar Epker2015-06-011-4/+6
|
* Fixed parser ignoring value of tab_length.Kar Epker2015-06-011-2/+10
|
* added support for zero row tablespieterprovoost2015-04-051-2/+2
|
* smarty: Add back special case for decade abbreviationsDmitry Shachnev2015-03-181-0/+4
| | | | | | | | | | The previous version did not work, and was incorrectly removed as part of 85ad18071d619251. In the new version, use lookbehind search for \w instead of \b, so that it works. Update the tests accordingly. Fixes #399 (except parts that we can't fix). Thanks @gandaro for the report.
* Add Comment support to toc.Waylan Limberg2015-03-141-2/+2
| | | | | | A etree can contain Comments, PIs or other Elements which do not have a string for a tag. Must always check that a tag is a string before doing string processing on it. Otherwise, things will crash.
* Removed `yaml` option from meta-data extension.Waylan Limberg2015-03-081-34/+6
| | | | | The option was buggy. Rather than try to fix it, it is being removed. This feeture should exist as a seperate extension. Fixes #390.
* No `=` in key or value of attr lists.Waylan Limberg2015-02-241-2/+2
| | | | Fixes #389. Thanks for the report @lazka.
* Added a 'use_pygments' config option to CodeHilite.Waylan Limberg2015-02-051-7/+10
| | | | | | | | | Fixes #386. I'm doing this against my better judgement. The only reason is that I'm using the HTML format suggested by the HTML5 Spec and will simply not consider any alternate output. If a JavaScript library requires something else, to bad. I don't care. That library should support the format suggested by the spec or I'm not interested in it. If you want something else then you can create your own extension which does whatever you want.
* Upgraded to DeprecationWarning on ext `config` keyword.Waylan Limberg2015-02-051-9/+11
| | | | | | | | | Also checked for `None` so the existing extensions will at least still work. Of course, that code all gets deleted with the next release and things will break if extension authors do not update their code. Hope they test there code with each release and check for warnings. Also added a note to the release notes.
* Use newer ElementTree API to avoid future breakage.Waylan Limberg2015-01-316-9/+8
|
* Only log warnings from commandline script.Waylan Limberg2015-01-311-4/+0
| | | | | | | | | I need to remember this is a lib first and not configure logging from within the lib. Also, from the script we are now actually displaying deprecation warnings. For some reason I don't understnad deprecation warnings are hidden by default in Python. And who remembers to run Python with the `-Wd` flag every time they upgrade a lib just to make sure there's no new deprecations? Fixes #384.
* More refactor of TOC Extension.Waylan Limberg2015-01-011-24/+24
| | | | | | Mostly just code cleanup so it reads better. Renamed a few internal things. I didn't write this extension originally so most of this would have been done a long time ago. I just havn't touched this code much till now.
* HeaderId Extension marked as Pending Deprecation.Waylan Limberg2015-01-012-69/+74
| | | | | | | | | | | | | | | | | | | | Use the Table of Contents Extension instead. The HeaderId Extension will raise a PendingDeprecationWarning. The last few features of the HeaderID extension were mirgrated to TOC including the baselevel and separator config options. Also, the marker config option of TOC can be set to an empty string to disable searching for a marker. The `slugify`, `unique` and `stashedHTML2text` functions are now defined in the TOC extension in preperation for the HeaderId extension being removed. All coresponding tests are now run against the TOC Extension. The meta-data support of the HeaderId Extension was not migrated and no plan exists to make that migration. The `forceid` config option makes no sense in the TOC Extension and the only other config setting supported by meta-data was the `header_level`. However, as that depends on the template, it makes more sense to not be defined at the document level.
* PendingDeprecationWarning (v2.5) => DeprecationWarning (v2.6)Waylan Limberg2014-12-301-4/+4
|
* Preserve order of nested headers in TOCWaylan Limberg2014-12-301-49/+55
| | | | | | | | | Fixes #380. The TOC replacement is now seperate from building the TOC, which allows us to iter through the doc in order rather than with the non-order-preserving interparent pethod. This is almost a complete refactor of the run method. Also cleaned up the config stuff. Thanks to @colewerner for the report and test case.
* Complete test coverage of TOC ExtensionWaylan Limberg2014-12-301-8/+6
|
* Always add toc to Markdown Class InstanceWaylan Limberg2014-12-301-6/+6
| | | | | | | | Previously, we only added the toc attribute (md.toc) if no Marker was found within the document. However, that has caused framworks to do things like force insert a marker, run convert, then extract the toc from the body of the document. This is much cleaner. And if the user wants to add the toc to the document also, they still can.
* Add reset support to TOC extension.Waylan Limberg2014-12-301-0/+6
| | | | | | Now, whenever the TOC extensiuon is loaded, the Markdown class instance will always have a toc attribute (md.toc). Calling md.reset() will also reset the toc attribute which defaults to an empty string.
* Add YAML support to Meta extensionKernc2014-11-301-7/+41
| | | | | | | | By default, this only supports YAML deliminators (`---`) and adds no additional behavior. In other words, parsing is unchanged. However, with the `yaml` option set, PyYAML will parse the metadata. Thanks to @kernc for suggesting the idea and doing the work on this.
* Completed flake8 cleanup.Waylan Limberg2014-11-201-1/+1
| | | | | I've decided to go with longer lines in the tests. Also fixed a couple errors with the previous cleanup.