View Single Post
Old 05-15-2025, 09:57 AM   #1
0x6f677548
Hugo Batista
0x6f677548 began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Jan 2024
Device: kobo clara hd
suggestion - kepubify: optimize spans for compatibility with text-modifying plugins

The kepubify approach adds spans that interact unexpectedly with text modifications made by other plugins, such as the (Intellireading Metaguiding plugin). This causes performance issues on some Kobo devices, particularly affecting users who rely on accessibility features.

Currently, the plugin wraps each phrase in a `<span class="koboSpan">` tag. When used with plugins that modify text structure (e.g., by adding bold tags), this results in a higher number of spans than intended. For example:

Original text:

Code:
Chapter 1
After (Intellireading Metaguiding plugin)
Code:
<b>Chap</b>ter <b>1</b>
After kepubify:
Code:
<b><span class="koboSpan" id="kobo.2.1">Chap</span></b><span class="koboSpan" id="kobo.3.1">ter</span><b><span class="koboSpan" id="kobo.4.1">1</span></b>
I would like to propose the optimization of the span insertion process by:

1. Avoiding inserting spans on text modification tags (italic, bold, underline)
2. Reducing the overall number of spans inserted


An optimized output could look like this:

Code:
<span class="koboSpan" id="kobo.1.1"><b>Chap</b>ter <b>1</b></span>
This approach would maintain the necessary Kobo-specific metadata while preserving text modifications made by other plugins, potentially improving device performance.

Currently, there are no effective workarounds. Users experiencing this issue are facing out-of-memory exceptions and significant slowdowns when loading chapters on their Kobo devices. I am currently testing a device driver approach where epub is converted to kepub before metaguiding, but that seems a bit over-engineering, and it would be great if the base kepubify process could change the way it handles these tags


How useful could this be

This enhancement could be highly useful to a significant number of users, particularly those with dyslexia or other reading difficulties who rely on text-modifying plugins like (Intellireading Metaguiding plugin). It would improve compatibility between accessibility features and device-specific optimizations, enhancing the reading experience for these users while maintaining the benefits of the Kobo TouchDriver.

Additional context

I've reported this issue on the past on the kobotouch extended plugin:
https://github.com/jgoguen/calibre-k...ver/issues/182

let me know your thoughts.
thanks
0x6f677548 is offline   Reply With Quote