Skip to content

Commit 28f127d

Browse files
committed
fix(compiler-core): math tag should use block
1 parent 6a370ec commit 28f127d

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

packages/compiler-core/src/transforms/transformElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export const transformElement: NodeTransform = (node, context) => {
117117
// updates inside get proper isSVG flag at runtime. (#639, #643)
118118
// This is technically web-specific, but splitting the logic out of core
119119
// leads to too much unnecessary complexity.
120-
(tag === 'svg' || tag === 'foreignObject'))
120+
(tag === 'svg' || tag === 'foreignObject' || tag === 'math'))
121121

122122
// props
123123
if (props.length > 0) {

packages/runtime-dom/src/nodeOps.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,44 +20,10 @@ export const nodeOps: Omit<RendererOptions<Node, Element>, 'patchProp'> = {
2020
},
2121

2222
createElement: (tag, namespace, is, props): Element => {
23-
// https://www.javatpoint.com/mathml-all-elements
24-
const allMathmlTags = [
25-
'maction',
26-
'math',
27-
'menclose',
28-
'merror',
29-
'mfenced',
30-
'mfrac',
31-
'mglyph',
32-
'mi',
33-
'mlabeledtr',
34-
'mmultiscripts',
35-
'mn',
36-
'mo',
37-
'mover',
38-
'mpadded',
39-
'mphantom',
40-
'mroot',
41-
'mrow',
42-
'ms',
43-
'mspace',
44-
'msqrt',
45-
'mstyle',
46-
'msub',
47-
'msubsup',
48-
'msup',
49-
'mtable',
50-
'mtd',
51-
'mtext',
52-
'mtr',
53-
'munder',
54-
'munderover',
55-
'semantics',
56-
]
5723
const el =
5824
namespace === 'svg'
5925
? doc.createElementNS(svgNS, tag)
60-
: namespace === 'mathml' || allMathmlTags.includes(tag)
26+
: namespace === 'mathml'
6127
? doc.createElementNS(mathmlNS, tag)
6228
: doc.createElement(tag, is ? { is } : undefined)
6329

0 commit comments

Comments
 (0)