markdown-textwrap

text wrap markdown documents
git clone git://git.ricketyspace.net/markdown-textwrap.git
Log | Files | Refs

commit cdd32e767b648002aa0ad3f9a563c971d46b9b8f
parent 34093b77787cffda9e84b16d133ee7fc5fcb777b
Author: rsiddharth <s@ricketyspace.net>
Date:   Mon, 26 Feb 2018 00:24:02 +0000

tests: Add TestTWRenderer.test_render_def_link.

* tests/data/renderer-def-links-w.md: New file.
* tests/data/renderer-def-links.md: New file.
* tests/test_md_tw.py (test_render_def_link): New test method.

Diffstat:
tests/data/renderer-def-links-w.md | 34++++++++++++++++++++++++++++++++++
tests/data/renderer-def-links.md | 34++++++++++++++++++++++++++++++++++
tests/test_md_tw.py | 5+++++
3 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/tests/data/renderer-def-links-w.md b/tests/data/renderer-def-links-w.md @@ -0,0 +1,34 @@ +This is [an example](http://example.com/ "Title") inline link. + +[This link](http://example.net/) has no title attribute. + +See my [About](/about/) page for details. + +This is [Bob][bob]'s web space. + +This is [Alice][alice]'s web space. + +[bob]: http://bob.name/ "Bob's home" +[alice]: <http://alice.name/> "Alice's home" + +Some foo[bar]. + +[bar]: http://bar.beer/ "Foo Bar Beer" + +Visit [GNU.org][]. + +[GNU.org]: http://gnu.org + +John Gruber gets 10 times more traffic from [Google][1] than from +[Yahoo][2] or [MSN][3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +John Gruber gets 10 times more traffic from [Google][] than from +[Yahoo][] or [MSN][]. + + [google]: http://google.com/ "Google" + [yahoo]: http://search.yahoo.com/ "Yahoo Search" + [msn]: http://search.msn.com/ "MSN Search" diff --git a/tests/data/renderer-def-links.md b/tests/data/renderer-def-links.md @@ -0,0 +1,34 @@ +This is [an example](http://example.com/ "Title") inline link. + +[This link](http://example.net/) has no title attribute. + +See my [About](/about/) page for details. + +This is [Bob][bob]'s web space. + +This is [Alice][alice]'s web space. + +[bob]: http://bob.name/ "Bob's home" +[alice]: <http://alice.name/> "Alice's home" + +Some foo[bar]. + +[bar]: http://bar.beer/ "Foo Bar Beer" + +Visit [GNU.org][]. + +[GNU.org]: http://gnu.org + +John Gruber gets 10 times more traffic from [Google][1] than from +[Yahoo][2] or [MSN][3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +John Gruber gets 10 times more traffic from [Google][] than from +[Yahoo][] or [MSN][]. + + [google]: http://google.com/ "Google" + [yahoo]: http://search.yahoo.com/ "Yahoo Search" + [msn]: http://search.msn.com/ "MSN Search" diff --git a/tests/test_md_tw.py b/tests/test_md_tw.py @@ -824,6 +824,11 @@ class TestTWRenderer(object): expected_txt = self._get('renderer-hrules-w.md') self._validate(txt, expected_txt) + def test_render_def_link(self): + txt = self._md('renderer-def-links.md') + expected_txt = self._get('renderer-def-links-w.md') + self._validate(txt, expected_txt) + def teardown(self): pass