How to use the format.unlink function in format

To help you get started, we’ve selected a few format examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lepture / ed / index.js View on Github external
e.preventDefault();
      toolbar._class.remove('ed-link-input-active');
      me.caret.restore();
      var url = input.value;
      var node = me.caret.parent();
      if (url) {
        if (!/https?:\/\//.test(url)) {
          url = 'http://' + url;
        }
        if (node.tagName.toLowerCase() === 'a') {
          node.href = url;
        } else {
          format.a(url);
        }
      } else {
        format.unlink();
      }
    }
  }
  events.bind(input, 'blur', linky);