aedocw / epub2tts

Turn an epub or text file into an audiobook
Apache License 2.0
496 stars 45 forks source link

Read url text when not a hyperlink or footnote #70

Closed ghost closed 9 months ago

ghost commented 9 months ago

Some of my books have hyperlinks that have important text as a pointer to the url. For example:

‘’’ There are many features that could lead to new research opportunities in the field. ‘’’

I believe the current skip-links flag would obliterate the contextual text and just read the sentence as “There are many features.”

Is there a way we could skip the reading only if the hyperlink starts with “http” or a number (for footnotes)? The system works well for footnotes and plainjane urls but kills contextual urls.

Thank you for the work on this repo, it is very exciting to have such a quality voice tts for free.

aedocw commented 9 months ago

This is a good suggestion, and just matching "http" at the beginning of the href anchor should be easy to do. I'm on it!

aedocw commented 9 months ago

OK I made a simple change, this has been merged. Default behavior is to skip any link that starts with "http", that is to say you do NOT need to add "--skip-links" for links beginning with http to be skipped.

ghost commented 9 months ago

Groovy, thank you!

aedocw commented 9 months ago

You are very welcome, thanks for the suggestion, I think it's a solid improvement :)