View Single Post
Old 05-10-2016, 03:13 PM   #6
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: 8,880
Karma: 6120478
Join Date: Nov 2009
Device: many
Okay, what is happening in BookView is that when you highlight more than one piece of text you are thereby highlighting all of the div tags that hold the anchor tags.

The routine then asks for the text equivalent of the contents of the div tags and then uppercases that text content. This removes all other nested tags including the anchor tags as they are simply replaced with the text they contain.

My tests do not show any added font tags at all but they may come from the stylesheets you link to that do not exist in my tests.

When you only selct one pieces of text you get just the anchor tag and its contents are in fact the contents you actually want to uppercase. So it works as expected.

So it is exactly what I described. By highlighting more than one piece of text since you can not select exactly what you want (even though it looks on screen that you are just highlighting the text itself) you are actually selecting a hierarchy of tags and then uppercasing the entire thing.

Which brings me back to exactly why editing in BookView is very dangerous if someone is not aware of exactly what they are highlighting. The visual feedback simply gives that person the wrong impression.

My guess is this same issue exists in BookView using any command/icon that expects text being highlighted and not tags.

Not sure how I can fix this as it is doing what the command was designed to do.

That said, I might be able to detect the use of additional tags inside the div and then abort without changing anything. That seems like the most sensible thing to do.

The more I look at BookView, the more I want to simply remove it and replace it with the ability to copy out of Preview and paste into a small BookView like window.

Thanks for your bug report and test case!

KevinH

Last edited by KevinH; 05-10-2016 at 03:15 PM.
KevinH is online now   Reply With Quote