summaryrefslogtreecommitdiff
path: root/markdown/extensions/footnotes.py
Commit message (Collapse)AuthorAgeFilesLines
* Switch docs to MKDocs (#602)Waylan Limberg2017-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes #601. Merged in 6f87b32 from the md3 branch and did a lot of cleanup. Changes include: * Removed old docs build tool, templates, etc. * Added MkDocs config file, etc. * filename.txt => filename.md * pythonhost.org/Markdown => Python-Markdown.github.io * Markdown lint and other cleanup. * Automate pages deployment in makefile with `mkdocs gh-deploy` Assumes a git remote is set up named "pages". Do git remote add pages https://github.com/Python-Markdown/Python-Markdown.github.io.git ... before running `make deploy` the first time.
* Fix footnote parsing of footnote content (#536)Isaac Muse2017-01-231-13/+20
| | | | | | | Fixes #412 and #493. First we parse footnote content as its own document avoid quirks with using li as a parent. Second, we surround placeholders with STX and ETX to prevent them from interfering with inline parsing; this is also consistent with how placeholders are used everywhere else in Python Markdown.
* Create additional references for duplicate footnotes (#534)Isaac Muse2017-01-231-5/+93
| | | | | | Track when we find duplicate footnote references and create unique ids for them. Then add an additional tree-processor after inline to go back and update the footnotes with additional back references that link to the duplicate footnote references. Fixes #468.
* Fix find footnote placeholder to recurseGustav Tiger2015-08-291-1/+3
|
* Use newer ElementTree API to avoid future breakage.Waylan Limberg2015-01-311-1/+1
|
* Flake8 cleanup (mostly whitespace).Waylan Limberg2014-11-201-44/+58
| | | | | | 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.
* Standardized all extension header comments to a uniform format.Waylan Limberg2014-08-211-21/+11
|
* Update extensions for Extension.__init__ refactorWaylan Limberg2014-07-311-17/+17
| | | | | | | | | | | | | | | | | Fixes #325. All extensions can now accept a dict of configs or **kwargs, not just a list of tuples. Third party extensions may want to follow suite. Extensions may only accept keyword arguments in the future. These changes still need to be documented. A couple things of note: The CodeHilite extension previously issued a DeprecationWarning if the old config key `force_linenos` was used. With thins change, a KeyError will now be raised. The `markdown.util.parseBoolValue` function gained a new argument: `preserve_none` (defaults to False), which when set to True, will pass None through unaltered (will not convert it to False).
* Allow extensions to register serializersWaylan Limberg2013-08-071-7/+9
| | | | | | | | | Setting output_format must happen after extensions are loaded. Only in that way can an extension register a serializer so that it will then be available to be used with the output_format keyword. A test has been added to avoid this regression from happening again in the future. Fixes #238, partially reverses commit 41cc055 and provides a better fix for
* 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.