Quote by
Mister L:
"
I took a file which I recently had to split into 2 books. It's an epub2 file with only a toc.ncx so I generated a toc.html with the title <h1 class="sgc-toc-title">Table of Contents</h1> (Sigil default title). Then I ran the plugin.
Chapter 1 appears in the toc.html as:
Code:
Code:
<div class="sgc-toc-level-1">
<a href="9782820516909-5.xhtml#toc_marker-6">1. Le lion sur la colline</a>
</div>
(in blue, the text that should be copied back into the title attribute)
and in the html file as:
Code:
<h1 id="toc_marker-6">1</h1>
Code:
<h2><span class="Cap">L</span><span class="SmallCap">E LION SUR LA COLLINE</span></h2>
After running the plugin the result I expected was:
Code:
Code:
<h1 id="toc_marker-6" title="1. Le lion sur la colline">1</h1>
<h2><span class="Cap">L</span><span class="SmallCap">E LION SUR LA COLLINE</span></h2>
But instead the result is this:
Code:
Code:
<h1 id="toc_marker-6" title="1">1</h1>
<h2><span class="Cap" title="L">L</span><span class="SmallCap">E LION SUR LA COLLINE</span></h2>
The full title from the toc.html doesn't get copied back; only the first character of the text of each h* tag, and one on each h* tag, even though there is only one toc id (on the h1).
I understand if you don't want to spend any more time on this, but I want to check if there is something I did wrong that I can easily fix. If this is something that needs to be tweaked in the plugin itself, if you can give me a hint about which file to modify in the plugin I will see if I can figure out how to fix it myself starting with what you have made.
Thanks again very much for taking a crack at it, I appreciate it. (I tried to give you some karma for that but it says I must "spread it around".)
Yesterday 07:14 PM"
I think in my original post to you I mentioned that you will not get good results with this plugin if your epub is using fake titlecase or fake smallcaps in your headings. In the code above -- you're using fake titlecase. You're using a span class to capitalize the first letter and then using another span class to make all text after lower case or smallcaps1. Too many span tags in the heading, that's the reason why I can't fix or resolve that formatting problem with my plugin.
If you want to run the plugin without problems then, for each chapter heading in the epub, just remove all that crappy span code between the h1 tags and just type in the heading text that you want to see. You might be able to do that more quickly using Sigil's Search and Replace. If you do that the plugin should run without any problems at all.