fix(ticket-management): 标题分隔符改半角连字符 - —— 【域-闸门】(用户定:不用 /);splitTitle 与 rename 同步
This commit is contained in:
@@ -40,7 +40,7 @@ function mkApi(opt) {
|
||||
function splitTitle(title) {
|
||||
const brackets = []; let s = String(title || "").trim();
|
||||
while (s.startsWith("【")) { const e = s.indexOf("】"); if (e < 0) break; brackets.push(s.slice(1, e)); s = s.slice(e + 1).trim(); }
|
||||
const parts = brackets.length ? brackets[0].split("/").map(function (x) { return x.trim(); }) : [];
|
||||
const parts = brackets.length ? brackets[0].split("-").map(function (x) { return x.trim(); }) : [];
|
||||
return { brackets: brackets, parts: parts, rest: s };
|
||||
}
|
||||
function firstLine(body) { return String(body || "").split(NL)[0] || ""; }
|
||||
@@ -133,7 +133,7 @@ async function cmdRename(api, opt, n) {
|
||||
let inner = dom;
|
||||
if (opt.gate && opt.gate !== "可开工") {
|
||||
if (GATES.indexOf(opt.gate) < 0) { console.log("闸门不在词表:" + opt.gate); return 1; }
|
||||
inner = dom + "/" + opt.gate;
|
||||
inner = dom + "-" + opt.gate;
|
||||
}
|
||||
const title = "【" + inner + "】" + sp.rest;
|
||||
if (opt["dry-run"]) { console.log("[dry-run] " + r.j.title + " → " + title); return 0; }
|
||||
|
||||
Reference in New Issue
Block a user