MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Line break adds unwanted code, how to change this? (https://www.mobileread.com/forums/showthread.php?t=338009)

Pedro Magnifico 03-13-2021 04:36 PM

Line break adds unwanted code, how to change this?
 
Inserting a line break adds this code:

<span style="font-size: 1.1em; line-height: 1.3em;">

Is there a way to stop this from happening?

KevinH 03-13-2021 06:24 PM

This can not be a recent version of Sigil as BookView was removed long ago.
Is this PageEdit? If so what version?

Pedro Magnifico 03-14-2021 01:44 PM

Sigil Version 0.9.10

Pedro Magnifico 03-14-2021 02:01 PM

Upon further investigation, this code is inserted not when I add a line break but when I delete a paragraph break.

KevinH 03-14-2021 02:04 PM

Sorry, Sigil is now at version 1.4.3 and BookView has been removed because itis live html editing in a browser engine that can generate very poor code.

My guess is you hit "return" inside or immediately after a span tag and that tag is being inherited by the new line.

You might try cutting and pasting a what you want from some place else in the document, or better yet use CodeView and Preview to get what you want and stay away from BookView.

KevinH 03-14-2021 02:07 PM

Yes deleting the end of a paragraph will merge your current code into the code before it. That is what live editing in html is doing.

If you care at all about code quality, stop using the now removed BookView and start learning html/css and do all editing in CodeView with Preview showing you in real time what your code is producing.

And only if you must, use BookView for just final proofing and fixing small typos and things, use CodeView with Preview for all else.

Pedro Magnifico 03-14-2021 02:11 PM

No, there is no span tag already in place, I am having to convert separate paragraphs created by calibre's conversion from pdf to line breaks which my client's writing style uses "generously".

In this case page view gives the better workflow even with this odd issue. Deleting the undesirable code is faster than doing the numerous necessary edits in code view.

I was just hoping this was something I could change but if not I'll live with it.

KevinH 03-14-2021 02:12 PM

Once you do that you can then upgrade to the latest Sigil version that is still supported and add in the PageEdit app as a Preferred External Xhtml editor if you still want minor WYSIWYG editing capabilities.

Pedro Magnifico 03-14-2021 02:18 PM

I'm well versed in html and css, but in this case page view is the more expedient workflow. This is not an issue with code merging into existing span tags, that I would have figured out on my own.

I'm working with a conversion from pdf made with Calibre, which converts all line breaks (which my client's writing style uses generously) to paragraph breaks, so I must manually change them back to line breaks. fixing all of the wonky code with find & replace is still much faster than working in code.

Thanks for your advice, though.

KevinH 03-14-2021 02:37 PM

You do know with Preview open beside CodeView, you can click in Preview and CodeView will sync to the closest point it can and Visa-Versa. This makes it easy to see where insertions or deletions should be made by scrolling in Preview and then clicking to sync CodeView location and make the changes there., And Find & Replace works just fine with CodeView.

Pedro Magnifico 03-14-2021 02:40 PM

No, I didn't know about preview at all. I'll take a look at that, thanks.

KevinH 03-14-2021 02:45 PM

Use Sigils View menu to show and hide Preview. You can of course detach the Preview dockwidget and move it to a second monitor if one is available and of course resize it at will. Preview will auto reload as you type in CodeView.

BetterRed 03-14-2021 05:22 PM

Quote:

Originally Posted by Pedro Magnifico (Post 4102451)
I'm working with a conversion from pdf made with Calibre, which converts all line breaks (which my client's writing style uses generously) to paragraph breaks, so I must manually change them back to line breaks. fixing all of the wonky code with find & replace is still much faster than working in code.

PDF is probably the worst format from which to create an EPUB, what tool does your client use to create the PDFs?

BR

Pedro Magnifico 03-14-2021 05:40 PM

Agreed, it does make for a lot of extra work but apparently it's all he has. Either his original word files are lost or he can't be bothered to locate them.

Tex2002ans 03-14-2021 09:32 PM

Quote:

Originally Posted by Pedro Magnifico (Post 4102451)
I'm working with a conversion from pdf made with Calibre, which converts all line breaks (which my client's writing style uses generously) to paragraph breaks, so I must manually change them back to line breaks. fixing all of the wonky code with find & replace is still much faster than working in code.

So let's say your original PDF is some poetry, like this:

Code:

this is an
example poem
that ends like this.

and Calibre is converting it into:

Code:

<p>this is an example poem that ends like this.</p>
and you're manually re-inserting all the breaks, so you get this?

Code:

<p>this is an<br/>
example poem<br/>
that ends like this.</p>

When converting the PDF in Calibre:

1. Right-Click the book > Convert books > Convert individually.

2. Under "PDF Input", there's a "Line un-wrapping factor".

You'll want to mess with that number.

That tells Calibre how strongly it will try to put lines back together.


All times are GMT -4. The time now is 09:24 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.