class_docstr: Test TOC Extension. 
class_docstr_tok: ["Test","TOC","Extension","."]
docstr: Test TOC `permalink` with `permalink_leading` option. 
docstr_tok: ["Test","TOC","`","permalink","`","with","`","permalink_leading","`","option","."]
code: def testPermalinkLeading(self):
      """Test TOC `permalink` with `permalink_leading` option."""
      text = "# Hd 1\n\n## Hd 2"
      md = markdown.Markdown(
          extensions=[
              markdown.extensions.toc.TocExtension(
                  permalink=True,
                  permalink_title="PL",
                  permalink_leading=True,
              )
          ]
      )
      self.assertEqual(
          md.convert(text),
          '<h1 id="hd-1">'
          '<a class="headerlink" href="#hd-1" title="PL">'  # noqa
          "&para;"  # noqa
          "</a>"  # noqa
          "Hd 1"  # noqa
          "</h1>\n"
          '<h2 id="hd-2">'
          '<a class="headerlink" href="#hd-2" title="PL">'  # noqa
          "&para;"  # noqa
          "</a>"  # noqa
          "Hd 2"  # noqa
          "</h2>",
      )
  
imports: import unittest
  import markdown
label_desc: Use image node_id 18 for calling the TestTOC obj's underlying member method code with example usage: obj.testPermalinkLeading() without return types