fix(pdf): preprocess MathJax in post content before PDF generation

Integrates MathJax content preprocessing into the PDF generation function to ensure that mathematical expressions are accurately rendered in the generated PDFs. This resolves issues where mathematical notations in posts were not displayed correctly in the PDFs.
This commit is contained in:
Kumi 2024-08-03 15:23:50 +02:00
parent 02796a28d8
commit 9bf5f81c84
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -820,7 +820,7 @@ function handle_pdf_download()
$pdf->setTextColor(0);
$pdf->Ln(10);
$pdf->SetFont('helvetica', '', 12);
$pdf->writeHTML($post->post_content);
$pdf->writeHTML(preprocess_mathjax_content($post->post_content));
// Output PDF document
$pdf->Output(sanitize_title($post->post_title) . '.pdf', 'D');