View Single Post
Old 04-01-2019, 08:45 AM   #86
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by Gorcsev View Post
Thank you i was made lots of trials until now. What I realized:
this method above is ok, until the text do not have any direct formatting tag inside the sentence. for example: <i>, or <b> or even a <br/> what is newline, and so on. Somehow the procedure is handling those tags separated, and puts spans around them.

I think this is a "calibre" behavior. It makes class from any single <i>... tags a <i span class="calibrexx"... and that generates the above mentioned code

Do you know any bypass code for that to insert into the kte somewhere?

For example change the <i> to a @lti@gt , process the "spanning" and change back to the original.

So the sentence would be kept, and not split with spans.

the best would be bypass any "calibre-ish" convert, just let the epub as it is, and send it to the device "kepub-ized"...

thank you
The decision to create koboSpans for <i>, <span>, <br/> etc is Kobo's. It's nothing to do with calibre. If you look at a purchased kepub from the Kobo bookstore you will see that a koboSpan is only ever wrapped around plain text, it never contains other tags.

The KTE plugin honours that decision and so does the one-line hack I posted. All the hack does is reliably reduce the number of koboSpans to one-per-node, rather than one-per-sentence. Inline tags such as <i>, <span>, <br/> etc are all nodes therefore a koboSpan is created.

It sounds like you'd prefer to change the koboSpan algorithm to one-per-paragraph. If so you'll need to figure out how to do that yourself. I doubt that it's a simple hack, given the variety of weird HTML markup that exists in the wild. On the other hand, developing something that works well enough with your own epubs is always easier than developing something that would also work well for everyone else.

Good luck!
jackie_w is offline   Reply With Quote