mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-22 14:28:12 +00:00
fix(feishu): address bot review feedback
- 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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user