aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/postprocessors.py
Commit message (Collapse)AuthorAgeFilesLines
* Move isBlockLevel to class. (#693)Waylan Limberg2018-07-311-1/+1
| | | | | Allows users and/or extensions to alter the list of block level elements. The old implementation remains with a DeprecationWarning. Fixes #575.
* Consistent copyright headers.Waylan Limberg2018-07-271-0/+20
| | | | Fixes #435.
* All Markdown instances are now 'md'. (#691)Waylan Limberg2018-07-271-6/+6
| | | | | | | | | | | | 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-5/+4
| | | | | | | | | | | | | | | | | | | 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.
* Removed deprecated safe_mode.Waylan Limberg2018-01-111-18/+3
|
* fix DeprecationWarning: invalid escape sequenced9pouces2017-07-251-1/+1
|
* Improve RawHtmlProcessor to have linear iso quadratic performanceMaurice van der Pot2016-02-261-7/+10
|
* Flake8 cleanup (mostly whitespace).Waylan Limberg2014-11-201-9/+13
| | | | | | 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.
* Marked a bunch of lines as 'no cover'. Coverage at 91%Waylan Limberg2014-07-111-1/+1
|
* Future imports go after the docstringsAdam Dinwoodie2013-03-181-1/+1
| | | | | | | | | A `from __future__ import ...` statement must go after any docstrings; since putting them before the docstring means the docstring loses its magic and just becomes a string literal. That then causes a syntax error if there are further future statements after the false docstring. This fixes issue #203, using the patch provided by @Arfrever.
* Now using universal code for Python 2 & 3.Waylan Limberg2013-02-271-3/+6
| | | | | | | | | | 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.
* Fixed #77. util.isBlockLevel() needs to check entire tag passed to it.Waylan Limberg2012-01-301-1/+1
|
* Fixed #59. Raw HTML parsing is no longer slow.Waylan Limberg2012-01-181-12/+0
| | | | | | Replaced the unescape method I carlessly threw in the RawHtmlProcessor. Unfortunetly, this reintroduces the bug just fixed in commit 425fde141f17973aea0a3a85e44632fe18737996 Sigh!
* attempt at a fix for issue w/ MD links inside of html tagish stuff with safe ↵Mike Dirolf2012-01-121-2/+5
| | | | mode on.
* Fixed #39. Refactored escaping so that it only escapes a predifined set of ↵Waylan Limberg2011-08-171-2/+13
| | | | chars (the set defined by JG in the syntax rules). All other backslashes are passed through unaltered by the parser. If extensions want to add to the escapable chars, they can append to the list at markdown.ESCAPED_CHARS.
* Fixed a few minor Python2.4 incompatabilities. Runs in 2.4-2.7 cleanly.Waylan Limberg2011-07-221-1/+1
|
* Fixed #28. Inline raw html is now enclosed in p tags. This used to work. ↵Waylan Limberg2011-06-281-1/+12
| | | | Somehow we stopped checking for a single inline html element when swapping back in raw html. Added a test. Also patched a weird (invalid) comment test. Seeing the input is not really a valid html comment - it doesn't matter what we do with it. I suppose we test it to make sure it doesn't break the parser. Actual output is not so important. As a side note, this has exposed a preexisting (unrelated) bug with the extra extension's handling of raw html. That test is failing following this fix.
* A better implementation of globals as attributes on the Markdown class. This ↵Waylan Limberg2010-07-071-1/+1
| | | | should be more future proof.
* Factored out the building of the various processors and patterns into ↵Waylan Limberg2010-07-071-0/+9
| | | | utility functions called by a build_parser method on the Markdown class. Editing of the processors and patterns now all happen in one file for each type. Additionaly, a subclass of Markdown could potentially override the build_parser method and build a parser for a completely differant markup language without first building the default and then overriding it.
* Moved a bunch of global variables to the instance of the Markdown class.Waylan Limberg2010-07-061-1/+1
|
* Removed Global variable HTML_PLACEHOLDER. Use HtmlStash.get_placeholder(key) ↵Waylan Limberg2010-07-061-2/+2
| | | | if you need it.
* Moved HtmlStash and base Prosessor classes to the new util module.Waylan Limberg2010-07-061-10/+3
|
* Rename misc.py to util.py at the request of upstreamToshio Kuratomi2010-07-051-4/+4
|
* Break cyclic import of markdown. This allows people to embed markdownToshio Kuratomi2010-07-051-6/+7
| | | | if they desire.
* Fix bug with rawhtml and markdown escaping. Previously, any inline rawhtml ↵Waylan Limberg2010-03-151-0/+8
| | | | that contained text that fit markdown's escaping syntax (i.e. <x\]>) was never unescaped. Now it is. Markdown probably shouldn't be escaping before removing rawhtml in the first place, but this will do for now.
* Cleaned up recent refactor into a package from a single file.Waylan Limberg2008-11-201-3/+15
|
* More refactoring.Yuri Takhteyev2008-11-181-0/+65