mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-19 03:03:39 +09:00
Backport #39337 by @nschloe Follow-up to https://github.com/go-gitea/gitea/pull/38034. bluemonday only keeps an element without attributes if it was registered via `AllowNoAttrs`. The MathML rules only used `AllowAttrs(...).OnElements(...)`, so plain `<mi>x</mi>`, `<mrow>`, `<msqrt>` and friends were stripped to bare text. Since real-world MathML is almost entirely attribute-less elements, nearly every formula collapsed. The existing test missed it because its only case gave every element an attribute. Also fills the remaining gaps against MathML Core (https://www.w3.org/TR/mathml-core/): `rowspan` on `mtd` alongside `columnspan`, the `maction` element with `actiontype` and `selection`, and the reserved global attributes `intent` and `arg`. Tests cover attribute-less round-trips, table cell spans, and `maction` with `intent`/`arg`. Co-authored-by: Nico Schlömer <nschloe@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>