aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/blockprocessors.py
Commit message (Collapse)AuthorAgeFilesLines
* No binary operators at begining of line.Waylan Limberg2015-02-181-4/+4
| | | | | | | Apparently this is a new requirement of flake8. That's the thing about using tox. Every test run reinstalls all dependencies so an updated dependency might instroduce new errors. I could specify a specific version, but I like staying current.
* Use newer ElementTree API to avoid future breakage.Waylan Limberg2015-01-311-1/+1
|
* Flake8 cleanup (mostly whitespace).Waylan Limberg2014-11-201-60/+65
| | | | | | 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.
* Mark a few more lines with 'no cover' - missed them the first time through. ↵Waylan Limberg2014-07-111-1/+1
| | | | The rest should have test cases added.
* Marked a bunch of lines as 'no cover'. Coverage at 91%Waylan Limberg2014-07-111-2/+2
|
* Address various depreciated APIs in PythonWaylan Limberg2014-01-081-5/+5
| | | | | This mostly revolves around old APIs for ElementTree, but includes a few others as well. Fixes #254. Thanks for the report.
* Use lead blockprocessor comment as docstringAdam Dinwoodie2013-03-181-10/+12
| | | | | | The lead comment in blockprocessors.py should really be a docstring for consistency with other files. Fix this with the other part of @Arfrever's patch for issue #203.
* 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-16/+16
| | | | | | | | | | 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.
* Preserve all blank lines in code blocks.Waylan Limberg2013-02-141-13/+13
| | | | | | | | | | | | Fixes #183. Finally got this working properly. The key was using a regex substitution with non-overlapping matches that removed all whitespace from the begining of *all* blank lines when normalizing whitespace. Once I got that, I could simplfy the EmptyBlockProcessor and easily output one or two blank lines appropriately. A blank block gets two new lines (`'\n\n'`), while a block which starts with a newline gets one.
* Cleaned up fixes for #183Waylan Limberg2013-02-081-1/+1
| | | | | | | | | 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.
* Preserve empty lines in code blocksWaylan Limberg2013-02-061-6/+7
| | | | | | Partial fix for #183. Some lines are still being lost. When the processors are run, one line is lost. When their calling code is comments out (completely skiped) a line is still lost if more than 3 exist in a row. Also need to add some tests for this.
* Fix all pyflakes unused-import/unused-variable warningsDmitry Shachnev2012-11-091-1/+1
|
* Provide more control to list processors subclasses.Waylan Limberg2012-01-241-1/+3
| | | | | This will make it easier for extensions to subclass the list block processors and alter their behavior. Such as the request in issue #64.
* Fixed #47. Improved HRProccessor.\n\nPython's re module does not support ↵Waylan Limberg2011-11-171-18/+19
| | | | atomic grouping, which was slowing the HR regex down if a long HR ended with a non HR char (casing the regex to backtrack). Therefore, we have to simulate atomic grouping. Fortunately, we only need to match end-of-line or end-of-string after the atomic group here, so it was an easy case to simulate. Just remove the '$' from the end of the regex and manualy check using m.end(). The run method was refactored while I was at it, saving us from running the regex twice for each HR.
* Fixed #22. Horizontal rules now work in a few more crazy edge cases. Who ↵Waylan Limberg2011-06-161-1/+1
| | | | actualy useses these? Anyway, we now match markdown.pl.
* Fixed #21. A header and paragraph not seperated by a blank line inside a ↵Waylan Limberg2011-06-151-4/+27
| | | | list item are now parsed correctly. One of those crazy wierd edge cases that no one would ever test for, but is obvious once you see it.
* Fixed #15. Setext Headers now work with any number of - or = characters.Waylan Limberg2011-06-011-1/+1
|
* Made lazy ordered lists a settable option. The previous behavior (on) is the ↵Waylan Limberg2011-04-291-1/+1
| | | | default.
* Merge commit 'refs/merge-requests/13' of ↵Waylan Limberg2011-04-281-1/+16
|\ | | | | | | git://gitorious.org/python-markdown/mainline into merge-requests/13
| * fixed startindex reset in multiple ulRohan Jain2011-04-051-6/+4
| | | | | | | | | | Now the startindex would be reset if continual unordered lists are present (tests are passed).
| * add new list item commentRohan Jain2011-04-031-0/+1
| |
| * custom index support for ol tagRohan Jain2011-04-031-1/+17
| | | | | | | | | | | | | | A ol tag with custom start index can be defined by using a different integer as the first item numbering. Search for `3. Bird` on: http://daringfireball.net/projects/markdown/syntax
* | fix import loop when importing loggerCraig de Stigter2011-04-181-1/+3
| |
* | sane logging. remove sys.exit() calls (libraries should never ever call ↵Craig de Stigter2011-04-181-3/+2
|/ | | | sys.exit()) and raise appropriate exceptions instead. backwards incompatible insofar as custom extensions may need tweaks if they're using old markdown logging (but they shouldn't, it was gross)
* A better implementation of globals as attributes on the Markdown class. This ↵Waylan Limberg2010-07-071-11/+11
| | | | should be more future proof.
* Factored out the building of the various processors and patterns into ↵Waylan Limberg2010-07-071-0/+18
| | | | 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-11/+15
|
* Clean up previous commit a little. renamed misc_logging to md_logging and ↵Waylan Limberg2010-07-061-1/+2
| | | | fixed imports. We import logging levels from logging directly and only import message from md_logging.
* Rename misc.py to util.py at the request of upstreamToshio Kuratomi2010-07-051-27/+27
|
* Break cyclic import of markdown. This allows people to embed markdownToshio Kuratomi2010-07-051-29/+29
| | | | if they desire.
* Fix for undefined variables that need to be importedToshio Kuratomi2010-07-051-0/+1
|
* Blockquoted text in the first item of a list is now placed in child p tag of theGerry LaMontagne2010-03-231-25/+3
| | | | blockquote tag. Added lists8.txt and .html for test suite to test condition.
* Fixed ticket 58. The first item of a looselist gets placed in p tags whenGerry LaMontagne2010-03-221-3/+35
| | | | | | it has a sublist. Previously, the test suite erroneously passed this condition because there was an error in the expected '.html' output file. The expected output has been corrected as well.
* Fixed Ticket 57. Lists where the first line of an item is a nested item, now ↵Waylan Limberg2010-03-191-2/+17
| | | | observe rules for using p tags. Thanks to Gerry LaMontagne for the patch.
* Fixed Ticket 53. Nested lists no longer isorder items in certain edge cases. ↵Waylan Limberg2010-03-151-1/+5
| | | | Thanks for the report and preliminary work Gerry LaMontagne.
* Fixed ticket 35. Lists now work when padded with five or more spaces after ↵Waylan Limberg2009-06-171-4/+4
| | | | asterisk. Adjusted regex to eat all (one or more) of the spaces. While it may seem wrong (at least in the loose list case), this is how all other implementations work. And it solves a number of edge cases otherwise not accounted for in the list parser.
* Completed nested lists and added a test. All tests pass.Waylan Limberg2009-02-041-5/+18
|
* Added support for multilevel lists - step one. Currently only works for ↵Waylan Limberg2009-02-041-7/+26
| | | | loose lists. In fact, non-loose lists are currently broken - seen as code blocks.
* Making the space after angle brackets optional in blockquotes.Yuri Takhteyev2008-12-241-1/+1
|
* Fixed minor typo in each of previous two commits.Waylan Limberg2008-11-221-1/+1
|
* Made a few minor tweaks to list blockprocessors to make subclassing easier ↵Waylan Limberg2008-11-221-8/+15
| | | | without rewriting the whole thing.
* Fixed BlockParser to parse code blocks nested in list items and added a ↵Waylan Limberg2008-11-181-0/+3
| | | | test. Somehow we never had a test for that before. Also reset markdown.py to be executable again.
* Attempting a refactoring, breaking markdown into multiple files.Yuri Takhteyev2008-11-171-0/+418