Open-source AI browser agent for Chrome and Firefox (monorepo) π§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
fix(social-publish): make alt parsing linear
Barack Sokulluc0f47a77af9a
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.jsindex ef7ef5203..b6c6888d4 100644--- a/src/chrome/src/agent/agent.js+++ b/src/chrome/src/agent/agent.js@@ -25554,7 +25554,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout dconst quotedPattern = new RegExp(`${publishVerbPattern}[\\s\\S]*?(?:β([\\s\\S]+?)β|γ([\\s\\S]+?)γ|γ([\\s\\S]+?)γ|Β«([\\s\\S]+?)Β»|"([\\s\\S]+?)")`, 'iu');const singleQuotePattern = new RegExp(`${publishVerbPattern}[\\s\\S]*?(?:(?<!\\p{L})'([\\s\\S]+?)'(?!\\p{L}))`, 'iu');const colonPattern = new RegExp(`${publishVerbPattern}[\\s\\S]*?(?<!https?|ftp|sftp)(?:(?<!\\d)[:οΌ]|[:οΌ](?!\\d{2}))(?!\\/\\/)\\s*([\\s\\S]+)$`, 'iu');- const altTextMetadataPattern = /(?<![\p{L}\p{N}_])(?:attachment\s+)?(?:alt(?:ernative)?\s+text|image\s+alt\s+text|media\s+alt\s+text)\s*(?::|=)?\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|β[\s\S]*?β|Β«[\s\S]*?Β»|γ[\s\S]*?γ|γ[\s\S]*?γ)/giu;+ const altTextMetadataPattern = /(?<![\p{L}\p{N}_])(?:attachment\s+)?(?:alt(?:ernative)?\s+text|image\s+alt\s+text|media\s+alt\s+text)\s*(?::|=)?\s*(?:"(?:\\[^"\\]|[^"\\])*"|'(?:\\[^'\\]|[^'\\])*'|β[^β]*β|Β«[^Β»]*Β»|γ[^γ]*γ|γ[^γ]*γ)/giu;for (const candidateText of candidates) {// A quoted alt-text value describes an attachment; it is not the post// body merely because it follows the publish verb.diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.jsindex c0e061658..e72c891a0 100644--- a/src/firefox/src/agent/agent.js+++ b/src/firefox/src/agent/agent.js@@ -23161,7 +23161,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout dconst quotedPattern = new RegExp(`${publishVerbPattern}[\\s\\S]*?(?:β([\\s\\S]+?)β|γ([\\s\\S]+?)γ|γ([\\s\\S]+?)γ|Β«([\\s\\S]+?)Β»|"([\\s\\S]+?)")`, 'iu');const singleQuotePattern = new RegExp(`${publishVerbPattern}[\\s\\S]*?(?:(?<!\\p{L})'([\\s\\S]+?)'(?!\\p{L}))`, 'iu');const colonPattern = new RegExp(`${publishVerbPattern}[\\s\\S]*?(?<!https?|ftp|sftp)(?:(?<!\\d)[:οΌ]|[:οΌ](?!\\d{2}))(?!\\/\\/)\\s*([\\s\\S]+)$`, 'iu');- const altTextMetadataPattern = /(?<![\p{L}\p{N}_])(?:attachment\s+)?(?:alt(?:ernative)?\s+text|image\s+alt\s+text|media\s+alt\s+text)\s*(?::|=)?\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|β[\s\S]*?β|Β«[\s\S]*?Β»|γ[\s\S]*?γ|γ[\s\S]*?γ)/giu;+ const altTextMetadataPattern = /(?<![\p{L}\p{N}_])(?:attachment\s+)?(?:alt(?:ernative)?\s+text|image\s+alt\s+text|media\s+alt\s+text)\s*(?::|=)?\s*(?:"(?:\\[^"\\]|[^"\\])*"|'(?:\\[^'\\]|[^'\\])*'|β[^β]*β|Β«[^Β»]*Β»|γ[^γ]*γ|γ[^γ]*γ)/giu;for (const candidateText of candidates) {// A quoted alt-text value describes an attachment; it is not the post// body merely because it follows the publish verb.