← Back to team overview

calibre-devs team mailing list archive

Re: Mobipocket book at #1772

 

On Tue, Feb 3, 2009 at 9:40 PM, Kovid Goyal <kovid@xxxxxxxxxxxxxx> wrote:

> Wouldn't it be better to only try to add @id if the parent tag is an
> <a> tag?  Otherwise for anchors inside large blocks of text the
> position of the anchor would become significantly inaccurate.

I actually think that it's better to hang the anchors off of existing
mark-up whenever possible -- reduces unnecessary non-semantic tags.  Er,
as far as that matters for Mobipocket.  Checking if within an <a/>
element might also be difficult to do accurately, what with Mobipocket
not requiring that markup be valid XML (or valid anything else for that
matter).

I just double checked, and in my corpus of 34 files -- which is kind of
small, I admit -- all links pointed at a start-tag.  I'm satisfied in
that case with turning all other link-targets into stand-alone anchors.
New revision doing so (and checking to see if within an *end*-tag)
pushed to 'staging'.

> Since we're performing major surgery on mobi.reader anyway, how hard
> would it be to get it to split the output into multiple HTML files at
> page breaks. That was the calibre ebook-viewer will respect page
> breaks n MOBI markup, and conversion of MOBI to EPUB should be
> significantly sped up.

That would be a lot of duplication of logic...  All the link re-writing,
structure duplication, etc.  More like open-heart surgery than this
trivial appendectomy stuff :-).

I'd rather wait until we've agreed on a concrete plan for modularizing
so that can potentially just use a reusable 'split on page breaks'
transform.

-Marshall



Follow ups

References