class_docstr: These are specific test that I found were broken in
  Python-markdown (markdown.py).
class_docstr_tok: ["These","are","specific","test","that","I","found","were","broken","in","Python-markdown","(","markdown.py",")","."]
docstr: Tests that the toc is the same every time it's run on HTML, even if the Markdown object isn't disposed of.
docstr_tok: ["Tests","that","the","toc","is","the","same","every","time","it","'s","run","on","HTML",",","even","if","the","Markdown","object","is","n't","disposed","of","."]
code: def test_toc_with_persistent_object(self):
      """
      Tests that the toc is the same every time it's run on HTML, even if the Markdown object isn't disposed of.
      """
      md = markdown2.Markdown(extras=["toc"])
      html = """
  # Header 1
  ## Header 1.1
  ## Header 1.2
  ### Header 1.3
  # Header 2
  ## Header 2.1
          """
      expected_toc_html = """<ul>
    <li><a href="#header-1">Header 1</a>
    <ul>
      <li><a href="#header-11">Header 1.1</a></li>
      <li><a href="#header-12">Header 1.2</a>
      <ul>
        <li><a href="#header-13">Header 1.3</a></li>
      </ul></li>
    </ul></li>
    <li><a href="#header-2">Header 2</a>
    <ul>
      <li><a href="#header-21">Header 2.1</a></li>
    </ul></li>
  </ul>
  """
      self.assertEqual(expected_toc_html, md.convert(html).toc_html)
      # Do it again, to check if the toc_html is just appended rather than replaced
      self.assertEqual(expected_toc_html, md.convert(html).toc_html)
      # Create different html, and confirm toc_html is replaced
      html = """
  # I'm new html
  ## I don't have to be long, just different
  """
      expected_toc_html = """<ul>
    <li><a href="#im-new-html">I'm new html</a>
    <ul>
      <li><a href="#i-dont-have-to-be-long-just-different">I don't have to be long, just different</a></li>
    </ul></li>
  </ul>
  """
      self.assertEqual(expected_toc_html, md.convert(html).toc_html)
  
imports: import os
  import sys
  from os.path import join, dirname, abspath, exists, splitext, basename
  import re
  from glob import glob
  import unittest
  import codecs
  import difflib
  import doctest
  from json import loads
label_desc: Use image node_id 6 for calling the DirectTestCase obj's underlying member method code with example usage: obj.test_toc_with_persistent_object() without return types