aboutsummaryrefslogtreecommitdiffstats
path: root/markdown
Commit message (Collapse)AuthorAgeFilesLines
* Footnote ids contain dashes when outputing HTML5.Waylan Limberg2013-02-082-6/+8
| | | | | Previously they contained colons - and they still do for HTML4 and XHTML. Fixes #180.
* Updated docs to reflect extension loading best practices.Waylan Limberg2013-02-081-5/+0
| | | | Fixes #184. Also delted some commented out code I missed in previous commit.
* Moved whitespace normalization to a preprocessor.Waylan Limberg2013-02-083-5/+18
| | | | | | | | | | | | | | 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.
* Cleaned up fixes for #183Waylan Limberg2013-02-083-1/+7
| | | | | | | | | 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.
* HtmlBlockProcessor preserves empty linesWaylan Limberg2013-02-071-1/+1
| | | | | | | | | | | | | Partial fix for #183. This has the same effect on empty lines in code blocks as not using the html processor at all (which was eating some of the missing newlines as reported in issue #183). By doing `rsplit('\n\n')` the third newline (in each set of three) always ends up at the end of a block, rather than the begining - which it less of an issue for the html processor. Also updated tests to indicate final intended output, although they do not fully pass yet.
* Preserve whitespace in empty linesWaylan Limberg2013-02-071-1/+0
| | | | | | | | Partial fix for #183. By preserving tabs at the start of empty lines in code blocks, the parser will retain those empty lines. Still does not work consistantly if the tab is missing!? Not sure why. Also added tests.
* Preserve empty lines in code blocksWaylan Limberg2013-02-062-7/+8
| | | | | | 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.
* 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.
* Whitelisted known safe url schemes in safe_mode. A better fix for #185.Waylan Limberg2013-02-061-6/+7
|
* Forbid javascript:// URLs in safe modePhilipp Hagemeister2013-02-051-0/+3
|
* Enable attributes inside image referencesAdam Backstrom2013-01-271-0/+4
|
* 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.
* Upped version to 2.3.dev.Waylan Limberg2012-12-052-3/+29
| | | | | Also refactored the version info to force PEP 386 compliance and to avoid the need to change the version in both the source and setup.py
* 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.
* Merge pull request #159 from mitya57/masterWaylan Limberg2012-11-099-11/+3
|\ | | | | Fixed pyflakes warnings
| * Fix all pyflakes unused-import/unused-variable warningsDmitry Shachnev2012-11-099-11/+3
| |
* | Updated fix for #158 for Python <2.7Waylan Limberg2012-11-081-1/+1
| | | | | | | | | | | | | | Apparently, the `errors` keyword to encode was added in Python 2.7. In previous versions, it was just a positional argument. This should now work in all support versions. Thanks to @Gamma3000 for assistance in working through this issue.
* | Fixed #158. Now properly encoding output to stdout.Waylan Limberg2012-11-071-8/+7
|/ | | | | | | | This is another try at this problem. The trick is geting code that works with both Python 2 and Python 3. I think this does it. The only improvment I can see now is to catch any errors and customize the error message to sugg that the user set the environment variable PYTHONIOENCODING to the desired encoding before calling the commandline script.
* Merge branch 'master' of https://github.com/waylan/Python-Markdown2.2.1.finalWaylan Limberg2012-11-042-3/+20
|\
| * Remove exec bit from extensions/fenced_code.pyDmitry Shachnev2012-11-031-0/+0
| |
| * Fix silly typo in previous commit.Waylan Limberg2012-11-011-1/+1
| |
| * A better fix for #155. Unescaping inline placholders now returns the text ↵Waylan Limberg2012-11-011-6/+19
| | | | | | | | only of an Element - rather than the html which just gets html escaped in the output anyway.
| * Fixed #154. Inline placeholders in img alt text are now unescaped.Waylan Limberg2012-11-011-1/+1
| |
| * Fixed #155. Early unescaping of inline placeholders now works when the ↵Waylan Limberg2012-11-011-1/+5
| | | | | | | | placeholder is an Elementtree Element.
* | Upped version to 2.2.1.Waylan Limberg2012-11-041-2/+2
|/
* Fixed #153. Two spaces at end of paragraph is not a linebreak.Waylan Limberg2012-10-211-2/+0
|
* Fixed #152. Spaces in links are now escaped.Waylan Limberg2012-10-211-0/+1
|
* Fixed #151. Raw html matching is now case-insensitive.Waylan Limberg2012-10-211-1/+1
|
* Typo: Boolen -> Boolean.Grahack2012-08-291-2/+2
|
* Misc typos.chri2012-08-282-2/+2
|
* Merge branch 'master' of https://github.com/waylan/Python-MarkdownWaylan Limberg2012-08-231-1/+1
|\
| * 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 encoding issues when writing to stdout.Waylan Limberg2012-08-231-2/+9
|/ | | | | | | | | | | | | | | | | 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.
* 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.
* Improved `Markdown.set_output_format()`Waylan Limberg2012-08-091-4/+10
| | | | | | | | | | 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.
* Fixed UnicodeEncodeError when output from markdown_py is piped into another ↵Alexander Artemenko2012-07-261-1/+2
| | | | | | | 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 Pygmentspapaeye2012-07-211-1/+1
|
* Merge branch 'master' of github.com:Scorpil/Python-MarkdownScorpil2012-07-201-2/+1
|\ | | | | | | | | Conflicts: markdown/odict.py
| * Added more expressive description of an error.Scorpil2012-07-201-1/+5
| |
* | Added more expressive description of an error.Scorpil2012-07-201-1/+5
|/
* Stack Overflow does NOT convert single linebreaks in markdown to `<br>` tags.Adrian2012-07-161-1/+1
|
* Fixed 113. We still support Python 2.5 until Markdown version 2.3.Waylan Limberg2012-07-121-1/+1
|
* Fixed #112 and cleaned up error reporting when loading extensions.Waylan Limberg2012-07-121-9/+13
|
* Upped version to 2.2.0-Final.2.2.0.finalWaylan Limberg2012-07-051-1/+1
|
* Fixed #106. Replaced all references to freewisdom.org (except for Yuri's ↵Waylan Limberg2012-06-2811-18/+18
| | | | homepage).
* Fixed #109. The attr_list extension can now be loaded either before or after ↵Waylan Limberg2012-06-281-2/+6
| | | | the headerid extension.
* Fixed #105. Non-existant extensions fail with a warning only.Waylan Limberg2012-06-281-1/+1
|