1
0
mirror of https://shylinux.com/x/volcanos synced 2025-05-09 22:28:10 +08:00
This commit is contained in:
harveyshao 2021-06-12 18:30:34 +08:00
parent e3bdf13cb5
commit 5eaad3df1d

View File

@ -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) }