Linkify ting (exclude emails)

By JoeSimmons Last update Jun 2, 2010 — Installed 5,071 times.

corrected a bug were text links are transformed but not clickable

in
Subscribe to corrected a bug were text links are transformed but not clickable 28 posts, 3 voices



berni2k User

text links like userscripts.org are transformed into a link but are not click-able because the script adds a space inside the link

to correct this just paste the following line of code after the variable href is first introduced

while (href.indexOf(" ") > -1) href = href.replace(" ","");

it will remove all spaces inside the linkifyed text links so they can be clicked

 
JoeSimmons Script's Author

Actually this isn't my script (all original copyright in source), all I did was make it not linkify emails. I fixed it though.

 
berni2k User

I saw you removed the prefix string too, great work, thx
btw I think in some cases it is necessary to remove the " or ' characters too :)

lets test it: "userscripts.org" userscripts.org 'userscripts.org'

 
berni2k User

cool your bug fix corrected this too, now this script makes sense, cu :)

 
JoeSimmons Script's Author

Yeah like I said it wasn't my script. I fixed the space issue like you said and I changed the handling of http:// in the href.

 
berni2k User

i hope it is open source ;)

well, do u still use this script? or did you find a better one already?

 
JoeSimmons Script's Author

Yeah I use it, that's why I posted this. I like the script but it was making links out of emails (and not mailto: ones, I have another script for that) and I didn't want it to do that, and thought it'd be useful for others.

 
berni2k User

i c, great you changed that, before that script i used some linkify firefox extension, but i lost it.

hey u made another update right? although it seems i cant spot the code change so far

so you are combining this script with some other linkify scrip, do you?

 
JoeSimmons Script's Author

I've only done one update. The code was edited to exclude the linkifying of emails in the first version, and the second version I fixed the space issue.
I don't quite get what you mean about combining. I used adam_3's code (original creator of Linkify ting) and modified it to fix those 2 bugs from adam's script.

 
berni2k User

The header told "last update" was later than the update we talked about first that's why i asked. With combining i meant that you wrote you are using an other script for getting mailto: links and i just wanted to know the name of it :)

hey 444 installations, grats :)

 
JoeSimmons Script's Author

Oh I see. For mailto links, I use GmailTo. With Linkify ting original, I couldn't use this because it, too, would try to change mailto links, so I edited it to ignore them. Then the update after that was the spacing issue and prefix re-write as just a little optimization I thought I'd add.
Thanks for the heads up and all.

 
berni2k User

ok, to get gmail to work with mailto i use google talk, so i can use other browsers too.
wanna try if the combination now also converts emails into click-able links that dont have mailto in their href and still brings me too gmail ... bill@microsoft.com (edit: perfect, it works :)

oh and maybe we can fix the bug with the leading space character too

 
JoeSimmons Script's Author

What leading space character? On this script?

 
berni2k User

for example this text link userscripts.org has it

the script converts the space before the text also into the link (the underline is also under the space and not only under the text link)

 
JoeSimmons Script's Author

Alright fixed that.

 
berni2k User

wow, thank you

you changed a lot in the source .. was it difficult?

 
JoeSimmons Script's Author

Nah easy. and (oops) I forgot to take something out. Originally I was going to encapsulate the new link in a span starting with a space but I found a better, shorter way.
I also put the script in an anonymous function for opera, changed the blacklist tags, and changed the way the xpath worked so it only looks in the body and not the whole document, so I didn't need the head tag in the blacklist array anymore.
Just fixed up the regex too, doesn't really change anything but it's more dynamic now.

 
berni2k User

ah now i know why the new function :)

i also saw u tried to remove spaces all over the code .. tried that too in first place *ggg*

do you use a program to compile and debug such small scripts or just an editor like me?
i have visual studio 2008 but its just to much to big to bloat and to complicated for such small things, im searching for something small, any idea?

 
JoeSimmons Script's Author

I just use Notepad++. It's a great program. It has spell checking, syntax highlighting, auto-indenting, everything I need.

 
JoeSimmons Script's Author

Fixed another bug with my "Clean Up Web Jargon" script.

 
berni2k User

nice

what do you say should we add |in|to| to the list?

i added them every time

 
JoeSimmons Script's Author

Good idea. Added it.

 
berni2k User

great, thx

 
ozzii User
FirefoxWindows

missed |fr
Can you add it please.

Also, can you do that almost all the domains are taken (something like dot and after 2/3 characters). Sorry I don't know regex so I can't test/help.

 
JoeSimmons Script's Author
FirefoxWindows
ozzii wrote:
missed |fr
Can you add it please.
Sure.
ozzii wrote:
Also, can you do that almost all the domains are taken (something like dot and after 2/3 characters).
Don't get what you mean.
Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel