[Python-modules-commits] [python-markdown] 01/05: Import python-markdown_2.6.9.orig.tar.gz
Dmitry Shachnev
mitya57 at moszumanska.debian.org
Fri Aug 18 08:28:41 UTC 2017
This is an automated email from the git hooks/post-receive script.
mitya57 pushed a commit to branch master
in repository python-markdown.
commit 9eb99b2ca6744db3b46f1c74b5e622d40be8863a
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date: Fri Aug 18 11:12:32 2017 +0300
Import python-markdown_2.6.9.orig.tar.gz
---
PKG-INFO | 8 ++--
README.md | 17 ++++---
docs/_template.html | 2 +-
docs/change_log.txt | 6 ++-
docs/extensions/api.txt | 2 +-
docs/extensions/index.txt | 2 +-
docs/index.txt | 2 +-
docs/install.txt | 2 +-
docs/release-2.1.0.txt | 2 +-
docs/release-2.2.0.txt | 2 +-
docs/release-2.3.txt | 2 +-
docs/release-2.4.txt | 2 +-
docs/release-2.5.txt | 2 +-
docs/release-2.6.txt | 4 +-
docs/test_suite.txt | 2 +-
makefile | 1 -
markdown/__version__.py | 2 +-
markdown/blockprocessors.py | 2 +-
markdown/extensions/admonition.py | 4 +-
markdown/extensions/tables.py | 49 ++++++++++++++++----
markdown/inlinepatterns.py | 8 ++--
markdown/postprocessors.py | 2 +-
setup.py | 6 +--
tests/extensions/admonition.html | 8 ++++
tests/extensions/admonition.txt | 8 ++++
tests/extensions/extra/tables.html | 92 +++++++++++++++++++++++++++++++++++++-
tests/extensions/extra/tables.txt | 39 ++++++++++++++++
tests/test_extensions.py | 24 ++++++++++
28 files changed, 255 insertions(+), 47 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index ba511e7..bcc63d4 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: Markdown
-Version: 2.6.8
+Version: 2.6.9
Summary: Python implementation of Markdown.
Home-page: https://pythonhosted.org/Markdown/
Author: Waylan Limberg
-Author-email: waylan.limberg [at] icloud.com
+Author-email: waylan.limberg at icloud.com
License: BSD License
-Download-URL: http://pypi.python.org/packages/source/M/Markdown/Markdown-2.6.8.tar.gz
+Download-URL: http://pypi.python.org/packages/source/M/Markdown/Markdown-2.6.9.tar.gz
Description:
This is a Python implementation of John Gruber's Markdown_.
It is almost completely compliant with the reference implementation,
@@ -25,7 +25,7 @@ Description:
`mailing list`_ and report bugs on the `bug tracker`_.
.. _`mailing list`: http://lists.sourceforge.net/lists/listinfo/python-markdown-discuss
- .. _`bug tracker`: http://github.com/waylan/Python-Markdown/issues
+ .. _`bug tracker`: http://github.com/Python-Markdown/markdown/issues
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
diff --git a/README.md b/README.md
index 779b300..17b544c 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
[Python-Markdown][]
===================
-[![Build Status](http://img.shields.io/travis/waylan/Python-Markdown.svg)](https://travis-ci.org/waylan/Python-Markdown)
-[![Coverage Status](https://img.shields.io/coveralls/waylan/Python-Markdown.svg)](https://coveralls.io/r/waylan/Python-Markdown?branch=master)
-[![Downloads](http://img.shields.io/pypi/dm/Markdown.svg)](https://pypi.python.org/pypi/Markdown#downloads)
+[![Build Status](http://img.shields.io/travis/Python-Markdown/markdown.svg)](https://travis-ci.org/Python-Markdown/markdown)
+[![Coverage Status](https://img.shields.io/coveralls/Python-Markdown/markdown.svg)](https://coveralls.io/r/Python-Markdown/markdown?branch=master)
[![Latest Version](http://img.shields.io/pypi/v/Markdown.svg)](http://pypi.python.org/pypi/Markdown)
+[![Python Versions](http://img.shields.io/pypi/pyversions/Markdown.svg)](http://pypi.python.org/pypi/Markdown)
[![BSD License](http://img.shields.io/badge/license-BSD-yellow.svg)](http://opensource.org/licenses/BSD-3-Clause)
-[![Issue Stats](http://issuestats.com/github/waylan/Python-Markdown/badge/issue?style=flat)](http://issuestats.com/github/waylan/Python-Markdown)
+[![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-contributor%20covenant-green.svg?style=flat-square)][Code of Conduct]
This is a Python implementation of John Gruber's [Markdown][].
It is almost completely compliant with the reference implementation,
@@ -35,4 +35,11 @@ Support
You may ask for help and discuss various other issues on the [mailing list][] and report bugs on the [bug tracker][].
[mailing list]: http://lists.sourceforge.net/lists/listinfo/python-markdown-discuss
-[bug tracker]: http://github.com/waylan/Python-Markdown/issues
+[bug tracker]: http://github.com/Python-Markdown/markdown/issues
+
+Code of Conduct
+---------------
+
+Everyone interacting in the Python-Markdown project's codebases, issue trackers, and mailing lists is expected to follow the [Code of Conduct].
+
+[Code of Conduct]: https://github.com/Python-Markdown/markdown/blob/master/CODE_OF_CONDUCT.md
diff --git a/docs/_template.html b/docs/_template.html
index d3780dd..58e9967 100644
--- a/docs/_template.html
+++ b/docs/_template.html
@@ -47,7 +47,7 @@
title="next chapter">%(next_title)s</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
- <li><a href="https://github.com/waylan/Python-Markdown/issues"
+ <li><a href="https://github.com/Python-Markdown/markdown/issues"
>Report a Bug</a></li>
<li><a href="%(source)s"
rel="nofollow">Show Source</a></li>
diff --git a/docs/change_log.txt b/docs/change_log.txt
index 847046d..c9478a2 100644
--- a/docs/change_log.txt
+++ b/docs/change_log.txt
@@ -7,6 +7,10 @@ next_url: release-2.6.html
Python-Markdown Change Log
=========================
+Aug 17, 2017: Released version 2.6.9 (a bug-fix release).
+
+Jan 25, 2017: Released version 2.6.8 (a bug-fix release).
+
Sept 23, 2016: Released version 2.6.7 (a bug-fix release).
Mar 20, 2016: Released version 2.6.6 (a bug-fix release).
@@ -21,7 +25,7 @@ Apr 20, 2015: Released version 2.6.2 (a bug-fix release).
Mar 8, 2015: Released version 2.6.1 (a bug-fix release). The (new)
`yaml` option has been removed from the Meta-Data Extension as it was buggy
-(see [#390](https://github.com/waylan/Python-Markdown/issues/390)).
+(see [#390](https://github.com/Python-Markdown/markdown/issues/390)).
Feb 19, 2015: Released version 2.6 ([Notes](release-2.6.html)).
diff --git a/docs/extensions/api.txt b/docs/extensions/api.txt
index 66daa86..9653883 100644
--- a/docs/extensions/api.txt
+++ b/docs/extensions/api.txt
@@ -463,7 +463,7 @@ The `add()` method accepts three arguments:
* **`value`**: The object instance stored in this item.
-* **`location`**: Optional. The items location in relation to other items.
+* **`location`**: The items location in relation to other items.
Note that the location can consist of a few different values:
diff --git a/docs/extensions/index.txt b/docs/extensions/index.txt
index 1052d15..ba95274 100644
--- a/docs/extensions/index.txt
+++ b/docs/extensions/index.txt
@@ -84,4 +84,4 @@ is maintained on the wiki for your convenience. The Python-Markdown team
offers no official support for these extensions. Please see the developer of
each extension for support.
-[list]: https://github.com/waylan/Python-Markdown/wiki/Third-Party-Extensions
+[list]: https://github.com/Python-Markdown/markdown/wiki/Third-Party-Extensions
diff --git a/docs/index.txt b/docs/index.txt
index bfe1818..92ac2d0 100644
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -112,4 +112,4 @@ You may ask for help and discuss various other issues on the [mailing list][]
and report bugs on the [bug tracker][].
[mailing list]: http://lists.sourceforge.net/lists/listinfo/python-markdown-discuss
-[bug tracker]: http://github.com/waylan/Python-Markdown/issues
+[bug tracker]: http://github.com/Python-Markdown/markdown/issues
diff --git a/docs/install.txt b/docs/install.txt
index 1989398..c01c3b4 100644
--- a/docs/install.txt
+++ b/docs/install.txt
@@ -62,6 +62,6 @@ Python-Markdown is maintained in a Git repository on GitHub.com. To
get a copy of Python-Markdown from the repository do the following from the
command line:
- git clone git://github.com/waylan/Python-Markdown.git python-markdown
+ git clone git://github.com/Python-Markdown/markdown.git python-markdown
cd python-markdown
python setup.py install
diff --git a/docs/release-2.1.0.txt b/docs/release-2.1.0.txt
index efb3b4a..43230dc 100644
--- a/docs/release-2.1.0.txt
+++ b/docs/release-2.1.0.txt
@@ -118,5 +118,5 @@ test the built-in extensions and other options available to change the parsing
behavior. See the [Test Suite](test_suite.html) documentation for details.
Various bug fixes have been made, which are too numerous to list here. See the
-[commit log](https://github.com/waylan/Python-Markdown/commits/master) for a
+[commit log](https://github.com/Python-Markdown/markdown/commits/master) for a
complete history of the changes.
diff --git a/docs/release-2.2.0.txt b/docs/release-2.2.0.txt
index c3750fa..8b94563 100644
--- a/docs/release-2.2.0.txt
+++ b/docs/release-2.2.0.txt
@@ -64,5 +64,5 @@ The BlockParser API was slightly altered to allow `blockprocessor.run` to return
within any Blockprocessor instance.
Various bug fixes have been made. See the
-[commit log](https://github.com/waylan/Python-Markdown/commits/master)
+[commit log](https://github.com/Python-Markdown/markdown/commits/master)
for a complete history of the changes.
diff --git a/docs/release-2.3.txt b/docs/release-2.3.txt
index a15e584..81c5d88 100644
--- a/docs/release-2.3.txt
+++ b/docs/release-2.3.txt
@@ -84,5 +84,5 @@ try it out and report bugs and/or improvements.
[rST]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions
* Various bug fixes have been made. See the
-[commit log](https://github.com/waylan/Python-Markdown/commits/master)
+[commit log](https://github.com/Python-Markdown/markdown/commits/master)
for a complete history of the changes.
diff --git a/docs/release-2.4.txt b/docs/release-2.4.txt
index c32408c..f1d00af 100644
--- a/docs/release-2.4.txt
+++ b/docs/release-2.4.txt
@@ -73,5 +73,5 @@ the [Fenced Code Extension]):
[A. Jesse Jiryu Davis]: https://github.com/ajdavis
* Various bug fixes have been made. See the
-[commit log](https://github.com/waylan/Python-Markdown/commits/master)
+[commit log](https://github.com/Python-Markdown/markdown/commits/master)
for a complete history of the changes.
diff --git a/docs/release-2.5.txt b/docs/release-2.5.txt
index 6f38122..7cde02f 100644
--- a/docs/release-2.5.txt
+++ b/docs/release-2.5.txt
@@ -183,5 +183,5 @@ What's New in Python-Markdown 2.5
benefit everyone.
* Various bug fixes have been made. See the
- [commit log](https://github.com/waylan/Python-Markdown/commits/master)
+ [commit log](https://github.com/Python-Markdown/markdown/commits/master)
for a complete history of the changes.
diff --git a/docs/release-2.6.txt b/docs/release-2.6.txt
index 9a235c8..e450162 100644
--- a/docs/release-2.6.txt
+++ b/docs/release-2.6.txt
@@ -206,7 +206,7 @@ explanation.</ins>
[MultiMarkdown]: http://fletcherpenney.net/MultiMarkdown_Syntax_Guide#metadata
[Meta-Data]: extensions/meta_data.html
[YAML]: http://yaml.org/
-[#390]: https://github.com/waylan/Python-Markdown/issues/390
+[#390]: https://github.com/Python-Markdown/markdown/issues/390
### Table of Contents Extension Refactored
@@ -259,5 +259,5 @@ benefit everyone.
[flake8]: https://flake8.readthedocs.io/en/latest/
Various bug fixes have been made. See the
-[commit log](https://github.com/waylan/Python-Markdown/commits/master)
+[commit log](https://github.com/Python-Markdown/markdown/commits/master)
for a complete history of the changes.
diff --git a/docs/test_suite.txt b/docs/test_suite.txt
index 745ed3b..ee761f2 100644
--- a/docs/test_suite.txt
+++ b/docs/test_suite.txt
@@ -134,5 +134,5 @@ writing new tests, those standards and naming conventions should be followed.
[PHP]: http://michelf.com/projects/php-markdown/
[PyTidyLib]: http://countergram.com/open-source/pytidylib/
[tox]: http://testrun.org/tox/latest/
-[setting up a testing environment]: https://github.com/waylan/Python-Markdown/wiki/Test-Environment-Setup
+[setting up a testing environment]: https://github.com/Python-Markdown/markdown/wiki/Test-Environment-Setup
[YAML]: http://yaml.org/
diff --git a/makefile b/makefile
index 0ed1dba..2752d6a 100644
--- a/makefile
+++ b/makefile
@@ -20,7 +20,6 @@ install:
.PHONY : deploy
deploy:
- python setup.py register
python setup.py sdist --manifest-only
python setup.py sdist --formats zip,gztar upload
diff --git a/markdown/__version__.py b/markdown/__version__.py
index 56b4260..346f8e1 100644
--- a/markdown/__version__.py
+++ b/markdown/__version__.py
@@ -5,7 +5,7 @@
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
-version_info = (2, 6, 8, 'final', 0)
+version_info = (2, 6, 9, 'final', 0)
def _get_version():
diff --git a/markdown/blockprocessors.py b/markdown/blockprocessors.py
index a3ed977..79c7f2e 100644
--- a/markdown/blockprocessors.py
+++ b/markdown/blockprocessors.py
@@ -391,7 +391,7 @@ class OListProcessor(BlockProcessor):
# Check first item for the start index
if not items and self.TAG == 'ol':
# Detect the integer value of first list item
- INTEGER_RE = re.compile('(\d+)')
+ INTEGER_RE = re.compile(r'(\d+)')
self.STARTSWITH = INTEGER_RE.match(m.group(1)).group()
# Append to the list
items.append(m.group(3))
diff --git a/markdown/extensions/admonition.py b/markdown/extensions/admonition.py
index 76e0fb5..0c5ce46 100644
--- a/markdown/extensions/admonition.py
+++ b/markdown/extensions/admonition.py
@@ -41,7 +41,7 @@ class AdmonitionProcessor(BlockProcessor):
CLASSNAME = 'admonition'
CLASSNAME_TITLE = 'admonition-title'
- RE = re.compile(r'(?:^|\n)!!!\ ?([\w\-]+)(?:\ "(.*?)")?')
+ RE = re.compile(r'(?:^|\n)!!! ?([\w\-]+)(?: +"(.*?)")? *(?:\n|$)')
def test(self, parent, block):
sibling = self.lastChild(parent)
@@ -55,7 +55,7 @@ class AdmonitionProcessor(BlockProcessor):
m = self.RE.search(block)
if m:
- block = block[m.end() + 1:] # removes the first line
+ block = block[m.end():] # removes the first line
block, theRest = self.detab(block)
diff --git a/markdown/extensions/tables.py b/markdown/extensions/tables.py
index ebe6ffa..ec3b6ac 100644
--- a/markdown/extensions/tables.py
+++ b/markdown/extensions/tables.py
@@ -21,6 +21,9 @@ from . import Extension
from ..blockprocessors import BlockProcessor
from ..util import etree
import re
+PIPE_NONE = 0
+PIPE_LEFT = 1
+PIPE_RIGHT = 2
class TableProcessor(BlockProcessor):
@@ -41,17 +44,33 @@ class TableProcessor(BlockProcessor):
Keep border check and separator row do avoid repeating the work.
"""
is_table = False
- header = [row.strip() for row in block.split('\n')[0:2]]
- if len(header) == 2:
- self.border = header[0].startswith('|')
- row = self._split_row(header[0])
- is_table = len(row) > 1
+ rows = [row.strip() for row in block.split('\n')]
+ if len(rows) > 1:
+ header0 = rows[0]
+ self.border = PIPE_NONE
+ if header0.startswith('|'):
+ self.border |= PIPE_LEFT
+ if self.RE_END_BORDER.search(header0) is not None:
+ self.border |= PIPE_RIGHT
+ row = self._split_row(header0)
+ row0_len = len(row)
+ is_table = row0_len > 1
+
+ # Each row in a single column table needs at least one pipe.
+ if not is_table and row0_len == 1 and self.border:
+ for index in range(1, len(rows)):
+ is_table = rows[index].startswith('|')
+ if not is_table:
+ is_table = self.RE_END_BORDER.search(rows[index]) is not None
+ if not is_table:
+ break
if is_table:
- row = self._split_row(header[1])
- is_table = len(row) > 1 and set(''.join(row)) <= set('|:- ')
+ row = self._split_row(rows[1])
+ is_table = (len(row) == row0_len) and set(''.join(row)) <= set('|:- ')
if is_table:
self.separator = row
+
return is_table
def run(self, parent, blocks):
@@ -78,8 +97,20 @@ class TableProcessor(BlockProcessor):
thead = etree.SubElement(table, 'thead')
self._build_row(header, thead, align)
tbody = etree.SubElement(table, 'tbody')
- for row in rows:
- self._build_row(row.strip(), tbody, align)
+ if len(rows) == 0:
+ # Handle empty table
+ self._build_empty_row(tbody, align)
+ else:
+ for row in rows:
+ self._build_row(row.strip(), tbody, align)
+
+ def _build_empty_row(self, parent, align):
+ """Build an empty row."""
+ tr = etree.SubElement(parent, 'tr')
+ count = len(align)
+ while count:
+ etree.SubElement(tr, 'td')
+ count -= 1
def _build_row(self, row, parent, align):
""" Given a row of text, build table cells. """
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py
index 37c9afa..f9d0610 100644
--- a/markdown/inlinepatterns.py
+++ b/markdown/inlinepatterns.py
@@ -140,7 +140,7 @@ REFERENCE_RE = NOIMG + BRK + r'\s?\[([^\]]*)\]'
SHORT_REF_RE = NOIMG + r'\[([^\]]+)\]'
# ![alt text][2]
-IMAGE_REFERENCE_RE = r'\!' + BRK + '\s?\[([^\]]*)\]'
+IMAGE_REFERENCE_RE = r'\!' + BRK + r'\s?\[([^\]]*)\]'
# stand-alone * or _
NOT_STRONG_RE = r'((^| )(\*|_)( |$))'
@@ -170,7 +170,7 @@ def dequote(string):
return string
-ATTR_RE = re.compile("\{@([^\}]*)=([^\}]*)}") # {@id=123}
+ATTR_RE = re.compile(r"\{@([^\}]*)=([^\}]*)}") # {@id=123}
def handleAttributes(text, parent):
@@ -351,7 +351,7 @@ class HtmlPattern(Pattern):
try:
return self.markdown.serializer(value)
except:
- return '\%s' % value
+ return r'\%s' % value
return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text)
@@ -458,7 +458,7 @@ class ReferencePattern(LinkPattern):
except IndexError:
id = None
if not id:
- # if we got something like "[Google][]" or "[Goggle]"
+ # if we got something like "[Google][]" or "[Google]"
# we'll use "google" as the id
id = m.group(2).lower()
diff --git a/markdown/postprocessors.py b/markdown/postprocessors.py
index 8b311b2..7b9aa0b 100644
--- a/markdown/postprocessors.py
+++ b/markdown/postprocessors.py
@@ -102,7 +102,7 @@ class AndSubstitutePostprocessor(Postprocessor):
class UnescapePostprocessor(Postprocessor):
""" Restore escaped chars """
- RE = re.compile('%s(\d+)%s' % (util.STX, util.ETX))
+ RE = re.compile(r'%s(\d+)%s' % (util.STX, util.ETX))
def unescape(self, m):
return util.int2str(int(m.group(1)))
diff --git a/setup.py b/setup.py
index 0699512..e4b68f9 100755
--- a/setup.py
+++ b/setup.py
@@ -230,7 +230,7 @@ You may ask for help and discuss various other issues on the
`mailing list`_ and report bugs on the `bug tracker`_.
.. _`mailing list`: http://lists.sourceforge.net/lists/listinfo/python-markdown-discuss
-.. _`bug tracker`: http://github.com/waylan/Python-Markdown/issues
+.. _`bug tracker`: http://github.com/Python-Markdown/markdown/issues
'''
setup(
@@ -241,9 +241,9 @@ setup(
description='Python implementation of Markdown.',
long_description=long_description,
author='Manfred Stienstra, Yuri takhteyev and Waylan limberg',
- author_email='waylan.limberg [at] icloud.com',
+ author_email='waylan.limberg at icloud.com',
maintainer='Waylan Limberg',
- maintainer_email='waylan.limberg [at] icloud.com',
+ maintainer_email='waylan.limberg at icloud.com',
license='BSD License',
packages=['markdown', 'markdown.extensions'],
scripts=['bin/%s' % SCRIPT_NAME],
diff --git a/tests/extensions/admonition.html b/tests/extensions/admonition.html
index c900757..511d71a 100644
--- a/tests/extensions/admonition.html
+++ b/tests/extensions/admonition.html
@@ -28,4 +28,12 @@
</div>
<div class="admonition tip">
<p>An explicitly empty string prevents the title from being rendered.</p>
+</div>
+<p>No body:</p>
+<div class="admonition note">
+<p class="admonition-title">Note</p>
+</div>
+<p>Extra whitespace after the title should not alter output:</p>
+<div class="admonition note">
+<p class="admonition-title">Note</p>
</div>
\ No newline at end of file
diff --git a/tests/extensions/admonition.txt b/tests/extensions/admonition.txt
index d24336b..ab8434c 100644
--- a/tests/extensions/admonition.txt
+++ b/tests/extensions/admonition.txt
@@ -27,3 +27,11 @@ Not part of an Admonition!
!!! tip ""
An explicitly empty string prevents the title from being rendered.
+
+No body:
+
+!!! note
+
+Extra whitespace after the title should not alter output:
+
+!!! note
diff --git a/tests/extensions/extra/tables.html b/tests/extensions/extra/tables.html
index 2418c98..25dee48 100644
--- a/tests/extensions/extra/tables.html
+++ b/tests/extensions/extra/tables.html
@@ -167,7 +167,12 @@ Content Cell | Content Cell
<th>Second Header</th>
</tr>
</thead>
-<tbody></tbody>
+<tbody>
+<tr>
+<td></td>
+<td></td>
+</tr>
+</tbody>
</table>
<p>More inline code block tests</p>
<table>
@@ -375,4 +380,87 @@ Content Cell | Content Cell
<td>\\<code>code</code></td>
</tr>
</tbody>
-</table>
\ No newline at end of file
+</table>
+<p>Single column tables</p>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td></td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td></td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td></td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>row</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>row</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>row</td>
+</tr>
+</tbody>
+</table>
+<h2>| Is not a Table</h2>
+<p>| row</p>
+<h2>Is not a Table |</h2>
+<p>row |</p>
+<p>| Is not a Table
+| --------------
+row</p>
+<p>Is not a Table |
+-------------- |
+row</p>
\ No newline at end of file
diff --git a/tests/extensions/extra/tables.txt b/tests/extensions/extra/tables.txt
index d766224..2dc4967 100644
--- a/tests/extensions/extra/tables.txt
+++ b/tests/extensions/extra/tables.txt
@@ -128,3 +128,42 @@ Should not be code | Should be code
------------------ | --------------
\`Not code\` | \\`code`
\\\`Not code\\\` | \\\\`code`
+
+Single column tables
+
+| Is a Table |
+| ---------- |
+
+| Is a Table
+| ----------
+
+Is a Table |
+---------- |
+
+| Is a Table |
+| ---------- |
+| row |
+
+| Is a Table
+| ----------
+| row
+
+Is a Table |
+---------- |
+row |
+
+| Is not a Table
+--------------
+| row
+
+Is not a Table |
+--------------
+row |
+
+| Is not a Table
+| --------------
+row
+
+Is not a Table |
+-------------- |
+row
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index a43de79..490d55b 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -932,3 +932,27 @@ Must not be confused with 'ndash' (--) ... >>
is the ‚mdash‘: \u2014
Must not be confused with ‚ndash‘ (\u2013) \u2026 ]</p>"""
self.assertEqual(self.md.convert(text), correct)
+
+
+class TestFootnotes(unittest.TestCase):
+ """ Test Footnotes extension. """
+
+ def testBacklinkText(self):
+ md = markdown.Markdown(
+ extensions=['markdown.extensions.footnotes'],
+ extension_configs={'markdown.extensions.footnotes': {'BACKLINK_TEXT': 'back'}}
+ )
+ text = 'paragraph[^1]\n\n[^1]: A Footnote'
+ self.assertEqual(
+ md.convert(text),
+ '<p>paragraph<sup id="fnref:1"><a class="footnote-ref" href="#fn:1" rel="footnote">1</a></sup></p>\n'
+ '<div class="footnote">\n'
+ '<hr />\n'
+ '<ol>\n'
+ '<li id="fn:1">\n'
+ '<p>A Footnote <a class="footnote-backref" href="#fnref:1" rev="footnote"'
+ ' title="Jump back to footnote 1 in the text">back</a></p>\n'
+ '</li>\n'
+ '</ol>\n'
+ '</div>'
+ )
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-markdown.git
More information about the Python-modules-commits
mailing list