id hash anchors highlighted content
Are you saying that if you have an anchor link (single #) the fragmention script is highlighting the anchor text?
Yes if you have single hash anchor links on a page, an element with the ‘id’ attribute does get highlighted, and after further investigation the ‘name’ attribute exhibits strange behaviour but different to ‘id’.
# id example
Although at first I thought the ‘name’ attribute was working as normal, not all is right with it, click on this example link and then click the ‘resolution’ anchor link. First time you click ‘resolution’ the anchor links to itself and highlights the anchor link, then if you click again it takes you to the correct position in the page, but if you scroll up it still highlights the anchor link instead.
Plus (+) in text
I’m also noticing that if you have + signs in your text which are included in the fragmention link, the fragmention will not work, here’s a fragmention example with + in text. I guess this is to be expected though, since fragmention replaces space between words with a + in the url.
Single hash (#) behaviour
I think something is not ignoring single hash anchor links, since this example looks for the 1st mention of ‘fro’ in the text rather the correct position.
I’m also using the fragmention chrome extension, if you turn this on and off the text remians highlighed at the top of the page but the anchor link takes you to the correct position.
I tried turning off plugin and leaving the chrome extension activated and all the issues still seem to be present apart from the highlight is missing, which presumably is added by your plugin css.
So it does seem to be an issue with the fragmention script rather than the something introduced by the plugin.
I also noticed something else about the Plus (+) in text issue, it only fails if the + is at the beginning of the text.
Thanks for the info. I’ll pass this information to the fragmention script developer.
Regarding the + sign in text: you should use URL encoding for any special characters you want to include in a URL. I’m working on adding a hover element that will appear with the fragmention link auto-generated when you highlight text.
Thanks for passing on.
Understand what you’re saying about special characters, which is useful to know if you are creating fragmentions manually, although probably easier if I avoid text strings which contains special characters altogether.
I’m currently using the Chrome extension to create fragmentions which is not converting any + signs to %2B, although it seems to be doing others such as % to %25.
It’s the same developer as the script, Jonathan Neal, so I’ve sent him some feedback via the Chrome extension, plus I’ve also left a comment on Kevin Mark’s blog.
Like the sound of the the hover element, which presumably will allow any visitor to create a fragmention. I highlight text a lot followed by a right click to initiate some browser/extension action, so I wouldn’t want it to get in the way of that though.
- The topic ‘id hash anchors highlighted content’ is closed to new replies.