aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/treeprocessors.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix the lost tail issue in inlineprocessors.facelessuser2014-09-261-15/+18
| | | | | | See #253. Prior to this patch, if any inline processors returned an element with a tail, the tail would end up empty. This resolves that issue and will allow for #253 to be fixed. Thanks to @facelessuser for the work on this.
* Code Blocks must always be AtomicStringsWaylan Limberg2014-09-081-1/+1
| | | | | | | | | | | | | | | | | | Fixes #340. The "inline" TreeProcessor runs before the "prettify" TreeProcessor, but the "smarty" TreeProcessor (wich is just another instance of `InlineProcessor`) runs after the "prettify" TreeProcessor. The problem was that the "prettify" TreeProcessor was losing the AtomicString quality of the text of code blocks (any operation on a string creates a new string. When that string is an AtomicString, the new string must explicitly be declared as an AtomicString. As the "prettify" TreeProcessor cleans up newlines on code blocks, it was changing the AtomicString to a normal string. And as `InlineProcessor` identifies what elements to skip solely by whether the text is an AtomicString, the "smarty" instance was running on code blocks. Importantly, I added a test of code blocks and spans for smarty, so this shouldn't break again.
* Marked a bunch of lines as 'no cover'. Coverage at 91%Waylan Limberg2014-07-111-1/+1
|
* Make it easier to override list of inline patterns for InlineProcessorDmitry Shachnev2014-05-261-2/+3
|
* Address various depreciated APIs in PythonWaylan Limberg2014-01-081-6/+6
| | | | | This mostly revolves around old APIs for ElementTree, but includes a few others as well. Fixes #254. Thanks for the report.
* Ensure handleAttributes doesn't lose AtomicStrings.Waylan Limberg2013-03-181-3/+3
| | | | | | | | | | | | | | | Fixes #204. This was a real pain to debug. But I think the problem stemmed from the fact that the footnote extension inserted a etree link into the footnotes last p element. Then when inline patterns are run, the inline code in that p element is processed. Normally, code would be the first child found, but with the pre-existing link, that wasn't the case and the parser took a slightly differant path which would never be encountered in any other situation. It was this slightly differant path that made the lose of the AtomicString status of the inline code matter. Since any AtomicString (including inline code) doesn't need to be run though hanldeAttributes anyway, we can just skip over it and preserve the AtomicString. Whew!
* Now using universal code for Python 2 & 3.Waylan Limberg2013-02-271-11/+7
| | | | | | | | | | 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.
* Cleaned up fixes for #183Waylan Limberg2013-02-081-0/+5
| | | | | | | | | My previous commit (d5a94c2) broke a few things badly. Unfortunately I failed to run the complete test suite and didn't catch it. A bad regex was crashing the test suite. Also cleaned up a few other odds and ends from previous work on #183. Still loosing a few random empty lines in code blocks though. I suspect this may also fix #188.
* Fix all pyflakes unused-import/unused-variable warningsDmitry Shachnev2012-11-091-1/+0
|
* Fixed #87Catalin Iacob2012-04-161-6/+7
| | | | Elements should be inserted in the tree regardless of enable_attributes
* Fixed #31. Headers in tight lists now get inline patterns run on their ↵Waylan Limberg2011-07-211-1/+12
| | | | tails. Tests included.
* Partial fix of issue #14. hrefs (and titles) are now unescaped, but it ↵Waylan Limberg2011-06-021-2/+1
| | | | uppears that we are loosing escaped backslashes (both in the href and in the link label in the example given in issue 14.
* Fixed Ticket 74. AtomicStrings should now be ackowledged (and preserved) in ↵Waylan Limberg2010-11-041-1/+6
| | | | all instances. This was a real pain to debug, but an easy fix once I found it. Thanks to obs for the report.
* Cleaned up whitespace and linewrap issues in treeprocessorspy and fixed a ↵Waylan Limberg2010-11-011-15/+17
| | | | few typos in docs.
* 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/+10
| | | | 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
|
* Rename misc.py to util.py at the request of upstreamToshio Kuratomi2010-07-051-12/+12
|
* Break cyclic import of markdown. This allows people to embed markdownToshio Kuratomi2010-07-051-15/+17
| | | | if they desire.
* Fix for undefined variables that need to be importedToshio Kuratomi2010-07-051-1/+1
|
* The ENABLE_ATTRIBUTES global setting is now ackowledged.Waylan Limberg2009-10-211-17/+18
|
* Getting rid of has_key for compatibility with python3k.Yuri Takhteyev2008-12-041-1/+1
|
* Cleaned up recent refactor into a package from a single file.Waylan Limberg2008-11-201-9/+15
|
* Attempting a refactoring, breaking markdown into multiple files.Yuri Takhteyev2008-11-171-0/+323