Skip to content

Javascript-mixed mode for CodeMirror, supporting HTML/CSS highlighting in javascript codes

License

Notifications You must be signed in to change notification settings

orionlee/codemirror-js-mixed

Repository files navigation

NPM version

Javascript-mixed mode for CodeMirror

A language mode for CodeMirror, support highlighting HTML/CSS in javascript codes.

Features

  • Detects and highlights HTML in strings / template strings. (for strings begin with a tag)
    • HTML, highlights inner CSS / Javascript as well, e.g., highlights CSS for the text in <style> tags.
  • Highlights CSS for userscript's GM_addStyle()
  • Highlights arbitrary template strings as HTML / CSS by prepending an inline /*html*/ and /*css*/ hint respectively.

screenshot

Installation

To add it to your project, assuming codemirror has been installed:

npm install codemirror-js-mixed