Hello,
On the API documentation page of the method (https://www.phpdocx.com/api-documentation/templates/replace-variable-html-Word-document) you can read about the available replacement types:
type
The substitution type, it can be:
"block": the variable, together with its containing paragraph, is replaced by the HTML content.
"inline": only the variable is replaced by the inline HTML content.
A block replacement removes the paragraph content and add the new HTML (block and inline contents). An inline replacement keeps the existing contents in the paragraph of the placeholder but adds only the inline contents from the HTML. There's no replacement type to do an inline replacement keeping block contents from the HTML.
Regards.