fix heading in json 2.0

This commit is contained in:
shirshasa
2020-09-28 15:28:55 +03:00
parent 95ceb1e089
commit e913a5f49a

View File

@@ -37,7 +37,10 @@ class JSONConverter:
:param ind: Index of header in content list.
"""
if self.content[ind].name in LawCartaConfig.SUPPORTED_HEADERS:
title = self.content[ind]
title = ''
for child in self.content[ind].find_all(recursive=False):
title += str(child)
curr_outline = int(re.sub(r"^h", "", self.content[ind].name)) # extract outline from tag
result = {
'title': f'{title}',