ldt
v1.0.3
Published
Lightweight decorator for textareas
Downloads
12
Readme
A fork of Lightweight Decorator for Textareas. Demo.
LDT aims to provide a simple, lightweight, and highly extensible alternative to existing in-browser live syntax highlighting solutions by leveraging clever CSS and native functionality.
var Decorator = require('ldt');
var ldt = Decorator(textarea, {
whitespace: /\s+/,
comment: /\/\/[^\r\n]*/,
other: /\S+/
});
.ldt .comment { color: silver; }
.ldt .string { color: green; }
.ldt .number { color: navy; }
.ldt .keyword { font-weight: bold; display: inline-block; margin-bottom: -1px; }
.ldt .variable { color: cyan; }
.ldt .define { color: blue; }
Fork changes
- highlighter is now placed over textarea, keeping it untouched
- ES6
- npm-package structure
- removed keybinder and selection helper
- tabs handling
- styles issues
- simplified API