diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-02-08 20:32:40 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-02-08 20:32:40 +0000 |
| commit | 54827b4def89b5c0135fd90507665c76ae2a2efd (patch) | |
| tree | b8048b24dc740a2d012a21de8885f2d58ec5c9eb /tests | |
| parent | 7aa2d2ba54ab0c2d908a4b0fbe683bce63a54f45 (diff) | |
Write anchor for ID before starting hyperlink in markdown writer
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/writers/markdown_tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/writers/markdown_tests.py b/tests/writers/markdown_tests.py index 79ddb6d..82131b4 100644 --- a/tests/writers/markdown_tests.py +++ b/tests/writers/markdown_tests.py @@ -101,6 +101,15 @@ def elements_with_ids_have_anchor_tags_with_ids_appended_to_start_of_markdown_el writer.text("Hello") writer.end("h1") assert_equal('# <a id="start"></a>Hello\n\n', writer.as_string()) + + +@istest +def links_have_anchors_before_opening_square_bracket(): + writer = _create_writer() + writer.start("a", {"href": "http://example.com", "id": "start"}) + writer.text("Hello") + writer.end("a") + assert_equal('<a id="start"></a>[Hello](http://example.com)', writer.as_string()) def _create_writer(): |
