| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |\
| | |
| | | |
Fix unicode problem in headerid extension
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
slugify() requires unicode, not a str instance. This causes the extension to
crash:
File "/home/erik/virtualenv/bb/local/lib/python2.7/site-packages/markdown/__init__.py" in markdown
386. return md.convert(text)
File "/home/erik/virtualenv/bb/local/lib/python2.7/site-packages/markdown/__init__.py" in convert
287. newRoot = treeprocessor.run(root)
File "/home/erik/virtualenv/bb/local/lib/python2.7/site-packages/markdown/extensions/headerid.py" in run
140. id = slugify(''.join(itertext(elem)), sep)
File "/home/erik/virtualenv/bb/local/lib/python2.7/site-packages/markdown/extensions/headerid.py" in slugify
93. value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
TypeError: must be unicode, not str
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Python 2.x, if you write to stdout and stdout is piped
(for example: `python -m markdown foo.txt | less`), then
`sys.stdout.encoding` is `None` and an error is rasied.
Commit 1132f9e20cd7a5d6be809651f1034c44c32dbc0e was an attempt to
fix this, and it works in Python 2.x.
However, it does not work in Python 3.x, which does not exhibit this problem.
In fact, that fix actually breaks things in Python 3 whether the output
is piped or not. Additionaly, in Python 2.x, the fix is not needed if the
output is not being piped.
As we do not have a version specific issue, but an issue with
`sys.stdout.encoding`, we check for that to determine which way to go.
This way, the "right thing" *should* happen every time.
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As HTML5 has depreciated use of `rev=anything` and `rel=footnotes`, they are no
longer inlcuded in the output when the output_format is set to HTML5. Note that
if someone successful registers a spec for `rel=footnotes` in the future (as
a microformat), then that could be considered valid. But until that happens,
it is invlaid to use in HTML5. Therefore, we remove it from the output (when
outputing HTML% only).
As an alternative, two new classes are set (in all output_formats). On the link
to the footnote (where `rel=footnotes` was used), we set `class=footnote-ref`
and on the backlink (where `rev=footnote` was used), we set
`class=footnote-backref`.
Also updated the tests to reflect to the new classes in the output.
|
|/
|
|
|
|
|
|
|
|
| |
Specificaly, `self.output_format` is defined and contains a string of the
output format used on the instance. This is more useful that an instance
of the searializer when determining alternate behavior elsewhere in the parser.
For example, see Issue #129.
Also cleaned up the error when an invalid format is provided. We now re-raise
the original error (with a custom message) rather than raising a new error.
|
|
|
|
| |
for documentation purposes, they are no longer being run. Perhaps I'll delete them later and add links to the online docs or something.
|
|\
| |
| | |
Fixed UnicodeEncodeError when output from markdown_py is piped
|
|/
|
|
|
|
|
| |
program.
In this case text should be encoded into the output encoding explicitly, because
sys.stdout.encoding is None, when piping data.
|
|\
| |
| | |
Added support for <foo>+<bar> lexers of Pygments
|
|/ |
|
|\
| |
| | |
More expressive ValueError description
|
| |\
| | |
| | |
| | |
| | | |
Conflicts:
markdown/odict.py
|
| | | |
|
| |/ |
|
|\ \
| | |
| | | |
Fixed typo in docs: 'md.treepreprocessor' for 'md.treeprocessor'.
|
| |/ |
|
|\ \
| |/
|/| |
Fixes example after moving AtomicString to util
|
| | |
|
|\ \
| |/
|/| |
Stack Overflow does NOT convert single linebreaks in markdown to `<br>` ...
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
homepage).
|
|
|
|
| |
'codehilite' extension.
|
|
|
|
| |
the headerid extension.
|
| |
|
| |
|
|
|
|
| |
first line of a code block for codehilite to recognize it.
|
|\ |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
Note that you can still explicitly set 'enable_attributes' and that
value will be honored regardless of 'safe_mode'. However if 'safe_mode'
is on and 'enable_attributes' is not explicitly set, then
'enable_attributes' defaults to False.
|
|\
| |
| | |
Attempted fix for issue 87
|
| | |
|
|/
|
|
| |
Elements should be inserted in the tree regardless of enable_attributes
|
|\
| |
| | |
added a test for the previous pull request
|
| | |
|
|\|
| |
| | |
Remove `<del>` and `<ins>` from block-level elements list
|
|/
|
|
| |
They are span elements. `<del>` is explicitly mentioned as such in the [markdown syntax document](http://daringfireball.net/projects/markdown/syntax)
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Also added a test. Thanks for the report.
|
|\
| |
| | |
Typo fix in doc: s/extension-configs/extension_configs/
|