mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-09 20:39:25 -03:00
fix(ui): escape HTML entities in parseMarkdown to prevent swallowed angle brackets
This commit is contained in:
@@ -731,9 +731,16 @@ export class UpdateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Simple markdown parser for changelog items
|
// Simple markdown parser for changelog items
|
||||||
|
// Simple markdown parser for changelog items
|
||||||
|
// Escape HTML entities first so angle brackets in content (e.g. `<lora:x>`)
|
||||||
|
// aren't swallowed by innerHTML's HTML parser as invalid tags
|
||||||
parseMarkdown(text) {
|
parseMarkdown(text) {
|
||||||
if (!text) return '';
|
if (!text) return '';
|
||||||
|
|
||||||
|
text = text.replace(/&/g, '&');
|
||||||
|
text = text.replace(/</g, '<');
|
||||||
|
text = text.replace(/>/g, '>');
|
||||||
|
|
||||||
// Handle bold text (**text**)
|
// Handle bold text (**text**)
|
||||||
text = text.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
|
text = text.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user