The output option's "html" and "htmlAndMathml" typeset with KaTeX, which comark-mathml doesn't install. Without it, formulas are typeset as MathML, the default, and this issue says so. Install katex and put katex/dist/katex.css on the page, or drop the output option.
pnpm add kateximport "katex/dist/katex.css";
import math from "comark-mathml";
const plugins = [math({ output: "html" })];