How to avoid paragraph enter

Hi,

I am updating a Word document using find and replace. I am changing a word with HTML data using build.insertHtml method and HTML sometimes inside a <p> tag. Because of that after the content adds an enter. Is there any way I can avoid that enter?

Thank you

@Gptrnt Please try using HtmlInsertOptions.REMOVE_LAST_EMPTY_PARAGRAPH.

builder.insertHtml("<p>some html</p>", HtmlInsertOptions.REMOVE_LAST_EMPTY_PARAGRAPH);