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 04-26-2014, 02:53 AM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Paragraph separator

Hi,

I cleaned a book, using some regex to get rid of a lot of unwanted tags. Ex:
Code:
<span face="Georgia">(.*?)</span>
\1
What was left was text files which kept the former PARAGRAPH SEPARATOR (U+2029). It looked like a ragged display in the code but the book display was unaffected. (see screenshot). I could not clean them directly with the "Beautify" button.

To get rid of them, I just added a new regex which destroyed all of them, including the ones left in the text files, and then launched "Beautify all files" (Embellit tous les fichiers) which reinstates them only in the right places. (screenshot2 - normal code display)

Maybe when performing a regex suppressing tags in the text files, it would be nice if the Calibre editor could check if there are still some unwanted separators left?
Attached Thumbnails
Click image for larger version

Name:	separator.png
Views:	320
Size:	77.2 KB
ID:	122112   Click image for larger version

Name:	without.png
Views:	283
Size:	53.0 KB
ID:	122113  

Last edited by roger64; 04-26-2014 at 03:48 AM.
roger64 is offline   Reply With Quote
Old 04-26-2014, 02:59 AM   #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: 44,409
Karma: 23977332
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There's no way for calibre to know when a line break is "unwanted". You should include the newline you want removed as part of your regular expression, for example:

<p.+</p>(\n)?

Will remove <p> tag including an optional trailing newline.
kovidgoyal is offline   Reply With Quote
Advert
Old 04-26-2014, 03:10 AM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Thanks for this tip! It's far from obvious (at least for me). I will try it.

side note: By the way, many thanks too for correcting the French elided forms bug (spellchecker) in your last release and for uploading my corrections in the French translation file.

roger64 is offline   Reply With Quote
Old 04-26-2014, 03:17 AM   #4
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: 44,409
Karma: 23977332
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You're welcome
kovidgoyal 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
<hr> as section separator? orange! ePub 13 09-17-2013 03:31 PM
Subgroup Separator ilovejedd Library Management 8 03-03-2012 10:55 AM
about paragraph breaks arslonga Calibre 0 02-03-2012 05:03 AM
Preference: Paragraph indent or a little paragraph spacing? 1611mac General Discussions 48 11-11-2011 12:43 AM
Use of comma as field separator and author_sort meme Development 9 04-19-2011 04:26 PM


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


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