mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 04:31:23 +00:00
Fix formatting (#22474)
This commit is contained in:
@@ -148,8 +148,14 @@ function replaceMarkers(content: string): string {
|
||||
const replacements: Array<{ start: number; end: number; value: string }> = [];
|
||||
// Match markers with or without id attribute (handles both legacy and spoofed markers)
|
||||
const patterns: Array<{ regex: RegExp; value: string }> = [
|
||||
{ regex: /<<<EXTERNAL_UNTRUSTED_CONTENT(?:\s+id="[^"]{1,128}")?\s*>>>/gi, value: "[[MARKER_SANITIZED]]" },
|
||||
{ regex: /<<<END_EXTERNAL_UNTRUSTED_CONTENT(?:\s+id="[^"]{1,128}")?\s*>>>/gi, value: "[[END_MARKER_SANITIZED]]" },
|
||||
{
|
||||
regex: /<<<EXTERNAL_UNTRUSTED_CONTENT(?:\s+id="[^"]{1,128}")?\s*>>>/gi,
|
||||
value: "[[MARKER_SANITIZED]]",
|
||||
},
|
||||
{
|
||||
regex: /<<<END_EXTERNAL_UNTRUSTED_CONTENT(?:\s+id="[^"]{1,128}")?\s*>>>/gi,
|
||||
value: "[[END_MARKER_SANITIZED]]",
|
||||
},
|
||||
];
|
||||
|
||||
for (const pattern of patterns) {
|
||||
|
||||
Reference in New Issue
Block a user