![]() |
#1 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,213
Karma: 34984928
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 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? |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,724
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Use the " entity
This should work:
Code:
<h3 id="ch04" title="IV. He shouts "NO" loudly">IV</h3> |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 532
Karma: 3293888
Join Date: Oct 2011
Location: Virginia
Device: Nook Simple Touch
|
|
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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> |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,534
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 532
Karma: 3293888
Join Date: Oct 2011
Location: Virginia
Device: Nook Simple Touch
|
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
|
![]() |
![]() |
![]() |
#7 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,213
Karma: 34984928
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! |
![]() |
![]() |
![]() |
#8 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 37363
Join Date: Aug 2011
Location: Istanbul
Device: EBW1150, Nook STR
|
Yes, you have to use entity representations, either " or ', if attribute value contains both string delimiter characters.
From Extensible Markup Language (XML) 1.0 (Fifth Edition): Quote:
Last edited by Timur; 03-13-2012 at 07:02 AM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |