fix backtick regex: prevent matching across newlines

This commit is contained in:
Levi Neely 2026-07-16 07:09:16 +02:00
parent 93c9bd995e
commit 9f365f49b0
1 changed files with 1 additions and 1 deletions

View File

@ -523,7 +523,7 @@ ApplicationWindow {
// Escape HTML entities first
let escaped = text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
// Inline code: `text` → monospace styled span
escaped = escaped.replace(/`([^`]+)`/g, '<code style="font-family:monospace;background:rgba(128,128,128,0.15);padding:1px 4px;border-radius:3px;">$1</code>')
escaped = escaped.replace(/`([^`\n]+)`/g, '<code style="font-family:monospace;background:rgba(128,128,128,0.15);padding:1px 4px;border-radius:3px;">$1</code>')
// Convert newlines to <br>
escaped = escaped.replace(/\n/g, '<br>')
// Match /absolute/path or /absolute/path:line