Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-16-2020, 05:27 AM   #16
un_pogaz
Chalut o/
un_pogaz is on a distinguished road
 
un_pogaz's Avatar
 
Posts: 107
Karma: 50
Join Date: Dec 2017
Device: Kobo
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.

Last edited by un_pogaz; 01-16-2020 at 06:04 AM.
un_pogaz is offline   Reply With Quote
Old 01-16-2020, 06:38 AM   #17
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: 36,097
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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/calibr...ac2d06b4a01bfa
kovidgoyal is offline   Reply With Quote
Old 01-16-2020, 07:18 AM   #18
un_pogaz
Chalut o/
un_pogaz is on a distinguished road
 
un_pogaz's Avatar
 
Posts: 107
Karma: 50
Join Date: Dec 2017
Device: Kobo
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

Last edited by un_pogaz; 01-16-2020 at 07:36 AM.
un_pogaz is offline   Reply With Quote
Old 01-16-2020, 07:45 AM   #19
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: 36,097
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by un_pogaz View Post
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
kovidgoyal is offline   Reply With Quote
Old 01-23-2020, 06:23 AM   #20
un_pogaz
Chalut o/
un_pogaz is on a distinguished road
 
un_pogaz's Avatar
 
Posts: 107
Karma: 50
Join Date: Dec 2017
Device: Kobo
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:
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)
un_pogaz is offline   Reply With Quote
Old 01-23-2020, 06:42 AM   #21
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: 36,097
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
weird I cannot reproduce o my development machine, must be specific to PyQt version, in any case this fixes it: https://github.com/kovidgoyal/calibr...9d7ad1fcabcaeb
kovidgoyal is offline   Reply With Quote
Old 01-23-2020, 09:15 AM   #22
thiago.eec
Addict
thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.
 
Posts: 288
Karma: 71602
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by un_pogaz View Post
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.
It also happens here (Win 10, x64).
thiago.eec is offline   Reply With Quote
Old 01-23-2020, 03:05 PM   #23
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,678
Karma: 9600000
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by kovidgoyal View Post
I was just about to report that bug, but this does indeed fix it. (By the by, is there any way to stop this module from spontaneously inserting inline styles?)

Unfortunately, I have another 4.9 bug to report, which is unaffected by that patch. In the standard calibre "library list" view, highlighting multiple ebooks and selecting "Edit metadata individually" (either by typing "e" or using the context menu) brings up the bulk editor instead.

EDIT: Almost forgot, there's another comments-editor bug that's persisted through at least the last few versions. When highlighting a boldface word or phrase from right to left, highlighting the "last" character (the first one in the word) causes the "bold" button to switch to "normal" status and neither clicking it nor pressing control-B has any effect. The selection stays bold, and only by highlighting from left to right can the it be debolded. The same goes for italics and underlined text, and it manifests in both the "review downloaded metadata" and "edit metadata individually" comment environments (which I expect use the same coding, but it's good to be thorough).

Last edited by Rev. Bob; 01-23-2020 at 04:32 PM.
Rev. Bob is offline   Reply With Quote
Old 01-23-2020, 06:32 PM   #24
un_pogaz
Chalut o/
un_pogaz is on a distinguished road
 
un_pogaz's Avatar
 
Posts: 107
Karma: 50
Join Date: Dec 2017
Device: Kobo
4.9.1
Yes.
It's works.
Thanks you so mush Kovid.
un_pogaz is offline   Reply With Quote
Old 01-24-2020, 11:55 PM   #25
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: 36,097
Karma: 15014853
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Rev. Bob View Post
I was just about to report that bug, but this does indeed fix it. (By the by, is there any way to stop this module from spontaneously inserting inline styles?)
no, there isn't.

Quote:
Unfortunately, I have another 4.9 bug to report, which is unaffected by that patch. In the standard calibre "library list" view, highlighting multiple ebooks and selecting "Edit metadata individually" (either by typing "e" or using the context menu) brings up the bulk editor instead.
Will be fixed in the next release.

Quote:

EDIT: Almost forgot, there's another comments-editor bug that's persisted through at least the last few versions. When highlighting a boldface word or phrase from right to left, highlighting the "last" character (the first one in the word) causes the "bold" button to switch to "normal" status and neither clicking it nor pressing control-B has any effect. The selection stays bold, and only by highlighting from left to right can the it be debolded. The same goes for italics and underlined text, and it manifests in both the "review downloaded metadata" and "edit metadata individually" comment environments (which I expect use the same coding, but it's good to be thorough).
that's a limitation of QTextEdit, not much I can do about it. formatting style applies left of cursor. When you select from right to left, left of cursor is before the formatting. You can see this in action by simply moving the cursor without doing any selecting.
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
Adding spaces after images and between paragraphs awcross Sigil 7 06-14-2017 03:47 PM
Stop Sigil from inserting unwanted lines between paragraphs Benasam Sigil 16 05-28-2014 04:16 PM
Adding space between paragraphs Gazella Conversion 5 04-03-2014 05:35 PM
Touch Extra spacing between paragraphs on my e-books Aiden Barnes & Noble NOOK 8 12-11-2013 12:17 PM
Getting extra Paragraphs MacEvansCB Calibre 5 12-19-2010 03:46 PM


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


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