diff options
-rwxr-xr-x | epy.py | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -356,7 +356,6 @@ class Settings: SeamlessBetweenChapters: bool = False PreferredTTSEngine: Optional[str] = None TTSEngineArgs: List[str] = field(default_factory=list) - ParaIndent: int = 0 @dataclass(frozen=True) @@ -1095,7 +1094,7 @@ class HTMLtoLines(HTMLParser): groups[row] = [block] return groups - def __init__(self, sects={""}, paraindent=0): + def __init__(self, sects={""}): HTMLParser.__init__(self) self.text = [""] self.ishead = False @@ -1113,7 +1112,6 @@ class HTMLtoLines(HTMLParser): self.italic_marks: List[TextMark] = [] self.bold_marks: List[TextMark] = [] self.imgs: Dict[int, str] = dict() - self.paraindent: int = paraindent def handle_starttag(self, tag, attrs): if re.match("h[1-6]", tag) is not None: @@ -1295,8 +1293,7 @@ class HTMLtoLines(HTMLParser): ] text += [""] else: - text += textwrap.wrap(line, textwidth, initial_indent=' '*self.paraindent) - text += [""] * (self.paraindent == 0) + text += textwrap.wrap(line, textwidth) + [""] endline = len(text) # -1 @@ -1886,7 +1883,6 @@ def parse_html( textwidth: Optional[int] = None, section_ids: Optional[Set[str]] = None, starting_line: int = 0, - paraindent: int = 0 ) -> Union[Tuple[str, ...], TextStructure]: """ Parse html string into TextStructure @@ -1900,7 +1896,7 @@ def parse_html( if not section_ids: section_ids = set() - parser = HTMLtoLines(section_ids, paraindent) + parser = HTMLtoLines(section_ids) # try: parser.feed(html_src) parser.close() @@ -3083,7 +3079,6 @@ class Reader: content, textwidth=reading_state.textwidth, section_ids=set(toc_entry.section for toc_entry in toc_entries), # type: ignore - paraindent=self.setting.ParaIndent ) return text_structure, toc_entries, contents |