summaryrefslogtreecommitdiff
path: root/markdown/extensions/footnotes.py
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Dict.keys() does not return a list in Python 3.Waylan Limberg2013-02-271-1/+1
|
* Now using universal code for Python 2 & 3.Waylan Limberg2013-02-271-10/+17
| | | | | | | | | | 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.
* Footnote ids contain dashes when outputing HTML5.Waylan Limberg2013-02-081-5/+7
| | | | | Previously they contained colons - and they still do for HTML4 and XHTML. Fixes #180.
* Fix all pyflakes unused-import/unused-variable warningsDmitry Shachnev2012-11-091-1/+1
|
* Fixed #129. Footnotes now output valid HTML5.Waylan Limberg2012-08-091-2/+7
| | | | | | | | | | | | | | | | 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.
* Fixed #73. Codehilite now works in footnotes.Waylan Limberg2012-01-201-3/+3
| | | | | | | | The footnotes treeprocessor must be the first one run so that all others, including codehilite's, can run on the contents of the footnote div which is created and inserted by the footnotes treeprocessor. Thanks to startling for the report.
* fixed an error in the BACKLINK_TEXT option in the footnotes extension.tim2011-12-201-2/+2
| | | | | I accidentally changed the wrong line (L294 instead of L293) to "self.footnotes.getConfig("BACKLINK_TEXT")" before. This fixes that.
* New footnotes configuration option: BACKLINK_TEXT (second try).tim2011-12-201-2/+8
| | | | | | | | | | | | | | | | | | BACKLINK_TEXT specifies the text that's used in the link at the end of the footnote to link back up to the reader's place. It still defaults to "↩". Okay, so at first I had an uncessarily complicated commit for this and submitted a pull request. Waylan showed me a better way to do it, here: https://github.com/startling/Python-Markdown/commit/ee7d1a26c76f970c12226ca48ba52dc1d32f2488#markdown/extensions/footnotes.py-P19 So I made another commit and added it to the pull request. But then I accidentally added yet another commit to the pull request, accidentally. Since then, I've realized it would be best to start with a new branch and closed that first pull request. Hopefully this will be the last try.
* Fixed #51. Removed recussion from footnote preproccessor. Also refactors the ↵Waylan Limberg2011-11-181-47/+31
| | | | code to provide a few other minor improvements s that output more closely matches php's output. Thus the changes in the tests.
* Fixed Ticket 70 and added a test. Footnote references whithout a ↵Waylan Limberg2010-08-251-7/+10
| | | | coresponding definition no longer raise an error. They now pass through as plain text - which is the same behavior as PHP Markdown Extra. Thanks for the report Benjamin Bach.
* Fixed problem hidden by Ticket 68. Defining a footnote placeholder in a ↵Waylan Limberg2010-08-021-8/+7
| | | | markdown document results in the placeholder actually being replaced. Also added a test for this. Note that if the placeholder paragraph has other text, that text is lost. Not sure if this is a bug or bad markdown syntax.
* Fix Ticket 68. Remove an old line of code from the footnote extension that ↵Waylan Limberg2010-08-021-1/+0
| | | | should have been removed excatly 2 years and 3 days ago (commit bd185087dc899b6157f8) when elementtree support was added. And to think it has been generating an error the whole time and was only just reported now. It appears this was never tested as it still does not work after removing the old line. At least we do not get an error. The footnote placeholder is just an empty paragraph. Thanks for the report Evan Carmi.
* Rename misc.py to util.py at the request of upstreamToshio Kuratomi2010-07-051-1/+1
|
* Break cyclic import of markdown. This allows people to embed markdownToshio Kuratomi2010-07-051-2/+3
| | | | if they desire.
* Fixed Ticket 37. When multiple markdown documents are displayed on one page andWaylan Limberg2009-07-211-5/+19
| | | | | contain footnotes with the same name, they will no longer collide when 'UNIQUE_IDS' is set to True. Thanks to Paul Stansifer for report and patch.
* Updated footnotes extension for new refactor.Waylan Limberg2008-11-201-6/+6
|
* Moved markdown_extensions/ to markdown/extensions. Markdown is now one ↵Waylan Limberg2008-11-201-0/+293
package instead of two.