diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2019-11-26 13:53:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-26 13:53:40 -0500 |
commit | 66517465786b90ccb7fcffeef7996b593374d889 (patch) | |
tree | 2a2c09d632e230ef5654d772121297e81fc84a9a /tests/test_syntax/extensions/test_toc.py | |
parent | 1f3ec538a2acf25607253fc7c7a992950463931d (diff) | |
download | python-markdown-66517465786b90ccb7fcffeef7996b593374d889.tar.gz |
Add permalink_title option (#886)
Addes a new `permalink_title` option to the TOC extension, which allows the title attribute of a permalink to be set to something other than the default English string "Permanent link".
Fixes #781.
Diffstat (limited to 'tests/test_syntax/extensions/test_toc.py')
-rw-r--r-- | tests/test_syntax/extensions/test_toc.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_syntax/extensions/test_toc.py b/tests/test_syntax/extensions/test_toc.py index 65fc0c2..5b9ad92 100644 --- a/tests/test_syntax/extensions/test_toc.py +++ b/tests/test_syntax/extensions/test_toc.py @@ -99,3 +99,23 @@ class TestTOC(TestCase): '</h1>', # noqa extensions=[TocExtension(permalink=True, permalink_class="custom1 custom2")] ) + + def testPermalinkWithCustomTitle(self): + self.assertMarkdownRenders( + '# Header', + '<h1 id="header">' # noqa + 'Header' # noqa + '<a class="headerlink" href="#header" title="custom">¶</a>' # noqa + '</h1>', # noqa + extensions=[TocExtension(permalink=True, permalink_title="custom")] + ) + + def testPermalinkWithEmptyTitle(self): + self.assertMarkdownRenders( + '# Header', + '<h1 id="header">' # noqa + 'Header' # noqa + '<a class="headerlink" href="#header">¶</a>' # noqa + '</h1>', # noqa + extensions=[TocExtension(permalink=True, permalink_title="")] + ) |