![]() |
#1 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
|
Selecting inside tags
Just as double-click on a word selects the whole word, is there some shortcut to select everyting from <tag> to </tag>?
If not, would it be very difficult to implement such a feature? Usage: - select from <i> to </i>, press the italics icon, an get rid of the tag; - select from <span> to </span>, move selection after </span>, and delete <span></span>: no <,>, etc. left behind... Alternatively, a shortcut to select from < to > (i.e., SHIFT + double-click anywhere between) would also be useful. Thanks! |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,448
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Clips and find and replace regex can be used to do all of that now.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
|
Sure: but using them for a single edit seems an overkill--thus a 'smart select'...
|
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,448
Karma: 5703586
Join Date: Nov 2009
Device: many
|
a generic regex to select text between tags is not hard
|
![]() |
![]() |
![]() |
#5 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
|
Something like >([^<]+)< includes also the '>' and '<'... must learn about 'look ahead' and 'look behind' sintaxis.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Diaps Toolbag PI can strip out designated tags , leaving the insides intact
|
![]() |
![]() |
![]() |
#7 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
|
Well: so far, in 'non greedy' mode,
(?<=\>)\b([^<]+)(?=\</) selects between tags, not nested (?<=\>)\b([^<]+)(?=\<) skips tags. Useful when the mouse gets temperamental, and one wishes to manually extract/move some text. ![]() |
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
https://manual.calibre-ebook.com/edi...x-highlighting Ctrl+Alt+T can highlight the innards of the selected tag. For example: Code:
<p>This is a <i>code example</i>.</p> If your cursor is in "This", "This is a <i>code example</i>." is selected. This is my preferred way of mass cleanup. Regex can't handle nested tags very well, so you need something that can actually parse the HTML. Last edited by Tex2002ans; 03-29-2020 at 12:42 AM. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Selecting Tags still shows all files | hovering | Library Management | 1 | 04-19-2019 09:42 PM |
RegEx to replace only inside certain tags? | phossler | Editor | 6 | 03-03-2015 08:24 PM |
is there a way to remove tags from inside an epub structure ? | cybmole | Calibre | 11 | 10-25-2014 09:48 AM |
IMG inside SVG inside TD? | Kasper Hviid | Sigil | 4 | 05-25-2014 06:57 AM |
Regex help needed, selecting single tags out of namy | Sidetrack | Library Management | 5 | 02-26-2012 10:54 PM |