diff options
author | Waylan Limberg <waylan@gmail.com> | 2013-02-27 09:10:47 -0500 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2013-02-27 09:10:47 -0500 |
commit | 579288c5eb684dd09d1ef298929a566f40151205 (patch) | |
tree | d10a50f91b8606cd1dea38764168abab92958b0f /markdown/extensions/tables.py | |
parent | b37ab16ba56ac6fe4e64f87521996bad323058f2 (diff) | |
download | markdown-579288c5eb684dd09d1ef298929a566f40151205.tar.gz markdown-579288c5eb684dd09d1ef298929a566f40151205.tar.bz2 markdown-579288c5eb684dd09d1ef298929a566f40151205.zip |
Now using universal code for Python 2 & 3.
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.
Diffstat (limited to 'markdown/extensions/tables.py')
-rw-r--r-- | markdown/extensions/tables.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/markdown/extensions/tables.py b/markdown/extensions/tables.py index 1388cb5..3edaccf 100644 --- a/markdown/extensions/tables.py +++ b/markdown/extensions/tables.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +from __future__ import unicode_literals """ Tables Extension for Python-Markdown ==================================== @@ -14,11 +14,13 @@ A simple example: Copyright 2009 - [Waylan Limberg](http://achinghead.com) """ -import markdown -from markdown.util import etree +from __future__ import absolute_import +from . import Extension +from ..blockprocessors import BlockProcessor +from ..util import etree -class TableProcessor(markdown.blockprocessors.BlockProcessor): +class TableProcessor(BlockProcessor): """ Process Tables. """ def test(self, parent, block): @@ -84,7 +86,7 @@ class TableProcessor(markdown.blockprocessors.BlockProcessor): return row.split('|') -class TableExtension(markdown.Extension): +class TableExtension(Extension): """ Add tables to Markdown. """ def extendMarkdown(self, md, md_globals): |