Giter Club home page Giter Club logo

autolink-js's People

Contributors

bryanwoods avatar iainbeeston avatar langalex avatar mac2000 avatar pedro-nonfree avatar tarikozket avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autolink-js's Issues

Missing links in multiple lines.

Actually I am not sure for a reason why links are absent, but

http://google.com
"http://google.com"
(http://google.com)

(all in single string) produces no links for me. Tested in Chrome 45.0.2454.85 m.

css conflict

if i have css type =" background:url(http://XXX.jpg)" in html, then the background will dispear when load autolink.js :( ;

"Not a solved problem" in the README?

Parsing out URLs is a very old problem and there are quite a few solid solutions to it.

Emails

Email support

Add email support when autolinking strings. (mailto)

Example

Input:

Go to http://www.rubyonrails.org and say hello to [email protected]

Output:

Go to <a href=\"http://www.rubyonrails.org\">http://www.rubyonrails.org</a> and say hello to <a href=\"mailto:[email protected]\">[email protected]</a>

incorrect url regexp

Hello all, user on my website have found out that when he types " ..aiming" string in comment and save it, it is shown as link "http://..aiming", because I wrap comments with autolink when show them. So, I think, it's incorrect behaviour, because " ..aiming" is not a link. I checked the code of autolink.js and found out that " ..aiming" string matches your url regexp, so autolink wrap it as link. Please check this and fix, please.

Match URLs inside tags

Right now the regex is looking for the beginning of a string or whitespaces before a match. This means that stuff like this <p>http://www.example.com/</p> won't be matched.

Changing the expression to
/(^|\s|>)(\b(https?):\/\/[\-A-Z0-9+&@#\/%?=~_|!:,.;]*[\-A-Z0-9+&@#\/%=~_|]\b)/ig
solves this specific case, but still doesn't fix things like "http://www.example.com".

I can't think of a good fix tha won't break the tests for images and anchors with the lack of lookbehinds in JS and my limited regex-fu.

Thoughts?

Edit: I just realized this will break the test for not affecting existing anchors. I'm back to the drawing board, then...

domain only regex

Hey guys, I'm not too good at these regex's but if I can figure it out I'll make a PR. If anyone can help let me know I'd like to allow the regex to also support a string that's domain only. Something like myawesomesite.com ...basically regardless if http or www is present any string that has .com will be autolinked.

What license is this released under?

I like that your library is short, sweet, and does just one thing. I have a project I am considering using this on, but depending on what license you choose I may have to keep looking or roll my own. No pressure though, do whatever is best for you & the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.