Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
wrap the current selection with an element
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
History.md
Makefile
Readme.md
component.json
index.js

Readme.md

wrap-selection

Wrap the current selection with an element. It behaves a bit weirdly when the selection intersects other elements... notably paragraphs. If someone has a good fix for this, I'll buy you a beer.

Installation

Install with component(1):

$ component install bmcmahen/wrap-selection

Example

var wrap = require('wrap-selection');
var el = document.createElement('span');
el.className = 'bacon';
wrap(el);

License

MIT

Something went wrong with that request. Please try again.