View Single Post
Old 07-21-2014, 09:39 PM   #50
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,736
Karma: 5446592
Join Date: Nov 2009
Device: many
Hi DiapDealer,
As I tried to explain earlier in this thread but did not do a good job, anytime you edit the book in Book View, ALL of your entities will be converted to their individual unicode single chars. This is because editing in BookView uses the QWebView widget and it gives you no options to get back *any* entities.

So the only way around that is to convert them back from the single unicode char to the entity so it can be used in editing in CodeView. Unfortunately, this is an all or nothing endeavor.

There is no way to tell which were entities and which were not when in code view, especially if in BookView mode editing changes are made that move or change the code. That is why we allow the user to select which entities they prefer to work with instead of unicode chars.

So yes, what you see (encoding them all) is what was planned. Given extensive editing can be done in BookView, you have to load the current xhtml code into the QWebView widget, let all of the editing happen, and get back the changed code but with no entities at all!

That is the difference between a CodeView only editor with a preview pane, and actual wysiwyg editing. Sorry, all I can do is hope you want to use those preserved entities consistently and always give you those back.

Hope this explains things better. Sorry, but unless we write our own QWebView widget that does not parse entities and auto convert them, I am not sure there is any other solution.

Thanks for trying it!

Take care,

KevinH



Quote:
Originally Posted by Diapdealer View Post
Ok. So just to verify what behavior I'm looking for ... you're looking to preserve a user-defined list of named entities, right? In order to keep them from being changed to their character equivalents when editing in Book View (which seems to be the default behavior in 0.7.4+) and switching back to Code View. Have I got the gist of it?

If so, as proof of concept, it seems to be working. But it seems to me that it's more or less enforcing that user-defined list of named entities on a document-wide basis. What I mean is: if I have an html page that utilizes typographic single-quote characters (not entities) in abundance and I add ’ to the Preserve Entities list in the preferences ... the next time I make an edit in Book View and come back to Code View, every single closing single quote character will have been converted to the ’ entity.

If that's the way it's intended, that's fine. I was just hoping to be able to pick and choose a bit. To maybe use the character for a closing quote and the entity for an apostrophe.

Also, if I have any &#8217[NOPARSE; entities in a document, they will all be converted to the named entity if I add &[NOPARSE]rsquo; to the list and make a Book View edit.

I'm just giving you the behavior I'm seeing, so that you can determine if it's working the way you expected it to.

I guess I was hoping for more of a "leave all existing entities (in Code View) that are in the Preserve Entities list alone when making changes in Book view" approach. Rather than "change everything to the entity in the preferences when making changes in Book View."

But maybe I'm getting a head of myself.
KevinH is online now   Reply With Quote