Hello,
Sorry, but we don't see that the HTML you are using is following our suggestion: maybe you could add the following change to be able to set custom modifiers.
Anyway, the HTML you are using:
<phpdocx_bookmark data-name="scoobie" data-type="start" /><phpdocx_heading data-text="Scoobie doo" data-level="2" data-pStyle="Heading2" data-b="" data-sz="" data-fontSize="" data-color="" data-font="" /><phpdocx_bookmark data-name="scoobie" data-type="end" />
is applying a Heading2 style name. Does it exist in your DOCX? if a style doesn't exist, the default normal style is applied. For example, if you are using the default template included in phpdocx, you could use:
<phpdocx_bookmark data-name="scoobie" data-type="start" /><phpdocx_heading data-text="Scoobie doo" data-level="2" data-pStyle="Heading2PHPDOCX" data-b="" data-sz="" data-fontSize="" data-color="" data-font="" /><phpdocx_bookmark data-name="scoobie" data-type="end" />
or create a custom paragraph style using phpdocx.
But you shouldn't confuse styles tags/attributes and heading tags when creating contents. A DOCX can have a normal style and a heading level; for example, the HTML you are transforming generates a paragraph with an outline level (data-level="2") and a normal style (because Heading2 style name doesn't exist in your DOCX).
Regards.