Add 1-many css + Fix bug 4635

This commit is contained in:
Kiryl
2021-09-28 13:37:37 +03:00
parent 955a64380c
commit ebb5f0802e
8 changed files with 101 additions and 82 deletions

View File

@@ -2,7 +2,7 @@ import re
from typing import Union
from ebooklib.epub import Section, Link
from livecarta_config import LawCartaConfig
from livecarta_config import LiveCartaConfig
"""
These are data structures which form mapping from NCX to python data structures.
@@ -64,14 +64,14 @@ class ChapterItem:
for i in self.sub_items:
sub_dicts.append(i.to_dict(lvl + 1))
if lvl > LawCartaConfig.SUPPORTED_LEVELS:
if lvl > LiveCartaConfig.SUPPORTED_LEVELS:
return {
"title": self.title,
"contents": [self.content] + [x['contents'] for x in sub_dicts],
"sub_items": []
}
if (lvl == LawCartaConfig.SUPPORTED_LEVELS) and sub_dicts:
if (lvl == LiveCartaConfig.SUPPORTED_LEVELS) and sub_dicts:
return {
"title": self.title,
"contents": [self.content] + flatten([x['contents'] for x in sub_dicts]),