fix: replace JS lookbehind regex (Safari compat) in markdown renderer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -893,8 +893,8 @@ function renderMd(text) {
|
||||
s = s.replace(/`([^`]+)`/g, '<code>$1</code>');
|
||||
// Bold: **...**
|
||||
s = s.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>');
|
||||
// Italic: *...*
|
||||
s = s.replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g, '<em>$1</em>');
|
||||
// Italic: *...* (single asterisk, not double)
|
||||
s = s.replace(/([^*]|^)\*([^*]+?)\*([^*]|$)/g, '$1<em>$2</em>$3');
|
||||
// Headers: ### ... (at line start)
|
||||
s = s.replace(/^### (.+)$/gm, '<h3>$1</h3>');
|
||||
s = s.replace(/^## (.+)$/gm, '<h2>$1</h2>');
|
||||
|
||||
Reference in New Issue
Block a user