summaryrefslogtreecommitdiff
path: root/markdown/extensions
Commit message (Collapse)AuthorAgeFilesLines
* Added support for attr_lists on definition list terms.baserock/morphWaylan Limberg2013-07-191-2/+2
| | | | | | | | Like headers (h1-6) dt's can only be on one line, so we need to use the header regex on dt's. This was implemented after considering a recent [discussion](http://six.pairlist.net/pipermail/markdown-discuss/2013-July/002859.html) on the markdown mailing list. Prior to that discussion, I never considered that it was impossable to set block level attrs on dt's. Now it is.
* Allow inline attr_lists at end of header.Waylan Limberg2013-07-191-1/+1
| | | | | | | | | | A header can be only one line - so unlike other block level elements, a attr_list must be at th eend of the line. To disingush it from an inline attr_list on the last child in a header, we must require at least one space before th eblock-level attrt_list. Always intended it to work that way. Not sure how I missed that before. At least we're testing for it now.
* Attr_List Extension now also supports nested ol's.Waylan Limberg2013-07-191-11/+11
| | | | | | | | | | Not sure how I missed that when committing ea4af0d. Also as a side-effect, this fixes #230 - which brought my previous oversight to my attention. Thanks for the report @divisoryang. Also added some tests - including tests of list items without attr_lists. Sometimes I forget to test markup that does not use an extension when an extension is enabled. That's what resulted in #230 being reported.
* MetaData no longer fails with no newline. Fixes #228.Waylan Limberg2013-07-031-1/+1
|
* Minor cleanup.Waylan Limberg2013-06-161-1/+0
|
* Attr_List Extension now support attr_lists on nested lists.Waylan Limberg2013-06-161-1/+28
| | | | | | A list item with a nested list complicates were the attr_list can be. Fixes #218. Thanks for the report @jpzimmer.
* Fixed wikilinks extension's handling of config setting. Not sure how I ↵Waylan Limberg2013-06-161-2/+2
| | | | didn't notice the tests were failing for this before.
* AbbrExtension now handles abbreviations nested in other markup.Waylan Limberg2013-06-161-2/+2
| | | | | | | | Just set each abreviation as an AtomicString. Given the nature of abbreviations, they are not likely to ever contain any other markup anyway. Also added a test. Fixes #224. Thanks for the report @JakeChampion.
* Fixed #216. WikiLink Extension actually accepts configs.Waylan Limberg2013-05-191-2/+2
|
* Fixed a typo in the docsLeonid Shvechikov2013-04-151-1/+1
|
* Future imports go after the docstringsAdam Dinwoodie2013-03-1817-17/+18
| | | | | | | | | 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.
* Fix some pyflakes-undefined-name warningsDmitry Shachnev2013-03-151-1/+1
|
* Update fenced_code.pyTimon Wong2013-03-151-1/+1
| | | CodeHilite: linenos is replaced by linenums
* Removed the html_tidy extension. See 2.3 release notes for explaination.Waylan Limberg2013-03-131-71/+0
|
* Dict.keys() does not return a list in Python 3.Waylan Limberg2013-02-271-1/+1
|
* Merge branch '2and3'Waylan Limberg2013-02-2718-134/+144
|\
| * Now using universal code for Python 2 & 3.Waylan Limberg2013-02-2718-134/+144
| | | | | | | | | | | | | | | | | | | | 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.
* | Missed a set.append -> set.add.Waylan Limberg2013-02-251-1/+1
| |
* | Consistant parsing of attr_lists in Python3.3Waylan Limberg2013-02-251-2/+2
|/ | | | | | Fixes #194. The NAME_RE regex was failing in Python 3.3 with the range `\u10000-\ueffff`. Also, in Python =< 3.2 the range `\u0300-\u036f` matches a colon but not in Python 3.3.
* Change `set.append` -> `set.add` in `headerid.unique`Waylan Limberg2013-02-222-3/+3
| | | | | | | | | Fixes #195. This was getting missed because the HeadrerId extension's reset method was resetting the IDs to a list. However, some third party extensions may want to call the unique function and it should work as documented. Interestingly, the TOC extension was using it and passing in a list as well. All fixed now. Also added a test of the `unique` function directly so we shouldn't repeat this in the future.
* More TOC cleanup and added tests.Waylan Limberg2013-02-191-2/+2
|
* TOC list item names must use text from all children.Waylan Limberg2013-02-191-1/+1
|
* Updated toc extension to work with changes @ 4ff74e3.Waylan Limberg2013-02-191-2/+2
|
* Ensure toc attribute is available on Markdown class.Waylan Limberg2013-02-191-3/+3
| | | | | | This appears to have recently been broken with the fixes in #191. This time I've added tests to prevent future breakage and added documentation to explain the behavior.
* Do not use assigned names "next" and "id", rename to order_toc_list and ↵benjaoming2013-02-181-18/+20
| | | | clean up code
* code cleanupbenjaoming2013-02-181-13/+12
|
* Make TocTreeprocessor extendable and be more gentle on badly structured headingsbenjaoming2013-02-171-63/+126
|
* Allow better linenum override in CodeHiliteWaylan Limberg2013-02-141-10/+23
| | | | | | | | | | | Fixes #148. The "force_linenos" config setting of the CodeHilite extension has been marked as Pending Deprecation and a new setting "linenums" has been added to replace it. See documentation for the [CodeHilite Extension] for an explaination of the new "linenums" setting. The new setting will honor the old "force_linenos" if it is set, but it will raise a PendingDeprecationWarning and will likely be removed in a future version of Python-Markdown. [CodeHilite Extension]: extensions/codehilite.html
* Remove RSS Extension.Waylan Limberg2013-02-121-114/+0
| | | | | | Closes #143. If you would like to continue using the extension (not recomended), it is archived on [Github](https://gist.github.com/waylan/4773365).
* Allow capitalized Admonition title.Waylan Limberg2013-02-121-1/+1
| | | | | If an adminition title is capitalized, the html class on the div should still be lowercased.
* Merge branch 'master' into admonitionTiago Serafim2013-02-097-28/+43
|\ | | | | | | | | | | Conflicts: docs/extensions/index.txt tests/extensions/test.cfg
| * 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.
| * Moved whitespace normalization to a preprocessor.Waylan Limberg2013-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #150 - at least as much as I'm willing to. This allows whitespace normalization to be overridable by the extension API. Yes, I realize that most other processors will also proabably need to be overniriden to work with any differant whitespace normalization - but I'm okay with that. As pointed out in #150, some processors have the tab length hardcoded in regexes. I'm willing to accept a working patch that fixes that - and keeps the regexes easy to override in a subclass (the provded patch moved them inside the __init__ method - which is not so easy to override in a subclass)). However, that is about the only additional change I'm willing to consider for this issue.
| * nl2br and attr_list compatability.Waylan Limberg2013-02-062-3/+3
| | | | | | | | | | | | Fixes #177. When using both extensions, breaks (`<br>`) must have a linebreak (`\n`) after them before attr_list is run. This patch reorders the treeprocessors so that happens ('attr_list' runs after 'prettify' not before). Also had to alter headerid extension so it runs after 'prettify' or it would run before 'attr_list' if loaded before 'attr_list' by user.
| * Account for a paragraph that starts with a colon when processing def_listsWaylan Limberg2013-02-061-4/+10
| | | | | | | | Fixes #171. While that report provided an example of an unordered list item that started with a colon, any block that starts with a colon and has no siblings before it (paragraph as begining if document, list item, etc) all exhibit this same behavior. Following PHP Markdown Extra's lead, these are not definition items as they have no term before them.
| * Better fix for #164. Works in Python 2 & 3.Waylan Limberg2012-12-181-4/+4
| |
| * Fixed #165. Switched the order of treeprocessors when attr_list and headerid ↵Waylan Limberg2012-12-132-10/+8
| | | | | | | | extensions are used togeather. While this means headerid may alter IDs defined in attr_lists for uniqueness, automaticaly generated ids will not contain unparsed attr_lists. This is the lesser of two evils - and actually generates a more valid output (all IDs will be unique)
| * Fixed #164. attr_list extension attribute names are now sanitized and won't ↵Waylan Limberg2012-12-131-2/+13
| | | | | | | | crash the serealizer.
| * Fixed #160. No `markdown=1` support in safe_mode.Waylan Limberg2012-12-051-2/+3
| | | | | | | | | | | | | | When in safe_mode, there is no raw html to contain `markdown=1` for processing, so there is no need to turn on that feature. The symptom reported in issue #160 appears to be a side effect of commit a2377e1129331430998de821ed3abf38247edca1.
| * Fix all pyflakes unused-import/unused-variable warningsDmitry Shachnev2012-11-093-4/+1
| |
| * Remove exec bit from extensions/fenced_code.pyDmitry Shachnev2012-11-031-0/+0
| |
* | Added comments detailing the difference between not providing a title and ↵Tiago Serafim2012-09-191-0/+4
| | | | | | | | using a blank string as a title
* | More tests for the extension and new tests for the RE. It's now possible to ↵Tiago Serafim2012-09-191-9/+9
| | | | | | | | use an explicit blank title to not have the <p> tag with the title rendered.
* | Removed the configs.Tiago Serafim2012-09-081-39/+16
| |
* | Initial version with insufficient tests and no docs.Tiago Serafim2012-09-021-0/+136
|/
* Typo: Boolen -> Boolean.Grahack2012-08-291-2/+2
|
* Fixed unicode breakage.Erik van Zijst2012-08-141-1/+1
| | | | | | | | | | | | | | | | 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
* 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.
* Added support for <foo>+<bar> lexers of Pygmentspapaeye2012-07-211-1/+1
|
* Stack Overflow does NOT convert single linebreaks in markdown to `<br>` tags.Adrian2012-07-161-1/+1
|