summaryrefslogtreecommitdiff
path: root/markdown/extensions
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Fix processing angle quotes in smarty extension"revert-417-masterWaylan Limberg2015-06-181-8/+4
|
* 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.
* Flake8 cleanup (mostly whitespace).Waylan Limberg2014-11-2018-275/+346
| | | | | | Got all but a couple files in the tests (ran out of time today). Apparently I have been using some bad form for years (although a few things seemed to look better before the update). Anyway, conformant now.
* Issue #366 Recursion error in toc extfacelessuser2014-11-171-48/+47
| | | | | | | | This reworks the toc ordering to be done in a single pass with no recursion. Very long documents with lots of headers can actually exceed Python’s max recursion limit. By handling the toc ordering with no recursion, large documents can no longer cause toc to fail with recursion erros.
* Use Pygments APIfacelessuser2014-10-041-10/+10
|
* Run Meta after whitespace normalizationWaylan Limberg2014-09-261-1/+1
| | | | Fixes #343. Thanks for the report @AlexJF.
* Fixed TOC Option parsing.Waylan Limberg2014-09-251-2/+2
| | | | | | The new option parser assumes bool values if the default is bool or None. As the "title" option is not a bool value, it should default to an empty string rather than None. Fixes #347.
* Mark special treatment of extension names as PendingDeprecationWaylan Limberg2014-08-291-1/+14
| | | | | | | | | | | | | | | | | The builtin extensions will no longer get special treatment and have the path ("markdown.extensions.") appended . The same applies for "mdx_" extensions. All names extension must provide the full path. Fixes #336. Also deprecating support for passing in extension config settings as part of the string name. The extension_configs keyword should be used instead. Fixes #335. Also raising PendingDeprecationWarnings for positional args or the "config" keyword on the Extension Class. Pass each setting as a seperate keyword instead. Docs and tests are updated. Still need to update extension API docs.
* More updates to test configs.Waylan Limberg2014-08-292-11/+16
| | | | | | | | | | | | | | The last few extensions were updated to accept dicts/**kwargs as configs and more tests were updated. Also updated extra to actually accept configs. Note that extra requires an extra level of dicts. First you need to indicate tha the settings are for extra, then, which extension extra wraps. I'm not crazy abount this, bit not sur ehow else to do it without making all the configs a global attribute on the Markdown class to that any extention can access any other extensions config settings. I don't think we wnat to do that. Also updated extra to use dot notation for the sub-extensions.
* Cleaned up some whitespace inconsistancies.Waylan Limberg2014-08-221-1/+1
|
* Standardized all extension header comments to a uniform format.Waylan Limberg2014-08-2117-446/+193
|
* 'http://packages.python.org/Markdown/' => ↵Waylan Limberg2014-08-218-11/+11
| | | | 'https://pythonhosted.org/Markdown/'. The former redirects to the latter anyway. Might as well point to the actual destination.
* Renamed 'smart_substitutions' option to 'substitutions'. Fixed a typo.Martin Altmayer2014-08-151-3/+2
|
* Fixed an old typo in the smarty extension and added a test case.Martin Altmayer2014-08-111-2/+2
|
* Replaced smart_lsquo etc. by a single option smart_substitutions which ↵Martin Altmayer2014-08-111-14/+32
| | | | allows to overwrite all substitution strings. Fixed line length in docs.
* Added options to the Smarty extension that configure the text that is used ↵Martin Altmayer2014-08-091-3/+10
| | | | to replace quotes. This makes it possible to use the correct quotes in languages other than English.
* Update extensions for Extension.__init__ refactorWaylan Limberg2014-07-3118-99/+92
| | | | | | | | | | | | | | | | | Fixes #325. All extensions can now accept a dict of configs or **kwargs, not just a list of tuples. Third party extensions may want to follow suite. Extensions may only accept keyword arguments in the future. These changes still need to be documented. A couple things of note: The CodeHilite extension previously issued a DeprecationWarning if the old config key `force_linenos` was used. With thins change, a KeyError will now be raised. The `markdown.util.parseBoolValue` function gained a new argument: `preserve_none` (defaults to False), which when set to True, will pass None through unaltered (will not convert it to False).
* Refactor markdown.extensions.Extension.__init__()Waylan Limberg2014-07-291-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out in #325, setting up Extension configs is kind of a mess. Some places pass a list of tuples on initialization, others a dict. And sometimes they're passed as an arg, othertimes a kwarg. Addiitonaly, the docs are just as inconsistant. This refactor addresses all those sinerios with tests included. The existing extensions still need refactored. But the fact that their tests still pass means we havn't broken third party extensions either. This refactor also introduces a new API, which is the prefered method going forward. All docs should be updated to match. Whereas previously one might do: ```python MyExtension(configs={'key': 'foo', 'otherkey': 'bar'}) ``` This can now be done: ```python MyExtension(key='foo', otherkey='bar') ``` Of course, the old way still works for backward compatability. But that means the `configs` keyword has special status and cannot be used for another purpose.
* Marked a bunch of lines as 'no cover'. Coverage at 91%Waylan Limberg2014-07-113-3/+3
|
* smarty: add support for angled quotesDmitry Shachnev2014-06-191-0/+11
| | | | See <http://en.wikipedia.org/wiki/Guillemet>.
* Merge pull request #317 from mitya57/doctestsWaylan Limberg2014-06-167-37/+37
|\ | | | | Python 3.4 and fixes for doctests
| * Make doctests support Python 3Dmitry Shachnev2014-06-117-33/+33
| |
| * Fix a doctest in fenced_code.py.Andrey Rahmatullin2014-05-311-4/+4
| |
* | Fix #315: Change order of smarty patterns to make the test pass againDmitry Shachnev2014-06-081-2/+2
|/
* Merge pull request #311 from mitya57/masterWaylan Limberg2014-05-261-5/+11
|\ | | | | Make smarty extension work together with attr_list
| * Make smarty extension use its own InlineProcessorDmitry Shachnev2014-05-261-5/+11
| |
* | Fix issue308 and fix (unrelated) failure to break out of nest loop.ryneeverett2014-05-211-19/+13
|/
* smarty: Fix test failure with Python 3.1 and 3.2. Fixes #295Dmitry Shachnev2014-03-111-1/+1
|