Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 12-08-2013, 06:25 AM   #241
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,378
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's the same one, if you want to see the changes, you have to run from source.
kovidgoyal is offline  
Old 12-08-2013, 08:28 AM   #242
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
The non-breaking space problem

@kovid,

Please can I ask you have another look at the nbsp issue of unicode \xA0 vs. the &nbsp entity as raised by Perkin. I am using calibre v1.14, not running from source, so if the following is no longer relevant please ignore

The attached epub contains 14 unicode \xA0 chars. When viewed in calibre Viewer all is OK.
  1. When opened in new Tweak, just as you said, the \xA0 chars are syntax highlighted.
    Problem 1: Preview is displaying them as if they were normal spaces.
  2. Change anything in the text and File-Save.
    Problem 2: Although the \xA0 chars still appear to be syntax highlighted in the code view, after quitting Tweak and viewing the edited epub it seems that the \xA0 chars have been converted to normal spaces during the File-Save. This can be confirmed by reopening the edited epub in Tweak.

This is a similar problem to one which existed in Sigil for a very long time, although it is fixed in the current version.

A possible way to avoid both Problem 1 & 2 above may be to convert the unicode \xA0 chars to entities (&nbsp or & # 160) during Tweak's File-Open and convert them back to unicode during the File-Save. I think current Sigil does the former (and complains about 'not well formed' because DTD is missing) but not the latter.

I've done a brief test of the theory by manually converting the \xA0 chars to &nbsp before opening in Tweak. After an edit/save Tweak has converted the &nbsp to \xA0 and the edited epub displays correctly.

Obviously I have no idea of any wider ramifications to Tweak of &nbsp entities being temporarily present during the editing process, but given the high percentage of retail epubs which use 'empty &nbsp paragraphs' to create scenebreaks etc, IMHO something needs to be done to avoid the current 'silent stripping'. If I've missed something obvious which would have avoided these problems, feel free to call me an idiot
Attached Files
File Type: epub uni_nbsp.epub (2.5 KB, 132 views)

Last edited by jackie_w; 12-08-2013 at 08:30 AM.
jackie_w is offline  
Old 12-08-2013, 08:42 AM   #243
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Another related nbsp problem...
I tried to do a S&R by copying the nbsp character into the find box, but the find doesn't find them, just cycles through the normal space chars.
How would I enter the character to do the S&R.

Edit: seeing jackie_w's post, I used the '\xA0' in the search box and it now finds the character.

The 'Replace All' doesn't find any occurences, but the find/replace&find does

(OS X Mavericks)

Last edited by Perkin; 12-08-2013 at 08:46 AM.
Perkin is offline  
Old 12-08-2013, 10:12 AM   #244
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 1,018
Karma: 2003162
Join Date: Jun 2011
Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11
Quote:
Originally Posted by jackie_w View Post
Obviously I have no idea of any wider ramifications to Tweak of &nbsp entities being temporarily present during the editing process, but given the high percentage of retail epubs which use 'empty &nbsp paragraphs' to create scenebreaks etc, IMHO something needs to be done to avoid the current 'silent stripping'.
Hmm, that would explain the many empty page constructs I'm currently seeing:
Code:
<p> <p>
some other used creating/converting software packages perhaps also "silently" strip, thus rendering the resulting empty page construct useless in (at least my) e-readers.

I used to convert them to &nbsp or & # 160 as jackie_w indicated, but that is now not valid anymore.

Last edited by DrChiper; 12-08-2013 at 10:15 AM.
DrChiper is offline  
Old 12-08-2013, 11:08 AM   #245
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,378
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@jackie_w: You are correct, Qt's toPlainText() function replaces \xa0 with a normal space, causing the non breaking spaces to be stripped out during save. I have fixed that by replacing toPlainText() with my own implementation. https://github.com/kovidgoyal/calibr...78c463c5b4c956
kovidgoyal is offline  
Old 12-08-2013, 12:03 PM   #246
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,378
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@Perkin: Your nbsp search issues are not search issues but problems caused by the same Qt bug that causes copying of nbsp characters to not work (they are replaced by spaces).
kovidgoyal is offline  
Old 12-08-2013, 02:15 PM   #247
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by kovidgoyal View Post
@jackie_w: You are correct, Qt's toPlainText() function replaces \xa0 with a normal space, causing the non breaking spaces to be stripped out during save. I have fixed that by replacing toPlainText() with my own implementation. https://github.com/kovidgoyal/calibr...78c463c5b4c956
I can't try out your fix for myself because I don't run from source. I'll take your word for it that it fixes Problem 2 during File-Save. Can you confirm whether it also solves Problem 1, i.e. the \xA0 chars not displaying correctly in the Preview panel?

Last edited by jackie_w; 12-08-2013 at 02:17 PM.
jackie_w is offline  
Old 12-08-2013, 07:01 PM   #248
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
To be sure the problem below was not caused by a problem in the calibre install, I've replaced it with a clean one (except for the settings directory). The problem still exists.

I know you've removed the ampersands, but I thought I'd post the information anyway in cause you'd want to look into this later.

The Windows-installation is a completely up to date Windows 7 x64 Professional. I haven't got anyting installed like a separate QT (only QT as part of applications, such as Sigil, and Frescobaldi), and I don't have any old Delphi-programs or runtimes installed, as was suggested some posts ago. (At least, I don't have those, as far as I know.)

Quote:
Originally Posted by Katsunami View Post
There is one thing that seems to be incorrect (cosmetic problem): The window titles have &-signs in them, presumably to denote a hotkey. Examples:

&Files Browser
&Inspector
File &Preview

If it makes any difference, the operating system is Windows 7 x64 Professional.
Katsunami is offline  
Old 12-08-2013, 08:13 PM   #249
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by jackie_w View Post
I can't try out your fix for myself because I don't run from source. I'll take your word for it that it fixes Problem 2 during File-Save. Can you confirm whether it also solves Problem 1, i.e. the \xA0 chars not displaying correctly in the Preview panel?
I just updated my source and tried. Everything seems to be working: The characters are there, they survive a save and reopen, the preview pane shows them correctly and works correctly when I resized the pane.
davidfor is offline  
Old 12-08-2013, 08:32 PM   #250
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by davidfor View Post
I just updated my source and tried. Everything seems to be working: The characters are there, they survive a save and reopen, the preview pane shows them correctly and works correctly when I resized the pane.
Thanks, David. and thanks Kovid for fixing so quickly, I look forward to next Friday's release.
jackie_w is offline  
Old 12-08-2013, 08:46 PM   #251
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
Quote:
Originally Posted by jackie_w View Post
Thanks, David. and thanks Kovid for fixing so quickly, I look forward to next Friday's release.
Ditto to all this.
Perkin is offline  
Old 12-08-2013, 09:46 PM   #252
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,378
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@Katsunami: These kinds of problems are deep in Qt code and that makes debugging them a real pain. For something as trivial as this, it isn't wortht he effort. Off the top of my head, the onlything I can think of is that are you using the calibre style or the system default widget style? Preferences->Look & Feel in calibre.
kovidgoyal is offline  
Old 12-08-2013, 09:53 PM   #253
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by kovidgoyal View Post
Off the top of my head, the onlything I can think of is that are you using the calibre style or the system default widget style? Preferences->Look & Feel in calibre.
FYI. I just switched to System Default and I saw the & symbols as described. Switched back to Calibre Style and they were gone.
DoctorOhh is offline  
Old 12-09-2013, 06:25 AM   #254
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,378
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just uploaded some new betas to http://download.calibre-ebook.com/betas/

They include a new Book Check tool that finds well-formedness errors in XML/XHTML, invalid images, images in CMYK colorspaces and broken links. More checks will be added later.

Also fixed the bugs reported by arspr for css syntax highlighting and jackie_w for nbsp handling.

Finally, links in the preview panel are now clickable.
kovidgoyal is offline  
Old 12-09-2013, 06:38 AM   #255
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
Hi Kovid,

I found two little errors (maybe you have already fixed them):

If I undock a window from the editor GUI (a nice feature in the editor), it works fine except for the inspector, what shows an empty window. If I dock it back to its place in the GUI, all code is shown again but loses the actual position and start have the position at top of the file

If there are blank lines in a text (with or without a blank character), they will not be shown in the file preview window. When I replace the blank with ‘&nbsp;’ the blank line will be shown

Edit: Ignore the last one with the blank line. You did fix it with the new beta-update. Thanks.

Last edited by Divingduck; 12-09-2013 at 06:47 AM.
Divingduck is offline  
Closed Thread


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make Sigil live varlog Sigil 136 10-25-2013 02:34 PM
how many tocs does Sigil make? Gregg Bell Sigil 17 01-31-2013 09:39 AM
How do I make all .pdf's in my calibre library open in calibre instead of preview morbo3000 Library Management 9 07-30-2011 10:39 AM
using sigil to make changes befote conversion alansplace Sigil 11 06-07-2011 07:50 AM
i can't make sigil run in fedora 14 nastarovia Sigil 1 01-20-2011 05:02 AM


All times are GMT -4. The time now is 07:10 PM.


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