fix backtick regex: prevent matching across newlines
This commit is contained in:
parent
93c9bd995e
commit
9f365f49b0
|
|
@ -523,7 +523,7 @@ ApplicationWindow {
|
|||
// Escape HTML entities first
|
||||
let escaped = text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
||||
// 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
|
||||
|
|
|
|||
Reference in New Issue