forked from LiveCarta/BookConverter
Add 1-many css + Fix bug 4635
This commit is contained in:
@@ -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]),
|
||||
|
||||
Reference in New Issue
Block a user