This is already wrong because we don't support <figure>, one of the possibilities.
Soon it will be figure or figure-inline (T118520: Use <figure-inline> instead of <span> for inline figures.)
We can just support figure, figure-inline, or span (we should do this fix before T118520 is deployed).