mark[lib

Damn fast easy marking with serializable selections.

Fork me on Github Download v0.10.0 @bowlingx

Try it

Start marking this paragraph as an example and use either enter or the button under this section to highlight the result.
Marklib supports highlighting/marking textnodes even if the DOM has been modified by another marking of Marklib. If you mark something on this page, it will be stored on your browsers local storage. Try to refresh the page and play a little bit :).

Show me the code

var selection = document.getSelection();
new Marklib.Rendering(document)
           .renderWithRange(selection.getRangeAt(0));

A second paragraph with some latin like text

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolorasit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.


Marklib depends on zero libraries and is just around 4.5kb compressed

npm install --save-dev marklib