08-03-2018, 09:25 AM | #1 |
Zealot
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
|
Suppressing tags pair
Is there a way after selecting an "opening" tag to delete in a single move that tag and it's corresponding closing tag. In this example, selecting the <span> tags
Ex: <p><span xxx>abcd<i>efgh</i></span>lmno</p> |
08-03-2018, 10:00 AM | #2 |
Well trained by Cats
Posts: 29,691
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Use the (editor) plugin Diaps editing toolbag. Id has the tools to deal with bulk tag removal or modification
|
Advert | |
|
08-03-2018, 12:29 PM | #3 | |
Zealot
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
|
Quote:
Since already calibre find and highlight the corresponding tags, I'm inquiring if their is a keyboard shortcut or other meaning to delete both tags when one is selected. |
|
08-03-2018, 04:32 PM | #4 |
Well trained by Cats
Posts: 29,691
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Typically, you delete an opening tag, the Beautify , the closing tag will be cleared.
|
08-03-2018, 10:52 PM | #5 |
creator of calibre
Posts: 43,782
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There is no builtin function for this, ut as thedcuks noted, you can simply delete the opening tag and leave the closing, which will get automaticallt removed whenever you next run either beautify or fix html tools.
|
Advert | |
|
08-05-2018, 07:51 AM | #6 |
Zealot
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
|
I didn't know beautify would do this. Thanks both. I was using regex function to delete both tag and that was causing problems when the closing tags selected by the function wasn't the good one. Now I understand I only have to delete all occurrence of the opening tag.
|
08-05-2018, 08:05 AM | #7 | |
Grand Sorcerer
Posts: 6,470
Karma: 84000001
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Quote:
<p>The <span class="bold">beginning <span class="ital">of the</span> end.</span></p> Deleting the second span yields: <p>The <span class="bold">beginning of the</span> end.</span></p> The running beautify results in: <p>The <span class="bold">beginning of the</span> end.</p> But, what was desired is: <p>The <span class="bold">beginning of the end.</span></p>
|
|
08-07-2018, 08:32 AM | #8 |
Zealot
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
|
So it could create the same problem as using a regex function. I'm surprise since the editor do a very good job to find the closing tag even if that last tag is the wrong one resulting of an error in the coding.
A case by case solution would be nice; i.e. right clicking on the opening tag offering a delete tags option. |
08-08-2018, 05:42 AM | #9 |
creator of calibre
Posts: 43,782
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
08-08-2018, 05:34 PM | #10 | |
Zealot
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
|
Quote:
|
|
08-08-2018, 06:12 PM | #11 | |
Grand Sorcerer
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
If you wanted to get access to it sooner you could run calibre from source. |
|
08-09-2018, 06:28 AM | #12 |
Zealot
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
|
Wow. Thanks
|
08-21-2018, 11:08 AM | #13 | |
Guru
Posts: 664
Karma: 2180702
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
|
Quote:
Step by step. Sample code: Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>TEST</title> </head> <body> <p class="sample">sample text</p> <p class="sample">sample text</p> <p class="sample">sample text</p> <p class="sample">sample text</p> <p>Normal text</p> </body> </html> 2. Now press the cursor down quickly (before the p tag is highlighted) and press "Remove tag" again. 3. Repeat. If you do not succeed at once, you will certainly succeed in the third or fourth paragraph. The most common problems: 1. remove the "body" tag 2. removing part of the paragraph |
|
08-21-2018, 12:56 PM | #14 |
creator of calibre
Posts: 43,782
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
So dont do that? Or press undo if you do it accidentally. The tooltip for it explicitly states that it removes highlighted tags, if you run it when no tags are highlighted the results are undefined -- though I suppose I can have it detect that and not do anything instead.
|
08-21-2018, 01:04 PM | #15 |
Guru
Posts: 664
Karma: 2180702
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
|
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Suppressing font-face declarations | roger64 | Editor | 2 | 09-26-2017 05:46 AM |
Calibre2OPDS suppressing OPDS & authors | higlider | Related Tools | 0 | 09-15-2012 09:55 PM |
Why Women Own More Than One Pair of Shoes | morriss003 | Self-Promotions by Authors and Publishers | 0 | 08-13-2012 01:06 PM |
Amazon Tags - Popular tags vs Unique tags. | chrisanthropic | Writers' Corner | 6 | 09-19-2011 11:18 PM |
Unutterably Silly Anyone got a spare pair of Legs ??? | Kevin2960 | Lounge | 20 | 03-27-2010 12:29 PM |