fix(frontend): skip code spans when linking element names
prepareContent rewrites element names into [name](target) links on the raw message text, so names inside fenced code blocks and inline code were rewritten too, and so was content that gets wrapped as a code block via language.
It now walks the text line by line and only links names outside code: fenced blocks (``` or ~~~ at the start of a line, including behind > blockquote prefixes; an unclosed fence while streaming counts as code to the end) and inline backtick spans within a single line are left as is. When language wraps the content as code, nothing is linked. Anything not clearly code, like a stray backtick, is linked exactly as before.
I kept this as a text pass in prepareContent to keep the change small. Doing it as a remark plugin in Markdown.tsx would also cover the limitations below, but refElements would have to move to render time, and names written like Sources:source_1 get parsed by remark-directive before a plugin sees them, so it turned into a much larger change. Happy to go that way instead if you prefer.
Known limitations (same as before): fences inside list items indented 4+ spaces, indented code blocks without a fence, and inline code spans whose backticks are on different lines still get names linked.
Tests: cd frontend && pnpm test → 47 passed, 15 of them new in frontend/tests/prepareContent.spec.ts.
Fixes #3055
Summary by cubic
Fixes prepareContent corrupting element names in code blocks when linking them.
Now, names inside fenced (``` or ~~~) and single-line inline backtick code spans are left untouched, and linking is skipped entirely when content is wrapped as a code block via language. Frames are recognized behind blockquotes, and blockquote depth is handled correctly, including a bare > or no-prefix line closing the fence per CommonMark. Inline code uses CommonMark backslash escaping rules, only treating backticks backslash pairs as escaped.