Sun Aug 28 20:08:19 2022, comment #6:
Sure, just define the environment in this way in the document:
%%%%%%%%%%%%%%%%%%
\documentclass{article}
\NewDocumentEnvironment{foo}{+b}{}{}
\NewDocumentEnvironment{latexenv}{}{}{}
\long\def\FooCmd #1\EndFooCmd{}
\begin{document}
normal text
\begin{foo}
<p dir="auto">The following code shows the concept:</p>
<p dir="auto">This is another paragraph</p>
\end{foo}
normal text
\begin{latexenv}
$$E = mc^2$$ And this is \textit{latex}.
\end{latexenv}
\FooCmd
<p dir="auto">The following code shows the concept:</p>
<p dir="auto">This is another paragraph</p>
\EndFooCmd
\end{document}
%%%%%%%%%%%%%%%%%%%
And then redefine it to eat the argument in the configuration file:
%%%%%%%%%%%%%%%%
\Preamble{xhtml}
\ScriptEnv{foo}
{\ifvmode\IgnorePar\fi\EndP\NoFonts\hfill\break }
{\EndNoFonts }
\ScriptCommand{\FooCmd}
{\ifvmode\IgnorePar\fi\EndP\NoFonts\hfill\break }
{\EndNoFonts }
\RenewDocumentEnvironment{latexenv}{+b}{}{}
\begin{document}
\EndPreamble
%%%%%%%%%%%%%%%%
|