mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 18:30:39 +09:00
fix(issues): normalize HTML entities in @mention tokens before agent lookup (#1255)
Rich-text comments store entities like   after @names; strip them before matching agents so issue_comment_mentioned and wake injection work. Made-with: Cursor
This commit is contained in:
parent
dfdd3784b9
commit
47449152ac
2 changed files with 35 additions and 1 deletions
24
server/src/__tests__/normalize-agent-mention-token.test.ts
Normal file
24
server/src/__tests__/normalize-agent-mention-token.test.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { normalizeAgentMentionToken } from "../services/issues.ts";
|
||||
|
||||
describe("normalizeAgentMentionToken", () => {
|
||||
it("strips hex numeric entities such as space ( )", () => {
|
||||
expect(normalizeAgentMentionToken("Baba ")).toBe("Baba");
|
||||
});
|
||||
|
||||
it("strips decimal numeric entities", () => {
|
||||
expect(normalizeAgentMentionToken("Baba ")).toBe("Baba");
|
||||
});
|
||||
|
||||
it("strips common named entities", () => {
|
||||
expect(normalizeAgentMentionToken("Baba ")).toBe("Baba");
|
||||
});
|
||||
|
||||
it("returns plain names unchanged", () => {
|
||||
expect(normalizeAgentMentionToken("Baba")).toBe("Baba");
|
||||
});
|
||||
|
||||
it("trims after stripping entities", () => {
|
||||
expect(normalizeAgentMentionToken("Baba  ")).toBe("Baba");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue