aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_extensions.py
Commit message (Collapse)AuthorAgeFilesLines
* Mark special treatment of extension names as PendingDeprecationWaylan Limberg2014-08-291-16/+0
| | | | | | | | | | | | | | | | | 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.
* Refactored tests to no longer pass configs to names extensions.Waylan Limberg2014-08-291-10/+19
| | | | | `'path.to.module(option=value'` => `path.to.module.Class(option='value')` This is in anticipation of #335
* All extension tests now use python dot notation.Waylan Limberg2014-08-291-29/+29
| | | | | | | | | | All named extensions now use python dot notation in the tests - including all builtin extensions (eg: 'extra' => 'markdown.extensions.extra'). This is in anticipation of #336. Note there are a few tests (in the error tests) that will still need updating, but not till we make the change as they will test for the new error message.
* Renamed 'smart_substitutions' option to 'substitutions'. Fixed a typo.Martin Altmayer2014-08-151-2/+2
|
* Added test for the new 'smart_substitutions' feature of Smarty extension.Martin Altmayer2014-08-141-0/+33
|
* Fixed silly typo. Relates to #325.Waylan Limberg2014-08-011-1/+1
|
* Ensure Extension.getConfigInfo Test always passesWaylan Limberg2014-08-011-2/+3
| | | | | Dicts don't preserve order but still will be equal while lists of tuples always preserve order. When we use a dict to create a list of tuples, the results are unpredictable - especially for a equality test. so we need to compare dicts, not lists. Related to #325
* Update extensions for Extension.__init__ refactorWaylan Limberg2014-07-311-16/+21
| | | | | | | | | | | | | | | | | 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-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add tests of markdown.extensions.ExtensionWaylan Limberg2014-07-111-0/+23
|
* Allow single as well as double quotes for hl_lines.A. Jesse Jiryu Davis2014-01-071-15/+19
|
* Support syntax for highlighted lines like: ```python hl_lines=“1 3”A. Jesse Jiryu Davis2014-01-061-2/+35
|
* Add feature for emphasizing some lines in a code block.A. Jesse Jiryu Davis2014-01-031-0/+47
| | | | A code blocked headed by “:::python{1,3}” now emphasizes the first and third lines. With fences enabled, ```python{1,3} has the same effect.
* HeaderID Ext now handles raw html in ids. Fixes #232Waylan Limberg2013-07-281-0/+12
|
* MetaData no longer fails with no newline. Fixes #228.Waylan Limberg2013-07-031-0/+7
|
* AbbrExtension now handles abbreviations nested in other markup.Waylan Limberg2013-06-161-0/+9
| | | | | | | | Just set each abreviation as an AtomicString. Given the nature of abbreviations, they are not likely to ever contain any other markup anyway. Also added a test. Fixes #224. Thanks for the report @JakeChampion.
* CodeHilite tests pass in all pygments versions.Waylan Limberg2013-02-251-15/+11
|
* Change `set.append` -> `set.add` in `headerid.unique`Waylan Limberg2013-02-221-0/+7
| | | | | | | | | Fixes #195. This was getting missed because the HeadrerId extension's reset method was resetting the IDs to a list. However, some third party extensions may want to call the unique function and it should work as documented. Interestingly, the TOC extension was using it and passing in a list as well. All fixed now. Also added a test of the `unique` function directly so we shouldn't repeat this in the future.
* Ensure toc attribute is available on Markdown class.Waylan Limberg2013-02-191-0/+39
| | | | | | This appears to have recently been broken with the fixes in #191. This time I've added tests to prevent future breakage and added documentation to explain the behavior.
* Allow better linenum override in CodeHiliteWaylan Limberg2013-02-141-4/+74
| | | | | | | | | | | Fixes #148. The "force_linenos" config setting of the CodeHilite extension has been marked as Pending Deprecation and a new setting "linenums" has been added to replace it. See documentation for the [CodeHilite Extension] for an explaination of the new "linenums" setting. The new setting will honor the old "force_linenos" if it is set, but it will raise a PendingDeprecationWarning and will likely be removed in a future version of Python-Markdown. [CodeHilite Extension]: extensions/codehilite.html
* Merge branch 'master' into admonitionTiago Serafim2013-02-091-1/+14
|\ | | | | | | | | | | Conflicts: docs/extensions/index.txt tests/extensions/test.cfg
| * Testing framework now runs on Python 2 & 3 unmodified.Waylan Limberg2012-12-141-0/+1
| |
| * Fixed #165. Switched the order of treeprocessors when attr_list and headerid ↵Waylan Limberg2012-12-131-0/+12
| | | | | | | | extensions are used togeather. While this means headerid may alter IDs defined in attr_lists for uniqueness, automaticaly generated ids will not contain unparsed attr_lists. This is the lesser of two evils - and actually generates a more valid output (all IDs will be unique)
| * Fixed CodeHilite test when pygments is not installed.Waylan Limberg2012-11-041-1/+1
| |
* | More tests for the extension and new tests for the RE. It's now possible to ↵Tiago Serafim2012-09-191-21/+9
| | | | | | | | use an explicit blank title to not have the <p> tag with the title rendered.
* | Removed the configs.Tiago Serafim2012-09-081-10/+1
| |
* | Initial version with insufficient tests and no docs.Tiago Serafim2012-09-021-10/+46
|/
* Fixed #114. Converted doctests to unittests. While I left the doctests there ↵Waylan Limberg2012-07-261-0/+275
for documentation purposes, they are no longer being run. Perhaps I'll delete them later and add links to the online docs or something.