From e913a5f49a028ff7f6e2fffacb4b1b48374ef438 Mon Sep 17 00:00:00 2001 From: shirshasa Date: Mon, 28 Sep 2020 15:28:55 +0300 Subject: [PATCH] fix heading in json 2.0 --- src/json_converter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/json_converter.py b/src/json_converter.py index 51d505a..2d19210 100644 --- a/src/json_converter.py +++ b/src/json_converter.py @@ -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}',