Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-07-2014, 06:13 PM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Suggestion: Run Check addition for 'do nothing' tags

It would seem (to me at least) that if I have no text selected, then ...

a) I would not want to insert 'do nothing' tags for bold, italic, color, underline, etc.

So my first thought was to suggest ignoring the [B] or [I] etc.

However, then I realized that ...

b) I might want the tags because I want to insert text between them

So finally I thought possibly

c) a [Run Check] question and cleanup of empty tag pairs

Code:
  <h1>test<b><i><u><strike><span style="color: rgb(255, 0, 0)"></span></strike></u></i></b></h1>
Be a little complicated I guess since (as in the example) the <span> is empty making the <strike> empty making the <u> empty making the <i> empty and finally making the <b> empty

I'm not sure, but white space would not count since who wants a bold space

Code:
  <h1>test</h1>
phossler is offline   Reply With Quote
Old 02-07-2014, 10:02 PM   #2
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: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There is no way to know that a tag is empty, since an empty tag could be styled with css to have a fixed width/height or border or background color.
kovidgoyal is offline   Reply With Quote
Advert
Old 02-08-2014, 09:20 AM   #3
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Kovid -- thanks

Quote:
Originally Posted by kovidgoyal View Post
There is no way to know that a tag is empty, since an empty tag could be styled with css to have a fixed width/height or border or background color.
That's more advanced than I was thinking (maybe I was anyway).

It was just that I was using the new editor window dropdown to select [H1], etc. and then tried the [B] and other buttons.

My use of 'empty' a little simplistic: if there was 0 length text selected (i.e. just the insertion point) then I called it empty since I didn't see any value in at least the 'standard' format tags such as<b></b>

When there's a capability to store F&R strings, I can come up with some RegEx (or at least I think I can) to handle things like that
phossler is offline   Reply With Quote
Old 04-06-2014, 09:22 AM   #4
user743
Addict
user743 has never been to obedience school.user743 has never been to obedience school.user743 has never been to obedience school.user743 has never been to obedience school.user743 has never been to obedience school.user743 has never been to obedience school.user743 has never been to obedience school.user743 has never been to obedience school.user743 has never been to obedience school.user743 has never been to obedience school.user743 has never been to obedience school.
 
Posts: 243
Karma: 44444
Join Date: Mar 2014
Device: Kindle PW2 special offers removed by Amazon for FREE
Quote:
Originally Posted by kovidgoyal View Post
There is no way to know that a tag is empty, since an empty tag could be styled with css to have a fixed width/height or border or background color.
technically right, but practically speaking usually not.

so is there a way to remove empty tags?
user743 is offline   Reply With Quote
Old 04-06-2014, 09:53 AM   #5
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
It doesn't really make any difference in what is displayed and they can be searched and replaced.
mrmikel is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell Check Suggestion Tex2002ans Sigil 19 01-10-2013 08:45 PM
Suggestion: Add filter to manage tags, authors etc. Peter Walters Library Management 6 04-04-2012 05:21 AM
Suggestion - Ignore Calibre2OPDS during Check Library Wyndham Library Management 4 02-10-2012 03:48 AM
Is there anyway to download Genre? In addition to tags. iridius Library Management 8 02-22-2011 11:10 PM
Suggestion: User created sub-folders for Tags, Authors, Etc. Daemon Calibre 0 08-23-2010 12:47 AM


All times are GMT -4. The time now is 02:08 PM.


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