Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 08-03-2018, 09:25 AM   #1
jiembe
Zealot
jiembe began at the beginning.
 
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>
jiembe is offline   Reply With Quote
Old 08-03-2018, 10:00 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
Quote:
Originally Posted by jiembe View Post
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>
Use the (editor) plugin Diaps editing toolbag. Id has the tools to deal with bulk tag removal or modification
theducks is online now   Reply With Quote
Advert
Old 08-03-2018, 12:29 PM   #3
jiembe
Zealot
jiembe began at the beginning.
 
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
Quote:
Originally Posted by theducks View Post
Use the (editor) plugin Diaps editing toolbag. Id has the tools to deal with bulk tag removal or modification
Thank you, but I don't want a bulk editor. I can do that with regex function.

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.
jiembe is offline   Reply With Quote
Old 08-03-2018, 04:32 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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.
theducks is online now   Reply With Quote
Old 08-03-2018, 10:52 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is online now   Reply With Quote
Advert
Old 08-05-2018, 07:51 AM   #6
jiembe
Zealot
jiembe began at the beginning.
 
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
Quote:
Originally Posted by kovidgoyal View Post
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.
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.
jiembe is offline   Reply With Quote
Old 08-05-2018, 08:05 AM   #7
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,470
Karma: 84000001
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by theducks View Post
Typically, you delete an opening tag, the Beautify , the closing tag will be cleared.
That won't work in all cases. Consider the following:

<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>
jhowell is offline   Reply With Quote
Old 08-07-2018, 08:32 AM   #8
jiembe
Zealot
jiembe began at the beginning.
 
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
Quote:
Originally Posted by jhowell View Post
That won't work in all cases. Consider the following:[/INDENT]
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.
jiembe is offline   Reply With Quote
Old 08-08-2018, 05:42 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,782
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...4f5f0154b4a2c2
kovidgoyal is online now   Reply With Quote
Old 08-08-2018, 05:34 PM   #10
jiembe
Zealot
jiembe began at the beginning.
 
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
Quote:
Originally Posted by kovidgoyal View Post
Sorry, I need help here. Am I supposed to edit something? Python and me live actually on 2 different world...
jiembe is offline   Reply With Quote
Old 08-08-2018, 06:12 PM   #11
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by jiembe View Post
Sorry, I need help here. Am I supposed to edit something? Python and me live actually on 2 different world...
No, you just need to wait for the next release of calibre (maybe this weekend ???). The link is just there to show you that the necessary work has already been done.

If you wanted to get access to it sooner you could run calibre from source.
jackie_w is offline   Reply With Quote
Old 08-09-2018, 06:28 AM   #12
jiembe
Zealot
jiembe began at the beginning.
 
Posts: 137
Karma: 10
Join Date: Sep 2016
Location: Montréal Québec
Device: Kobo Glo; Kobo Libra
Wow. Thanks
jiembe is offline   Reply With Quote
Old 08-21-2018, 11:08 AM   #13
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 664
Karma: 2180702
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
Quote:
Originally Posted by kovidgoyal View Post
If we use "Remove tag" before the tag is highlighted - this function destroys the code.

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>
1. Place cursor inside "p" (for example, before "class" word) and press "Remove tag".
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
BeckyEbook is offline   Reply With Quote
Old 08-21-2018, 12:56 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is online now   Reply With Quote
Old 08-21-2018, 01:04 PM   #15
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 664
Karma: 2180702
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
Quote:
Originally Posted by kovidgoyal View Post
… though I suppose I can have it detect that and not do anything instead.
If you can detect this moment without highlight - it will be great.

Of course undo works too
BeckyEbook is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 04:30 AM.


MobileRead.com is a privately owned, operated and funded community.