Still want to highlight text in an epub.
I thought of ignoring html parsing as my replacement is not about html structure. I just want to find a text in the html and replace it with span and /span enclosed. Simple python string replace would do it:
https://www.tutorialspoint.com/pytho...ng_replace.htm
The html file iterator is the following in the testme3 plugin:
# all xhtml/html files
print("\nExercising: bk.text_iter()")
for (id, href) in bk.text_iter():
print(id, href)
lastid = id
I get a href for the html files in the ebook.
with open(href, 'r') as myfile:
data=myfile.read()
leads to error message
FileNotFoundError: [Errno 2] No such file or directory: 'Text/9781118087220cover.xhtml'
How can I create a valid filename from href?