From 5eaad3df1d2e7c1237a0e8c4fbbe94ef5a0ad429 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Sat, 12 Jun 2021 18:30:34 +0800 Subject: [PATCH] opt some --- plugin/local/code/inner.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index ba67a272..44821b4e 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -155,7 +155,13 @@ Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"], }).join("")) p.prefix && can.core.Item(p.prefix, function(pre, type) { - if (line.trim().indexOf(pre) == 0) { line = wrap(type, line) } + if (line.trim().indexOf(pre) == 0) { + line = wrap(type, line) + } else { + var ls = line.split(pre); if (ls.length > 1) { + line = ls[0] + wrap(type, pre + ls[1]) + } + } }) p.suffix && can.core.Item(p.suffix, function(pre, type) { if (line.endsWith(pre)) { line = wrap(type, line) }