+
+
+ {codeContent.trim()}
+
+
+
+ )
+ inCodeBlock = false
+ codeContent = ''
+ codeLang = ''
+ } else {
+ flushList()
+ flushAlert()
+ inCodeBlock = true
+ codeLang = trimmedLine.slice(3).trim()
+ }
+ return
+ }
+
+ if (inCodeBlock) {
+ codeContent += line + '\n'
+ return
+ }
+
+ // Alerts [!TIP], etc.
+ const alertMatch = trimmedLine.match(/^>\s*\[!(TIP|WARNING|IMPORTANT|NOTE|CAUTION)\]/)
+ if (alertMatch) {
+ flushList()
+ flushAlert()
+ inAlert = true
+ const type = alertMatch[1]
+ alertType = type === 'WARNING' || type === 'CAUTION' ? 'warning' :
+ type === 'IMPORTANT' ? 'error' :
+ type === 'TIP' ? 'success' : 'info'
+ alertTitle = type
+ return
+ }
+
+ if (inAlert) {
+ if (trimmedLine.startsWith('>') || trimmedLine === '') {
+ const content = trimmedLine.replace(/^>\s*/, '')
+ if (content) alertLines.push(content)
+ return
+ } else {
+ flushAlert()
+ }
+ }
+
+ // Headers
+ if (trimmedLine.startsWith('#')) {
+ flushList()
+ flushAlert()
+ const level = trimmedLine.match(/^#+/)?.[0].length || 1
+ const content = trimmedLine.replace(/^#+\s*/, '')
+ const variant = level === 1 ? 'h4' : level === 2 ? 'h5' : 'h6'
+ elements.push(
+