monaco-editor/website/playground/new-samples/creating-the-editor/syntax-highlighting-for-htm.../sample.js

5 lines
221 B
JavaScript

// The colorizeElement-function will read the data-lang-attribute
// from the element to select the correct language mode. In this
// sample it is text/css.
monaco.editor.colorizeElement(document.getElementById('code'));