aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xepy.py14
-rw-r--r--setup.py2
2 files changed, 8 insertions, 8 deletions
diff --git a/epy.py b/epy.py
index 6c5b79c..e159ba7 100755
--- a/epy.py
+++ b/epy.py
@@ -14,7 +14,7 @@ Options:
"""
-__version__ = "2021.4.1"
+__version__ = "2021.4.5"
__license__ = "GPL-3.0"
__author__ = "Benawi Adha"
__email__ = "benawiadha@gmail.com"
@@ -456,17 +456,17 @@ class HTMLtoLines(HTMLParser):
if i[0].endswith("href"):
self.text.append("[IMG:{}]".format(len(self.imgs)))
self.imgs.append(unquote(i[1]))
+ # formatting
+ elif tag in self.ital:
+ self.initital.append([len(self.text)-1, len(self.text[-1])])
+ elif tag in self.bold:
+ self.initbold.append([len(self.text)-1, len(self.text[-1])])
if self.sects != {""}:
for i in attrs:
if i[0] == "id" and i[1] in self.sects:
# self.text[-1] += " (#" + i[1] + ") "
# self.sectsindex.append([len(self.text), i[1]])
self.sectsindex[len(self.text)-1] = i[1]
- # formatting
- if tag in self.ital:
- self.initital.append([len(self.text)-1, len(self.text[-1])])
- elif tag in self.bold:
- self.initbold.append([len(self.text)-1, len(self.text[-1])])
def handle_startendtag(self, tag, attrs):
if tag == "br":
@@ -512,7 +512,7 @@ class HTMLtoLines(HTMLParser):
elif tag == "image":
self.text.append("")
# formatting
- if tag in self.ital:
+ elif tag in self.ital:
self.initital[-1] += [len(self.text)-1, len(self.text[-1])]
elif tag in self.bold:
self.initbold[-1] += [len(self.text)-1, len(self.text[-1])]
diff --git a/setup.py b/setup.py
index 0fd8e8e..6bf6fa7 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ if sys.platform == "win32":
setup(
name="epy-reader",
- version="2021.4.1",
+ version="2021.4.5",
description="Terminal/CLI Ebook (epub, fb2, mobi, azw3) Reader",
long_description=long_description,
long_description_content_type="text/markdown",