migration, auth, refactoring, formatting
This commit is contained in:
@@ -379,16 +379,16 @@ class HTML2Text(html.parser.HTMLParser):
|
||||
if start:
|
||||
if (
|
||||
self.current_class == "highlight"
|
||||
and self.inheader == False
|
||||
and self.span_lead == False
|
||||
and self.astack == False
|
||||
and not self.inheader
|
||||
and not self.span_lead
|
||||
and not self.astack
|
||||
):
|
||||
self.o("`") # NOTE: same as <code>
|
||||
self.span_highlight = True
|
||||
elif (
|
||||
self.current_class == "lead"
|
||||
and self.inheader == False
|
||||
and self.span_highlight == False
|
||||
and not self.inheader
|
||||
and not self.span_highlight
|
||||
):
|
||||
# self.o("==") # NOTE: CriticMarkup {==
|
||||
self.span_lead = True
|
||||
|
@@ -4,6 +4,7 @@ import sys
|
||||
from . import HTML2Text, __version__, config
|
||||
|
||||
|
||||
# noinspection DuplicatedCode
|
||||
def main() -> None:
|
||||
baseurl = ""
|
||||
|
||||
|
@@ -68,13 +68,11 @@ def element_style(
|
||||
:rtype: dict
|
||||
"""
|
||||
style = parent_style.copy()
|
||||
if "class" in attrs:
|
||||
assert attrs["class"] is not None
|
||||
if attrs.get("class"):
|
||||
for css_class in attrs["class"].split():
|
||||
css_style = style_def.get("." + css_class, {})
|
||||
style.update(css_style)
|
||||
if "style" in attrs:
|
||||
assert attrs["style"] is not None
|
||||
if attrs.get("style"):
|
||||
immediate_style = dumb_property_dict(attrs["style"])
|
||||
style.update(immediate_style)
|
||||
|
||||
@@ -149,8 +147,7 @@ def list_numbering_start(attrs: Dict[str, Optional[str]]) -> int:
|
||||
|
||||
:rtype: int or None
|
||||
"""
|
||||
if "start" in attrs:
|
||||
assert attrs["start"] is not None
|
||||
if attrs.get("start"):
|
||||
try:
|
||||
return int(attrs["start"]) - 1
|
||||
except ValueError:
|
||||
|
Reference in New Issue
Block a user