mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-28 08:26:48 +09:00
auto_link finds URLs and email addresses with regular expressions over the rendered html, which can't tell an attribute value from text, so it could put a link inside an attribute. Hand it each text node on its own, escaped the way the serializer writes text, after the final sanitize, so links only ever land between tags. Write the result with preserve_newline so a code block keeps its leading blank lines. Bump the presentation cache version so nothing rendered the old way is served again. Backport of7ea05e1,4e29c6eand9b271d0from #364. 1.5.2 has no plain-text fragment cache, so only the message partial's version moves.