| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This was adapted from 11408e50 of the md3 branch.
|
|
|
|
|
|
|
|
|
|
| |
Serializer should only escape & in attributes if not part of &
Better regex avoid Unicode and `_` in amp detection.
In general, we don't want to escape already escaped content, but with code content, we want literal representations of escaped content, so have code content explicitly escape its content before placing in AtomicStrings.
Closes #669.
|
|
|
|
| |
Fixes #435.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
HRProcessor tried to access a member variable after recursively calling
itself. In certain situations HRProcessor will try to access its
member variable containing its match, but it will not be the same match
that call in the stack expected. This is easily fixed by storing the
match locally *before* doing any recursive work.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The rest should have test cases added.
|
| |
|
|
|
|
|
| |
This mostly revolves around old APIs for ElementTree, but includes a few
others as well. Fixes #254. Thanks for the report.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This will make it easier for extensions to subclass the list block processors
and alter their behavior. Such as the request in issue #64.
|
|
|
|
| |
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.
|
|
|
|
| |
actualy useses these? Anyway, we now match markdown.pl.
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
default.
|
|\
| |
| |
| | |
git://gitorious.org/python-markdown/mainline into merge-requests/13
|
| |
| |
| |
| |
| | |
Now the startindex would be reset if continual unordered
lists are present (tests are passed).
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
|/
|
|
| |
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)
|
|
|
|
| |
should be more future proof.
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
fixed imports. We import logging levels from logging directly and only import message from md_logging.
|
| |
|
|
|
|
| |
if they desire.
|
| |
|
|
|
|
| |
blockquote tag. Added lists8.txt and .html for test suite to test condition.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
observe rules for using p tags. Thanks to Gerry LaMontagne for the patch.
|
|
|
|
| |
Thanks for the report and preliminary work Gerry LaMontagne.
|
|
|
|
| |
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.
|