Code Monkey home page Code Monkey logo

ckeditor-autolink's Introduction

Autolink

Autolink is a plugin for CKEditor, used to generate a hyperlink automatically when you typing a URL-like string. For example, when you input a string like https://github.com, it convert it to a real hyperlink rather than plain text.

NOTE: To make this plugin works, you should type an extra character such as SPACE KEY or ENTER KEY.

Browsers supported: Chrome/Firefox/IE

How to use

  1. git clone this plugin repo:

    git clone https://github.com/Gnodiah/ckeditor-autolink.git autolink
  2. copy this plugin directory to your ckeditor's plugins directory:

    cd autolink
    cp -r plugins/autolink your_dir_path/ckeditor/plugins
  3. add this plugin to your ckeditor's config.js, like this:

    config.extraPlugins = 'autolink';

OK, now it works!

LICENSE

See LICENSE.txt

ckeditor-autolink's People

Contributors

gnodiah avatar skywickenden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ckeditor-autolink's Issues

Nothing to repeat error

I had issues, where, this line:

replace(new RegExp(fillChar, 'g'), '')

it was throwing invalid regex, nothing to repeat error.

a've made workaround, by replacing it with:

replace(/\s/g, "")

Firefox works on "key", not on "keypress"

I'm using Firefox 37 and plugin doesn't works in this browser because of listening event "keypress" besides of "key". Now Firefox support "key" and doesn't support "keypress".

if (CKEDITOR.env.webkit) {
   editor.on("key", function(e) { // This event now works in Firefox too
      if (e.data.keyCode === 32 || e.data.keyCode === 13) editor.autolink(e);
   });
} else {
   editor.document.on("keypress", function(e) { // It's not supported by current version of Fifrefox
      if (e.data.getKey() === 32 || e.data.getKey() === 13) editor.autolink(e);
   });
}

Final punctuation is included in href

I really like this plugin.

One small issue is that it includes a final "." at the end of the link.

For instance, if you type "Visit my website at www.asdf.com." the link will have the "." at the end which is incorrect.

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.