995b752e70
Per-domain thinking trees were interleaved with sliced analysis, so a finished reply still looked like unfinished checklists. One collapsed thinking panel and one full body restores the reading order. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import assert from "node:assert/strict";
|
||
import test from "node:test";
|
||
|
||
import { promoteDefinitionLists } from "../src/lib/chat-definition-lists.ts";
|
||
|
||
test("consecutive label-colon paragraphs become a markdown list", () => {
|
||
const promoted = promoteDefinitionLists([
|
||
"行运焦点:",
|
||
"",
|
||
"月亮行运三分本命太阳(orb 0.29°):情绪与精力契合。",
|
||
"",
|
||
"天王星行运三分本命月亮(orb 0.75°):突发灵感可能冒出来。",
|
||
"",
|
||
"海王星行运对本命月亮(orb 0.87°):注意信息模糊。",
|
||
].join("\n"));
|
||
assert.match(promoted, /^- \*\*月亮行运三分本命太阳(orb 0\.29°)\*\*:情绪与精力契合。$/m);
|
||
assert.match(promoted, /^- \*\*天王星行运三分本命月亮(orb 0\.75°)\*\*:突发灵感可能冒出来。$/m);
|
||
assert.match(promoted, /行运焦点:/);
|
||
assert.equal(promoted.includes("- **行运焦点**:"), false);
|
||
});
|
||
|
||
test("code fences and existing lists are left alone", () => {
|
||
const source = [
|
||
"```",
|
||
"标签:不要动",
|
||
"```",
|
||
"",
|
||
"- 已有列表:保持原样",
|
||
].join("\n");
|
||
assert.equal(promoteDefinitionLists(source), source);
|
||
});
|