← Back to team overview

calibre-devs team mailing list archive

Re: Mobipocket book at #1772

 

On Tuesday 03 February 2009 20:06:45 Marshall T. Vandegrift wrote:
> 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'.
>

One concern, on line 440 can it happen that a closing tag in MOBI markup has a 
space between '<' and '/'? I've merged it in any case since this should be a 
low probability event. 

> > 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.
>

Yeah, now that I actually think about it, I agree. 

Kovid.

-- 
_____________________________________

Kovid Goyal  MC 452-48
California Institute of Technology
1200 E California Blvd
Pasadena, CA 91125

cell  : +01 626 390 8699
office: +01 626 395 6595 (449 Lauritsen)
email : kovid@xxxxxxxxxxxxxxxxxx
web   : http://www.kovidgoyal.net
_____________________________________




Follow ups

References