mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
The URL detector stripped a single trailing punctuation char unconditionally, which dropped the closing ")" from legitimate URLs such as https://en.wikipedia.org/wiki/Bitcoin_(disambiguation). Make the trailing strip balance-aware: a trailing ")", "}" or "]" is kept when the URL contains its matching opener (balanced), and only stripped when it is unbalanced wrapping/sentence punctuation (e.g. "(see example.com)" or "http://test.com)"). Commas without surrounding spaces were already kept inside paths; this also adds "]" to the begin/end punctuation sets so an unbalanced bracket is handled symmetrically with parens and braces. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzZzVcMcuzjSdhD3xqCE87