08-17-2012, 08:07 PM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
|
Problem: Sigil Auto-adding Attributes to <p>'s
I accidentally added a class to a <p> (e.g. <p class="xyz">) tag instead of inserting <span class="xyz"> after the <p>. I have a pretty large document in which all instances of this were replaced as such.
This seems easy enough to fix with Sigil's find and replace function and it actually does work very well. After replacing all instances of <p class="xyz"> with <span class="xyz">, it even adds a closing </span> right before the </p> for the line which is excellent. The problem is that, for some reason, Sigil also decides to add <span class="xyz"> to every instance of <p> when I only asked it to replace <p class="xyz">. It is cool that it closes the tags for me as doing that manually would take forever considering the epub file I am editing has a lot of these instances in them, but is there any way to stop it from adding things onto every <p> when all it needs to do is close the <span class="xyz">? I guess if that isn't possible, is there a way to prevent Sigil from automatically "correcting" and closing tags? After which, I would just manually add each closing </span>. Any help on this matter would be great! |
08-17-2012, 08:09 PM | #2 |
Resident Curmudgeon
Posts: 73,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Try turning off Tidy.
|
Advert | |
|
08-17-2012, 08:23 PM | #3 |
Junior Member
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
|
I tried turning both that and the Well-formed Errors checker off, just in case, though it is still doing the same thing.
I could probably just extract everything from the .epub and use a text editor to avoid all this since I'd be doing it manually if I have to resort to that anyway. I was definitely digging the auto-closing of the tags, though! |
08-18-2012, 03:05 AM | #4 | |
Berti
Posts: 1,196
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
Quote:
To avoid this "auto-correction" you'll have to make the s/r in "current file"- mode with "well-formed" check off. And it would'nt hurt to turn off tidy as well |
|
08-19-2012, 03:33 AM | #5 |
Zealot
Posts: 114
Karma: 5246
Join Date: Jul 2010
Device: none
|
I don't think even turning Tidy off will help in this particular case; you can try is adding the closing </span> when you do the search/replace, with search Mode set to Regex:
Find: <p class="xyz">(.+?)</p> Replace: <p><span class="xyz">\1</span></p> FWIW, turning the well-formed check off, means that Sigil will still perform the well-formed checking and apply whatever fixes without notifying you. So basically that option turns off the notification but not the check itself. |
Advert | |
|
08-19-2012, 05:10 AM | #6 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You should never rely on any program auto inserting code when it has to guess what you mean. That is disaster waiting to happen.
|
08-19-2012, 09:15 AM | #7 |
Wizard
Posts: 1,613
Karma: 6718479
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
|
Sigil is NOT CORRECTING your error (open <span> tag) by closing it for you. What it is doing is assuming the <span> was intended to continue past the end of one <p> and continue in the next all the way to the end of the document. To "fix" things so that they work properly, it closes the <span> at the end of the <p> and re-opens it in the next <p> so that it can continue properly.
|
08-19-2012, 10:50 AM | #8 | |
Well trained by Cats
Posts: 29,799
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Which is not to say the automatic Warning/advice tools are not useful. but to let any tool that has not passed the Turing Test, decide I would love to have Tag/parenthesis matching markers in CV, especially when faced with multiple nested spans |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Auto adding books from sub folders | tonyhehir | Library Management | 4 | 12-27-2013 04:47 PM |
auto-adding RFE | jacktanner | Library Management | 0 | 05-07-2012 12:23 PM |
Is auto-relinking a Sigil feature? | dlw | Sigil | 2 | 06-27-2011 12:43 AM |
auto-generated TOC with Sigil 0.4 | bobcdy | Sigil | 2 | 04-05-2011 12:48 AM |
Auto-adding content? and Thanks.... | ApK | Calibre | 4 | 02-27-2010 09:09 PM |