From d11336dd3558372fc6f5774453cb2e72ac1d60eb Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Fri, 23 Jan 2026 21:29:46 +0800 Subject: [PATCH] debug: add detailed logging for WP-Markdown format --- footer.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/footer.php b/footer.php index 064dfe4..b448e53 100644 --- a/footer.php +++ b/footer.php @@ -211,15 +211,31 @@ let scriptContent = scriptElement.textContent; + console.log('=== WP-Markdown Debug ==='); + + console.log('Script content (first 300 chars):', scriptContent.substring(0, 300)); + + + let match = scriptContent.match(/document\.write\("(.*)"\)/s); if (match && match[1]) { + let rawCode = match[1]; + + console.log('Raw code (first 300 chars):', rawCode.substring(0, 300)); + + console.log('Contains literal backslash-n:', rawCode.includes('\\n')); + + console.log('Contains actual newline:', rawCode.includes('\n')); + + + // 解码转义字符 - let code = match[1] + let code = rawCode .replace(/\\n/g, '\n') @@ -235,6 +251,12 @@ + console.log('After decode (first 300 chars):', code.substring(0, 300)); + + console.log('After decode contains newline:', code.includes('\n')); + + + console.log('WP-Markdown Mermaid code found (length: ' + code.length + ')'); console.log('Contains newlines:', code.indexOf('\n') !== -1);