From 5e30ad8eac80008cabbedf21d7f8f1a68958d692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 1 Sep 2026 15:28:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=9B=BA=20UI=20HTML=20=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E8=BD=AC=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 循环替换连续连字符,防止注释边界被提前闭合 --- .../src-tauri/src/ui_editor/html_renderer/assets.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/assets.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/assets.rs index b83ce6315..2ba1c5913 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/assets.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/assets.rs @@ -9,9 +9,10 @@ pub(super) fn font_face_rule( } pub(super) fn html_comment(label: &str, value: serde_json::Value) -> Markup { - let text = serde_json::to_string_pretty(&value) - .unwrap_or_else(|_| "{}".to_string()) - .replace("--", "- -"); + let mut text = serde_json::to_string_pretty(&value).unwrap_or_else(|_| "{}".to_string()); + while text.contains("--") { + text = text.replace("--", "- -"); + } PreEscaped(format!("")) }