You haven't provided a MWE, so here is some small sample:
\documentclass{article}
\RequirePackage{enumitem}
\newlist{dialog}{itemize}{1}
\setlist[dialog]{label=---,left = 0pt}
\begin{document}
\begin{dialog}
\item Hello World
\item Hello, hello
\end{dialog}
\end{document}
When you compile this example, this is the resulting HTML code you get:
<body>
— Hello World
— Hello, hello
</body>
As you can see, there are no HTML tags around your list, so it is rendered on one line in the browser. You need to provide a configuration for all custom lists, in order to insert suitable HTML elements.
As you use custom text for the label, you can use the <dl>
element.
All lists are configured using \ConfigureList
command. From the documentation:
\ConfigureList.....................5
#1 type of list (e.g., itemize, description, enumerate,
list, trivlist)
#2 before list
#3 after list
#4 before label
#5 after label
The configuration file can look like this:
\Preamble{xhtml}
\ConfigureList{dialog}
{\ifvmode\IgnorePar\fi\EndP\HCode{<dl class="dialog">}\par\ShowPar
\def\enddialoglabel{}
}
{\ifvmode\IgnorePar\fi\EndP\enddialoglabel\HCode{</dl>}}
{\enddialoglabel\HCode{<dt>}\def\enddialoglabel{\EndP\HCode{</dd>}}}
{\HCode{</dt><dd>}\par\ShowPar\AnchorLabel}
\Css{.dialog{display:grid;grid-template-columns: 1em 1fr;}}
\begin{document}
\EndPreamble
It creates <dl class="dialog">
element. There is a lot of commands used. \ifvmode\IgnorePar\fi\EndP
closes paragraphs before the list. We define the \enddialoglabel
command to insert closing tags for the previous item. It is used at the beginning of each item, so it is empty at first, and then redefined to insert the closing tag. \AnchorLabel
inserts link destinations for \label
commands.
We use the CSS grid to display label and text on the same line, because they are on separate lines by default.
Compile using:
make4ht -c mycfg.cfg filename.tex
This is the resulting HTML:
<body>
<dl class='dialog'> <dt>
— </dt><dd>
<a id='x1-2x'></a>
<!-- l. 7 --><p class='noindent'>Hello World
</p></dd><dt>
— </dt><dd>
<a id='x1-3x'></a>
<!-- l. 8 --><p class='noindent'>Hello, hello</p></dd></dl>
In the browser:
