colorizeModelLine
语法:
colorizeModelLine(model, lineNumber, tabSize?): string参数:
model: ITextModellineNumber:numbertabSize:number
返回值:
string描述:对指定的文本模型的指定行进行语法高亮处理
示例:
js
const model = editor.createModel('function add(a, b) { return a + b; }', 'text/javascript');
const html = editor.colorizeModelLine(model, 1, 4);
console.log(html);- 输出:

