markdown-link-style

switch between inline and footnote link style in markdown documents.
git clone git://git.ricketyspace.net/markdown-link-style.git
Log | Files | Refs

commit 45a601c1c9f922c55b36fb6541764659406cd11b
parent 43534bacd401afede538247148b47e5835e7a2dd
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun,  4 Jun 2017 23:18:11 +0000

Fix line lengths.

* mdl_style.py: Update file.
* setup.py: Update file.
* tests/test_mdl_style.py: Upate file.

Diffstat:
mdl_style.py | 17++++++++++-------
setup.py | 6++++--
tests/test_mdl_style.py | 12++++++++----
3 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/mdl_style.py b/mdl_style.py @@ -34,10 +34,10 @@ logger = MDLSLogger(__name__) # from mistune _inline_tags = [ - 'a', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', 'data', - 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', 'b', 'u', 'mark', - 'ruby', 'rt', 'rp', 'bdi', 'bdo', 'span', 'br', 'wbr', 'ins', 'del', - 'img', 'font', + 'a', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', + 'data', 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', + 'b', 'u', 'mark', 'ruby', 'rt', 'rp', 'bdi', 'bdo', 'span', 'br', + 'wbr', 'ins', 'del', 'img', 'font', ] _valid_end = r'(?!:/|[^\w\s@]*@)\b' _block_tag = r'(?!(?:%s)\b)\w+%s' % ('|'.join(_inline_tags), _valid_end) @@ -191,7 +191,8 @@ class LSMarkdown(Markdown): """Link Style Markdown parser. """ - def __init__(self, renderer=None, inline=None, block=None, **kwargs): + def __init__(self, renderer=None, inline=None, block=None, + **kwargs): link_style = kwargs.get('link_style') or 'inline' if not renderer: @@ -201,7 +202,8 @@ class LSMarkdown(Markdown): if not block: block = LSBlockLexer() - super(LSMarkdown, self).__init__(renderer, inline, block, **kwargs) + super(LSMarkdown, self).__init__(renderer, inline, block, + **kwargs) def parse(self, text): # Reset footnote link variables. @@ -240,7 +242,8 @@ def _mdl_stylize(args): def _get_args(): parser = argparse.ArgumentParser() - parser.add_argument('--version', action='version', version=__version__) + parser.add_argument('--version', action='version', + version=__version__) parser.add_argument('link_style', choices=['inline', 'footnote'], help='Markdown Link style.') parser.add_argument('file', type=argparse.FileType('r'), diff --git a/setup.py b/setup.py @@ -35,7 +35,8 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f: config = { 'name': 'markdown-link-style', 'version': __version__, - 'description': 'Switch between inline and footnote link style in markdown documents.', + 'description': 'Switch between inline and footnote link style ' + + 'in markdown documents.', 'long_description': long_description, 'platforms': 'GNU/Linux', 'url': 'https://git.ricketyspace.net/markdown-link-style', @@ -47,7 +48,8 @@ config = { 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: End Users/Desktop', - 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'License :: OSI Approved :: ' + + 'GNU General Public License v3 or later (GPLv3+)', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3 :: Only', diff --git a/tests/test_mdl_style.py b/tests/test_mdl_style.py @@ -54,7 +54,8 @@ class TestLSRendererIL(object): def test_renderer_parses_images_00(self): d = _get_data('inline_parses_images_00.md') - expected_result = _get_data('inline_parses_images_00-expected.md') + expected_result = _get_data( + 'inline_parses_images_00-expected.md') assert_equal(self.md(d), expected_result) def test_renderer_does_not_parse_link_breaks_00(self): @@ -108,17 +109,20 @@ class TestLSRendererFN(object): def test_link_inline_to_footnote_style_conversion_00(self): d = _get_data('footnote_link_style_00.md') - expected_result = _get_data('footnote_link_style_00-expected.md') + expected_result = _get_data( + 'footnote_link_style_00-expected.md') assert_equal(self.md(d), expected_result) def test_link_inline_to_footnote_style_conversion_01(self): d = _get_data('footnote_link_style_01.md') - expected_result = _get_data('footnote_link_style_01-expected.md') + expected_result = _get_data( + 'footnote_link_style_01-expected.md') assert_equal(self.md(d), expected_result) def test_renderer_parses_images_00(self): d = _get_data('footnote_parses_images_00.md') - expected_result = _get_data('footnote_parses_images_00-expected.md') + expected_result = _get_data( + 'footnote_parses_images_00-expected.md') assert_equal(self.md(d), expected_result) def test_renderer_does_not_parse_link_breaks_00(self):