1.0.3 • Published 9 years ago

ldt v1.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

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.

npm install ldt

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