Quote:
Originally Posted by PeterT
When I tried it in calibre ebook-edit it failed  On the example that has the nested spans, it fails the same as all the other attempts I have tried. I'm going to have to bite the bullet and modify this plugin and try it there.
-----
Retried with
Code:
<span[^<>]*>((?:(?!<(?:span|/span)).)*)</span>
This matches the 1st and 3rd span's I had above
Code:
<span id="kobo.114.1">I don’t go in for ‘lawn maintenance’, though — all that weeding and feeding.</span>
and
<span id="kobo.114.3"> As Vita Sackville-West said, ‘A weed is only a plant in the wrong place.’ To which we should add: ‘or one for which we haven’t yet discovered the use’.</span>
however on the 2nd span
Code:
<span id="kobo.114.2"> I prefer my ‘weeds’: the clover, which keeps the grass naturally green with its nitrogen-fixing nodules; the daisy, opening and closing each day (its name comes from the Old English <em>daeges <span class="ent1">ē</span>age</em>, meaning ‘the day’s eye’); the little blue-purple <em>Prunella</em>, known as ‘self-heal’, used to treat sore throats, mouth <a id="page_184"></a>ulcers and open wounds — and still used in modern herbal medicine as an astringent for external or internal wounds.</span>
just matches the interior span
Code:
<span class="ent1">ē</span>
Again; this testing is just being done within the confines of ebook-edit
|
Well, I didn't expect it to match the outer span, since we specifically excluded those (to prevent span mismatches). But since we delete the inner span, the next pass should pick it up, right?
Then we just keep passing over the book till no results are found.