headings are numbered when converting docx to html

I’m working on a service for converting documents to html.

The command I’m using is libreoffice --convert-to html document.docx.
The test document is very simple - a heading and some normal text below it.

The problem is that in the converted file the heading is placed inside an ordered list, which results in number being placed in front of the heading. I tried this with versions 6.1 and 5.1 and the results is the same.

Also tried File > Export from the gui and the result did not have the number in front of the heading, but when I tried File > Preview in Web Browser - the result was the same as using --convert-to.

So, is there a way to achieve the same results using --convert-to as File > Export?

Html or xhtml? You may have more luck with the latter. But honestly, converting from one foreign format to another foreign format is dangerous.

it’s html (see the command), but the same thing happens with xhtml - I didn’t get the dangerous part tho

Same here, I am also running into this exact problem! @yasko did you find any solution?