From 1bed7e56211699ab1f9c95204d429158338a1c78 Mon Sep 17 00:00:00 2001 From: Elarwei Date: Sat, 28 Feb 2026 12:15:48 +0800 Subject: [PATCH] fix(feishu): address bot review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - resolveUploadInput: remove length < 1024 guard on file path detection. Prefix patterns (isAbsolute / ~ / ./ / ../) already correctly distinguish file paths from base64 strings at any length. The old guard caused file paths ≥1024 chars to fall through to the base64 branch incorrectly. - parseColorMarkup: add comment clarifying that mismatched closing tags (e.g. [red]text[/green]) are intentional — opening tag style is applied, closing tag is consumed regardless of name. --- extensions/feishu/src/docx-color-text.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/feishu/src/docx-color-text.ts b/extensions/feishu/src/docx-color-text.ts index 3bc0c11a675..b25a3633553 100644 --- a/extensions/feishu/src/docx-color-text.ts +++ b/extensions/feishu/src/docx-color-text.ts @@ -55,7 +55,10 @@ interface Segment { */ export function parseColorMarkup(content: string): Segment[] { const segments: Segment[] = []; - // Match [tag]...[/tag] or plain text between tags + // Match [tag]...[/tag] or plain text between tags. + // The closing tag name is intentionally not validated against the opening tag: + // mismatched tags like [red]text[/green] are treated as [red]text[/red] — + // the opening tag's style is applied and the closing tag is consumed. const tagPattern = /\[([^\]]+)\](.*?)\[\/(?:[^\]]+)\]|([^[]+)/gs; let match;