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-23-2022, 10:54 AM   #1
paperback
Connoisseur
paperback began at the beginning.
 
Posts: 76
Karma: 10
Join Date: Feb 2022
Device: None
How to remove "line breaks" from text between tags?

I recently opened an e-book where the text (between paragraph tags) does not go all the way across the page but breaks part way across. This obviously does not affect the appearance in the e-book viewer, but is there a way to easily "beautify" the edit window to remove these "line-breaks" and make the text-lines go all the way across?
paperback is offline   Reply With Quote
Old 02-24-2022, 05:23 AM   #2
paperback
Connoisseur
paperback began at the beginning.
 
Posts: 76
Karma: 10
Join Date: Feb 2022
Device: None
There is an easy way to correct this on Linux. Copy and paste the text from Calibre E-Book Editor to the XED text editor. Select All, then select "View > Join Lines (Ctrl J)". Then copy and paste back into Calibre.
paperback is offline   Reply With Quote
Advert
Old 02-24-2022, 07:36 AM   #3
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,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use find and replace in reges mode with

\n

as find

and empty replace.
kovidgoyal is offline   Reply With Quote
Old 02-24-2022, 03:31 PM   #4
DyckBook
Morlock
DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.
 
DyckBook's Avatar
 
Posts: 34
Karma: 2734796
Join Date: Oct 2021
Device: Kindle Paperwhite
Quote:
Originally Posted by paperback View Post
...is there a way to easily "beautify" the edit window to remove these "line-breaks" and make the text-lines go all the way across?
Here is a saved search that I use to accomplish that by removing all \n characters between <p> </p> tags:

[\r\n]+(?=(?:[^<]+|<(?!/?p\b))*</p>)
DyckBook is offline   Reply With Quote
Old 02-26-2022, 12:14 PM   #5
BobC
Guru
BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.BobC ought to be getting tired of karma fortunes by now.
 
Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
Quote:
Originally Posted by kovidgoyal View Post
Use find and replace in reges mode with

\n

as find

and empty replace.
However if you do this you may concatenate words resulting in spelling errors. So if say line one ends "met the purple" and line 2 starts "monster with big red eyes" you end up with "met the purplemonster with big red eyes.

You could do a replace with a <space> character and perhaps have an additional space if line 1 ended with a trailing space.

In the past if I had a book that was presented with multiple lines per paragraph I would open it first with Sigil and do a reformat and prettify using that before returning to Calibre.

BobC
BobC is offline   Reply With Quote
Advert
Old 02-27-2022, 06:46 AM   #6
paperback
Connoisseur
paperback began at the beginning.
 
Posts: 76
Karma: 10
Join Date: Feb 2022
Device: None
Kovid gave me the answer I needed; \n and replace with a space to join up the lines.
paperback is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF - relation between "line un-wrapping factor" and "unwrap line" (heuristic proc.) dr_Fell Conversion 1 10-16-2017 10:56 PM
Change "Remove ImageMagick" Breaks Generate Cover Plugin JimmXinu Development 6 05-13-2016 12:07 AM
"Remove the dependency on the zip command line tool when developing plugins"? JimmXinu Plugins 2 07-13-2012 02:09 PM
inserting a "ruled Line" /chapter and page breaks tscamera Calibre 3 01-05-2011 04:47 PM
Line indents using "<div>" tags HarryT Kindle Formats 11 04-29-2009 10:18 PM


All times are GMT -4. The time now is 05:25 PM.


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