Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-06-2012, 05:09 AM   #1
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 554
Karma: 2587520
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
Possible to escape characters in CSS tags in Sigil?

google found for me the possibility of using backslash escape character in CSS, but Sigil v 4.2 is throwing "not well-formed document" error. (on XP SP3 if that affects things)

Specifically, I'm using <h3> tags for chapter headings. I want to enter text in titles that will be picked up by the TOC generator. Some have a double-quote, and Calibre reader TOC cannot parse the unicode curly quotes - it displays black boxes. So I want to use straight quote marks.

Here's an example of what I'm trying to do:
Code:
<h3 title="IV. He shouts "NO" loudly" id="ch04">IV</h3>
If I use smart / curly quotes around NO, it is fine.
If I try to use straight quotes (alone or with backslash) I get "whitespace expected" error.

Is there such a thing as an escape character in epub tags, or is that wishful thinking?
GrannyGrump is offline   Reply With Quote
Old 03-06-2012, 06:29 AM   #2
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,866
Karma: 4630359
Join Date: Dec 2010
Device: Kindle PW2
Use the &quot; entity

This should work:
Code:
<h3 id="ch04" title="IV. He shouts &quot;NO&quot; loudly">IV</h3>
Doitsu is offline   Reply With Quote
Old 03-06-2012, 07:12 AM   #3
Rob Lister
Fanatic
Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.
 
Posts: 533
Karma: 3293888
Join Date: Oct 2011
Location: Virginia
Device: Nook Simple Touch
Quote:
Originally Posted by grannyGrumpy View Post
I want to enter text in titles that will be picked up by the TOC generator.
Off topic question: When you say 'picked up', what exactly does the Sigil TOC generator do with the title attribute in a header?
Rob Lister is offline   Reply With Quote
Old 03-06-2012, 08:34 AM   #4
Timur
Connoisseur
Timur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five words
 
Posts: 54
Karma: 37363
Join Date: Aug 2011
Location: Istanbul
Device: EBW1150, Nook STR
You can also type it like this:

Code:
<h3 title='IV. He shouts "NO" loudly' id="ch04">IV</h3>
When saving the file Sigil will convert it to the form given by Doitsu in a previous post.
Timur is offline   Reply With Quote
Old 03-06-2012, 08:51 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,763
Karma: 39536849
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Rob Lister View Post
Off topic question: When you say 'picked up', what exactly does the Sigil TOC generator do with the title attribute in a header?
It uses the title attribute for display purposes in the sigil-generated toc.ncx. There are times when the text contained between the 'h' tags may not be exactly what you want to see in the ncx ToC.
DiapDealer is online now   Reply With Quote
Old 03-07-2012, 08:24 AM   #6
Rob Lister
Fanatic
Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.Rob Lister ought to be getting tired of karma fortunes by now.
 
Posts: 533
Karma: 3293888
Join Date: Oct 2011
Location: Virginia
Device: Nook Simple Touch
Quote:
Originally Posted by DiapDealer View Post
It uses the title attribute for display purposes in the sigil-generated toc.ncx. There are times when the text contained between the 'h' tags may not be exactly what you want to see in the ncx ToC.
That's what I figured but when I first 'figured' it, it didn't make as much sense as your explanation. I can now see that being a bonus. tx
Rob Lister is offline   Reply With Quote
Old 03-13-2012, 05:32 AM   #7
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 554
Karma: 2587520
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
Apologies for very belated thanks!
I knew you guys would have answers for me. I'm using the entity as suggested by Doitsu, working great. Timur, your solution works well for me if quotes are not mixed, but if I have double and single quotes in the text string, can't get it to work out.

Many thanks to all who responded!
GrannyGrump is offline   Reply With Quote
Old 03-13-2012, 06:56 AM   #8
Timur
Connoisseur
Timur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five words
 
Posts: 54
Karma: 37363
Join Date: Aug 2011
Location: Istanbul
Device: EBW1150, Nook STR
Yes, you have to use entity representations, either &quot; or &apos;, if attribute value contains both string delimiter characters.

From Extensible Markup Language (XML) 1.0 (Fifth Edition):
Quote:
To allow attribute values to contain both single and double quotes, the apostrophe or single-quote character (') may be represented as " &apos; ", and the double-quote character (") as " &quot; ".

Last edited by Timur; 03-13-2012 at 07:02 AM.
Timur is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil UI and the CSS Artha Sigil 2 11-22-2011 02:22 PM
help with css tags bobcdy Workshop 13 11-21-2011 12:00 AM
Encoding of special characters in CSS file Bertrand Sigil 4 08-18-2011 06:12 AM
Sigil 0.3.4 / Problème CSS entre Sigil et iPad Grivels Software 10 07-03-2011 09:06 AM
Sigil adds spaces between HTML tags, creating strange characters chezjim Sigil 10 06-10-2011 04:00 AM


All times are GMT -4. The time now is 06:42 PM.


MobileRead.com is a privately owned, operated and funded community.