defines the content and look (font color, background color) of the text in the input
// code syntax highlighting
function highlight(code){
code = webix.template.escape(code);
code = code.replace(/var|const|let/g, "<span class='variable'>$&</span>");
code = code.replace(/function/g, "<span class='function'>$&</span>");
// ... other key words
return code;
}
webix.ui({
view:"texthighlight",
type:"textarea",
highlight:highlight
});
Do not try to use CSS rules for sizes and positioning (e.g. padding, margin, font-weight, font-size), because this will break positioning inside the text input.
.variable{
color:red;
}