aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/blockparser.py
Commit message (Collapse)AuthorAgeFilesLines
* Consistent copyright headers.Waylan Limberg2018-07-271-0/+22
| | | | Fixes #435.
* All Markdown instances are now 'md'. (#691)Waylan Limberg2018-07-271-3/+9
| | | | | | | | | | | | 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).
* Replace homegrown OrderedDict with purpose-built Registry. (#688)Waylan Limberg2018-07-271-3/+2
| | | | | | | | | | | | | | | | | | | 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.
* Flake8 cleanup (mostly whitespace).Waylan Limberg2014-11-201-25/+26
| | | | | | 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.
* Now using universal code for Python 2 & 3.Waylan Limberg2013-02-271-3/+4
| | | | | | | | | | The most notable changes are the use of unicode_literals and absolute_imports. Actually, absolute_imports was the biggest deal as it gives us relative imports. For the first time extensions import markdown relative to themselves. This allows other packages to embed the markdown lib in a subdir of their project and still be able to use our extensions.
* Allow blockprocessor.run to return True or False.Waylan Limberg2012-03-211-4/+5
| | | | | | | | | This allows the run method to determine if a block is or is not a match in the midst of parsing outside of the test method. The goal is to eliminate the often redundant test method in the future. In the interim, it remains and if the run method returns None, the existing behavior is maintained. Returning None may generate a DepreciationWarning later. Note that test must still return True to even get to the run method.
* A better implementation of globals as attributes on the Markdown class. This ↵Waylan Limberg2010-07-071-1/+1
| | | | should be more future proof.
* Moved a bunch of global variables to the instance of the Markdown class.Waylan Limberg2010-07-061-2/+3
|
* Rename misc.py to util.py at the request of upstreamToshio Kuratomi2010-07-051-3/+3
|
* Break cyclic import of markdown. This allows people to embed markdownToshio Kuratomi2010-07-051-4/+5
| | | | if they desire.
* Added support for multilevel lists - step one. Currently only works for ↵Waylan Limberg2009-02-041-3/+3
| | | | loose lists. In fact, non-loose lists are currently broken - seen as code blocks.
* Normalized stripTopLevelTags to be consistant regardless of any whitespace. ↵Waylan Limberg2008-12-101-1/+1
| | | | For example, this would allow an extension to remove/replace 'Prettify' treeprocessor with something that added more or less whitespace without adverse effects.
* More refactoring.Yuri Takhteyev2008-11-181-11/+1
|
* Attempting a refactoring, breaking markdown into multiple files.Yuri Takhteyev2008-11-171-0/+105