Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-14-2014, 04:22 AM   #1
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: 907
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
Question Hyperlink removes selected text

When selecting text and using the new hyperlink function, the selected text is actually removed and replaced by just the hyperlink. I do not think that that is the intended behavior. Perhaps I did something wrong?
DrChiper is offline   Reply With Quote
Old 03-14-2014, 06:11 AM   #2
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,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
This happen to me as well.
As work around, I do only point the place for the Link and add the text after inserting the hyperlink. However, it will be more comfortable to add the link to a text in the file, if there is a selection.
Divingduck is offline   Reply With Quote
Advert
Old 03-14-2014, 06:49 AM   #3
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: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That is the intended behavior. It allows you to easily replace a hyperlink. If you want to insert it, just dont select any text.
kovidgoyal is offline   Reply With Quote
Old 03-14-2014, 06:57 AM   #4
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: 907
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
Thanks for clearing that up
DrChiper is offline   Reply With Quote
Old 03-14-2014, 07:01 AM   #5
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
That isn't the behaviour I expected. Most places that I have seen something like this, including this forum, use the selected text as the link text. That makes it very easy to write the text and then add the links afterwards.

And I'm not sure how it makes it easy to replace the hyperlink. If I select a hyperlink in the text and press the button, it replaces it including the link text. What am I missing?
davidfor is offline   Reply With Quote
Advert
Old 03-14-2014, 07:21 AM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by davidfor View Post
... Most places that I have seen something like this, including this forum, use the selected text as the link text.
FWIW - its also how it works the calibre Comments Editor

Select the desired text, click the link widget in the toolbar, paste url into the Enter URL text box, press enter. The desired text will go blue underlined.

If you click on blue underlined text and its an http link then relevant page opens in your browser, if its an FTP link..., if its a file link...,

BR

Last edited by BetterRed; 03-14-2014 at 07:26 AM.
BetterRed is offline   Reply With Quote
Old 03-14-2014, 11:06 AM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I would have expected the/any selected text to have become the label (visible portion) of the hyperlink . After all you need something there to select

I can see an empty-(selection) string assuming the Link value (the action that happens when you use the 'Insert Link' tool on MR) for the label in this case.
theducks is offline   Reply With Quote
Old 03-14-2014, 11:34 AM   #8
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: 907
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
Well, you need also something to create a link target.
Many times I create double linked hyperlinks for reference purposes as not all E-readers have automagical return support (like for instance the PRS-Tx):
  • click the ref-link and you jump to a reference,
    Code:
    <a id="footnote1"></a><sup><a href="footnotes.xhtml#bookmark1">1</a></sup>
  • click the reference and you jump back where you started.
    Code:
    <a id="bookmark1"></a><sup><a href="Chapter0X.xhtml#footnote1">1</a></sup>
They are quite handy, but must always be manually crafted

Last edited by DrChiper; 03-14-2014 at 11:39 AM.
DrChiper is offline   Reply With Quote
Old 03-14-2014, 11:38 AM   #9
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: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This is an html source code editor, there is no guarantee that the selected text does not contain other tags. You cannot just assume it is text a plunk it in the middle of an <a> tag.

There are three possible behaviors for the insert link action when text is selected:

1) Delete the selected text and insert the <a> tag (this is what currently happens)

2) Ignore the selected text and insert the <a> tag either before or after it depending on the current cursor position at the start or end of the selection.

3) Wrap the selected text in <a> tags.

1) and 2) have the advantage that the insertion of the <a> tag can be guaranteed to not produce invalid HTML. Trying to make that guarantee with (3) is very difficult. The best that you could probably do is detect a potential problem and bail with an error message.
kovidgoyal is offline   Reply With Quote
Old 03-14-2014, 11:59 AM   #10
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: 907
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
Which is quite similar as what you mentioned in a previous discussion concerning the <h1> tags. I already assumed that this would be the reason for the implementation.
DrChiper is offline   Reply With Quote
Old 03-14-2014, 12:04 PM   #11
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Since it is an html editor, one would hope they would know what they are doing. They can create much worse messes than the one cited using any html editor. My request is wrap the selected text and hope the person using the program is somewhat knowledgeable. The length of the wrapped text is likely to be a word or two, generally, or a title of something.

As it stands now, I will click at the beginning of a phrase, click the hyperlink button and then cut the ending tag off and move it to the end of the phrase.

Last edited by mrmikel; 03-14-2014 at 12:08 PM.
mrmikel is offline   Reply With Quote
Old 03-14-2014, 12:12 PM   #12
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
We are using a code editor as you pointed out.
I would agree 100% with your plan if the user was working on the WYS(WYG) side

I guess the question is where do you stop protecting the user from producing invalid code?

I can already delete any part of tag code, leaving it invalid.

I don't know how hard it would be to Sanity validate the selection and report:

"Selected text contains unbalanced tag pairs"
theducks is offline   Reply With Quote
Old 03-14-2014, 12:14 PM   #13
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: 907
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
Quote:
Originally Posted by mrmikel View Post
.. one would hope they would know what they are doing.
Quote:
where do you stop protecting the user?
Although using the edit book function is not for the very faint of heart, it is not rocket science either
I think we can safely assume that users made a educated choice when starting an edit book session. But you can always throw in a warning on opening an e-book, like: You must be really, really know what you are doing before continuing.

(I think this would be overkill, but hé, who am I to judge? )

Last edited by DrChiper; 03-14-2014 at 12:16 PM.
DrChiper is offline   Reply With Quote
Old 03-14-2014, 12:22 PM   #14
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: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I have absolutely no problems with not protecting the user from doing things that directly create invalid code. I do have a problem with the user asking the editor to perform some automated action that leads to invalid code. That is something I try to avoid as much as is reasonably possible.

Things the editor does as opposed to the user doing should try to not result in invalid code, as much as possible.
kovidgoyal is offline   Reply With Quote
Old 03-14-2014, 12:36 PM   #15
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: 907
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
Quote:
Originally Posted by kovidgoyal View Post
I do have a problem with the user asking the editor to perform some automated action that leads to invalid code. That is something I try to avoid as much as is reasonably possible.
That is a solid and sound design decision I fully agree with
DrChiper is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink to PDF Macsurfcat ePub 4 04-18-2013 04:20 PM
Hyperlink an image scheife ePub 2 03-07-2013 07:43 AM
"Offending" hyperlink bug in InDesign CS5 causes TOC to fail and missing text eggheadbooks1 ePub 0 11-16-2011 12:18 AM
Hyperlink adachim Kobo Reader 0 11-02-2010 10:57 PM
Hyperlink? fcoulter Sigil 3 03-28-2010 10:31 AM


All times are GMT -4. The time now is 12:39 PM.


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