(function registerOnepageModule(global) { 'use strict'; if (!global.ModuleRegistry) { throw new Error('ModuleRegistry 未初始化'); } const HTML_FENCE = /```(?:html|htm)?\s*([\s\S]*?)```/i; const START_PATTERN = /```(?:html|htm)/i; const parseResponse = (content = '') => { const text = typeof content === 'string' ? content : String(content || ''); const match = text.match(HTML_FENCE); if (match) { const beforeText = text.substring(0, match.index).trim(); const afterText = text .substring(match.index + match[0].length) .trim(); return { htmlContent: match[1].trim(), beforeText, afterText }; } const fallback = text.trim(); if (!fallback) { return { htmlContent: '', beforeText: '', afterText: '' }; } const htmlIndex = text.search(/