File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 9
9
# import re
10
10
import unittest
11
11
12
+ import lxml .etree
13
+
12
14
import html_unit_test
13
15
from html_unit_test import ns
14
16
@@ -30,7 +32,18 @@ def _process_sections():
30
32
title_xpath , namespaces = ns
31
33
)
32
34
docbook5_title = docbook5_title_list [0 ]
33
- output_text += "* [{}](#{})\n " .format (docbook5_title , id2 )
35
+ count_parent_section_elements = 0
36
+ parent = section
37
+ while parent is not None :
38
+ tag = lxml .etree .QName (parent ).localname
39
+ print (tag )
40
+ if tag == 'section' :
41
+ count_parent_section_elements += 1
42
+ parent = parent .getparent ()
43
+ assert count_parent_section_elements > 0
44
+ output_text += "{}* [{}](#{})\n " .format (
45
+ (" " * (count_parent_section_elements - 1 )),
46
+ docbook5_title , id2 )
34
47
print (output_text )
35
48
return output_text
36
49
You can’t perform that action at this time.
0 commit comments