diff --git a/src/lib/parser.ts b/src/lib/parser.ts index c908db5..5ec4cdd 100644 --- a/src/lib/parser.ts +++ b/src/lib/parser.ts @@ -1159,7 +1159,7 @@ function ensureAsciiDocHeader(content: string): string { if (lines[i].trim() === '') continue; if (lines[i].trim().startsWith('=')) { headerIndex = i; - console.debug('[Pharos] AsciiDoc document header:', lines[i].trim()); + break; } else { throw new Error('AsciiDoc document is missing a header at the top.'); @@ -1184,8 +1184,7 @@ function ensureAsciiDocHeader(content: string): string { lines.splice(headerIndex + 1, 0, ':doctype: book'); } - // Log the state of the lines before returning - console.debug('[Pharos] AsciiDoc lines after header/doctype normalization:', lines.slice(0, 5)); + return lines.join('\n'); } diff --git a/src/lib/utils/markup/advancedAsciidoctorPostProcessor.ts b/src/lib/utils/markup/advancedAsciidoctorPostProcessor.ts index 33f3a16..36657f9 100644 --- a/src/lib/utils/markup/advancedAsciidoctorPostProcessor.ts +++ b/src/lib/utils/markup/advancedAsciidoctorPostProcessor.ts @@ -43,18 +43,12 @@ function fixAllMathBlocks(html: string): string { // Unescape \$ to $ for math delimiters html = html.replace(/\\\$/g, '$'); - // DEBUG: Log the HTML before MathJax runs - if (html.includes('latexmath')) { - console.debug('Processed HTML for latexmath:', html); - } + // Block math: