mPDF Manual – mPDF Variables

allow_html_optional_endtags

(mPDF >= 1.0)

Description

boolean allow_html_optional_endtags

When TRUE, mPDF will attempt to parse the input HTML allowing for omitted end-tags. Some end tags are optional in HTML 4 (see http://www.w3.org/TR/1998/REC-html40-19980424/index/elements.html). These include (not exclusively): P, LI, DD, DT, TR, TD

Values

$allow_html_optional_endtags = TRUE FALSE

Values

TRUE: DEFAULT Parse the input HTML allowing for omitted end-tags

FALSE: Expect well formed (X)HTML with closing tags on all elements.

Examples

Example #1

<?php

$mpdf = new mPDF();

$mpdf->allow_html_optional_endtags = true;

$mpdf->WriteHTML('<p>Hallo World');

$mpdf->WriteHTML('<p>Hallo World');

$mpdf->WriteHTML('<p>Hallo World');

$mpdf->Output();

?>