Mobileread
Please stop adding extra paragraphs??
#11  Sirtel 01-15-2020, 10:25 PM
Quote BetterRed
Spoiler Warning below






In pictures:

I type in Normal view

show attachment »

I go into HTML source and see this

show attachment »

I go back to Normal view and I see this

show attachment »

And that's what I see in Book Details

show attachment »

I thought I had 'fixed' this by tweaking L&F Book Details->Text styling

Code
body, td { background-color: transparent;
}
body.horizontal table td.title { white-space: nowrap }
p { margin: 0}
a { text-decoration: none;
}
.comments { margin-top: 0; padding-top: 0; text-indent: 0
}
.comments-heading { font-size: larger; font-weight: bold
}
table.fields { margin-bottom: 0; padding-bottom: 0;
}
table.fields td { vertical-align: top
}
table.fields td.title { font-weight: bold
}
.series_name { font-style: italic
}
/*
The HTML that this stylesheet applies to looks like this:
<snip>
<h3 class="comments-heading">Custom comments column heading</h3>
<div id="_customcolname" class="comments">...</div>
*/


BR
I have exactly the same experience.
Reply 

#12  BetterRed 01-15-2020, 10:57 PM
Quote kovidgoyal
I cannot replicate that with a default stylesheet in preferences->look & feel->book details. With that pressing enter, shift+enter and enter again to create <p><br></p> renders are two blank lines always, everywhere.
Kovid I didn't press enter, shift+enter after 'line 2'. I pressed enter, enter. Doing that in 3.48 emits this HTML:

Code
<div>line 1<div>line 2</div><div><br></div><div>line 3</div><div>line 4</div></div>
Which doesn't create the extra blank line in the rendered text.

BR
Reply 

#13  kovidgoyal 01-15-2020, 11:05 PM
What is it you are actually trying to do?? If you want to create a blank line, with the default stylesheet just press enter once and start typing the next paragraph. If you want to insert a line-break press shift enter and start typing the next line.

And yes calibre 4 is not going to behave like calibre 3 in this respect as I have explained ad nauseum.
Reply 

#14  kovidgoyal 01-15-2020, 11:28 PM
And this will preserve the inserted <p><br></p> as a single blank line, at the cost of it now looking like: <p style="-qt-paragraph-type:empty"><br></p>

https://github.com/kovidgoyal/calibre/commit/d70363d40810d7fa2d5177f1994c2e26c7edfb50
Reply 

#15  BetterRed 01-15-2020, 11:42 PM
↑ ↑ ↑ ✔ - Thanks

The only suggestion to use shift+enter I can find is this one https://www.mobileread.com/forums/sh...43&postcount=4

I must have missed it. It also got conflated it with the p { margin: 0} solution.

Added : I don't really care what the code looks like - for simple notes etc I rather not have to look at it.

BR
Reply 

#16  un_pogaz 01-16-2020, 04:27 AM
So, to get the expected behavior (like that of a W3C compliant browser) you have to add a specific Qt CSS property ?! (or to be exact, kept)
...
Whoah.
Great.
Absolutely obvious.
*sighs*
All right, then. Just in case, could you try <p></p> if it works?
I know currently than Calibre filter and delete empty paragraphs, but if it works, it would be probaly a more elegant solution.
Reply 

#17  kovidgoyal 01-16-2020, 05:38 AM
No, empty paragraph is simply discarded by QTextBrowser. However, with yet another workaround for a Qt bug, <p>&nbsp;</p> does work, so I have changed it to that.

https://github.com/kovidgoyal/calibre/commit/9f7f74c952764957cd2b052c1eac2d06b4a01bfa
Reply 

#18  un_pogaz 01-16-2020, 06:18 AM
YES, thanks.
Also work in 4.8 and propably all V4.

EDIT: Arf NOoooo
The HTML view repalce all entities. And worse, replace "unbreakable space" by "normal space"

The HTML <p>&nbsp;</p> becomes <p> </p> (with normal space) and will therefore be deleted the next time it is loaded in HTML mode.

Damnit
Reply 

#19  kovidgoyal 01-16-2020, 06:45 AM
Quote un_pogaz
The HTML view repalce all entities. And worse, replace "unbreakable space" by "normal space"
You need to include the fix using PlainTextEdit from that patch. That works around the bug with QPlainTextEdit replacing nbsp
Reply 

#20  un_pogaz 01-23-2020, 05:23 AM
The update is arrived and bug report:
When I switch from "HTML code" to "Normal View", this message appears and the changes are not saved.
Spoiler Warning below






calibre, version 4.9.0
ERREUR : Exception non gérée: <b>TypeError</b>:unbound method toPlainText() must be called with PlainTextEdit instance as first argument (got QPlainTextEdit instance instead)

calibre 4.9 Portable embedded-python: True is64bit: False
Windows-7-6.1.7601-SP1 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '7', '6.1.7601')
Python 2.7.16+
Windows: ('7', '6.1.7601', 'SP1', u'Multiprocessor Free')
Interface language: fr
Successfully initialized third party plugins: Modify ePub (1, 4, 0) && KePub Output (3, 1, 3)
Traceback (most recent call last):
File "site-packages\calibre\gui2\comments_editor.py", line 1142, in change_tab
TypeError: unbound method toPlainText() must be called with PlainTextEdit instance as first argument (got QPlainTextEdit instance instead)
Reply 

 « First  « Prev Next »  Last »  (2/4)
Today's Posts | Search this Thread | Login | Register