コード例 #1
0
 def test_render_heading(self):
     renderer = TOCRenderer()
     token = Heading(['### some *text*\n'])
     rendered_heading = renderer.render_heading(token)
     self.assertEqual(renderer._headings[0], (3, 'some text'))
コード例 #2
0
 def test_render_heading(self):
     renderer = TOCRenderer()
     Heading.start('### some *text*\n')
     token = Heading(Heading.read(iter(['foo'])))
     rendered_heading = renderer.render_heading(token)
     self.assertEqual(renderer._headings[0], (3, 'some text'))
コード例 #3
0
 def test_render_heading(self):
     renderer = TOCRenderer()
     Heading.start("### some *text*\n")
     token = Heading.read(SourceLines(["foo"]), expand_spans=True)
     renderer.render_heading(token)
     self.assertEqual(renderer._headings[0], (3, "some text"))