View Full Version : span in span: is this problematic?


tbuyus
03-18-2013, 11:28 AM
Hello Forum,

This is my first post and I hope it is okay.

I have a technical issue with an epub that I am trying to edit.

I have taken a public domain epub from project gutenberg and run one of the main html (item_002.html) files through some software I have written (that adds accents to the letters. The accents are part of a code I have created that indicates what sound each letter in a word makes).

I have then regenerated the file containing the html containing the new text. In my scheme this results in some of the silent letters needing to be surrounded with font tags (see below), to make them grey.

<p style="font-size:0.91em; line-height:normal; margin-bottom:0pt; text-indent:8pt">
<span style="font-family:Times, serif"><span>Krmŕ lnd back. "Y can s τħ siťţn. H<font color="gray">w</font> can w dl wiτħ a </span></span></p><p style="font-size:0.91em; line-height:normal; margin-bottom:0pt; text-indent:8pt"><span style="font-family:Times, serif"><span>factŕ lk τħis? Τħ pŕfect vrbl." </span></span></p><p style="font-size:0.91em; line-height:normal; margin-bottom:0pt; text-indent:8pt"><span style="font-family:'Courier New', monospace">&nbsp;</span></p>

In the above example I have highlighted the mark-up surrounding the 'w' in the word 'how'. The software has made 2 changes to the original file.

1) it has placed each phrase in its own span - and added the accents
2) it has greyed the w in 'how' - (the o has been accented to indicate that it carries the 'ow' sound. This makes the 'w' redundant and hence why I want it in grey - signifying it is not to be pronounced)

However, when I replace the original file with the new one, re-zip into the epub, and then open it in ADE it does not display this modified section of the book.

Does anyone have any ideas what might be causing this?

Thanks very much for any help

Tob.

dgatwood
03-19-2013, 12:23 AM
When you say that it isn't displaying the section, do you mean that the entire HTML file doesn't show up, that a paragraph is missing, that the contents of the span is missing, or something else entirely?

BTW, you shouldn't use the font tag. It isn't a supported tag in EPUB, and ADE has this tendency to explode in flames when it sees things it doesn't recognize. :D Use <span style="color: gray;">...</span> instead.

tbuyus
03-19-2013, 09:24 AM
When you say that it isn't displaying the section, do you mean that the entire HTML file doesn't show up, that a paragraph is missing, that the contents of the span is missing, or something else entirely?

BTW, you shouldn't use the font tag. It isn't a supported tag in EPUB, and ADE has this tendency to explode in flames when it sees things it doesn't recognize. :D Use <span style="color: gray;">...</span> instead.

Thanks D.

I've done the graying as you suggest, but found the main problem was that my html transformation algorithms were missing trailing '/s' in the meta tags

<meta blah blah blah />

and the links tag
<link style..... />

So nearly done now, just having a few unicode character coverage issues that I need to address. Look at the output I'm getting from ADE in the attachment.

My initial searches on this suggest I may need to embedd a font. I remember using a SIL something-or-other once when using unicode.

JSWolf
03-28-2013, 10:39 AM
The best (and most reliable and easiest to edit) way to do is is to not use styles in the XML but to use classes. Put the code in the CSS and use a class.

dgatwood
03-30-2013, 12:48 AM
The best (and most reliable and easiest to edit) way to do is is to not use styles in the XML but to use classes. Put the code in the CSS and use a class.

Well, yes, if you want to do it cleanly. Most of us would settle for "not likely to break". :D

mrmikel
03-30-2013, 06:19 AM
Be aware that you need to check in a device or viewer for device as regards embedded fonts. In the past, Sigil has not shown embedded fonts but this may be changed because of the upgraded underlying software.

Toxaris
03-30-2013, 09:15 AM
That bug has been squashed. It was in the Qt4 framework and Sigil now uses version 5.

JSWolf
03-30-2013, 09:09 PM
Well, yes, if you want to do it cleanly. Most of us would settle for "not likely to break". :D

Cleanly is most likely not to break. And if it does get broken, cleanly is a lot easier to fix.

mrmikel
03-31-2013, 08:01 AM
That bug has been squashed. It was in the Qt4 framework and Sigil now uses version 5.

Hooray! It also got rid of the unwanted highlighting bug too!