Skip to content

Commit

Permalink
refactor: tweaks shared namespace string for svg and math for reduced…
Browse files Browse the repository at this point in the history
… size
  • Loading branch information
usualoma committed Jun 9, 2024
1 parent 6d89cf1 commit c0fade3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jsx/dom/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const eventAliasMap: Record<string, string> = {
} as const

const nameSpaceMap: Record<string, string> = {
svg: 'http://www.w3.org/2000/svg',
math: 'http://www.w3.org/1998/Math/MathML',
svg: '2000/svg',
math: '1998/Math/MathML',
} as const

const skipProps: Set<string> = new Set(['children'])
Expand Down Expand Up @@ -511,7 +511,7 @@ export const buildNode = (node: Child): Node | undefined => {
} else {
const ns = nameSpaceMap[(node as JSXNode).tag as string]
if (ns) {
;(node as NodeObject).n = ns
;(node as NodeObject).n = `http://www.w3.org/${ns}`
nameSpaceContext ||= createContext('')
;(node as JSXNode).props.children = [
{
Expand Down

0 comments on commit c0fade3

Please sign in to comment.