Skip to content

Commit 8d4dbd6

Browse files
authored
Merge pull request #352 from preactjs/fix/cell-usemap
fix: Ensure `cellPadding`, `cellSpacing`, and `useMap` are lower-cased
2 parents 8f184ef + 77bd640 commit 8d4dbd6

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.changeset/gorgeous-eyes-cheer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'preact-render-to-string': patch
3+
---
4+
5+
Ensure `cellPadding`, `cellSpacing`, and `useMap` are serialized to lower case

src/lib/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;
22
export const UNSAFE_NAME = /[\s\n\\/='"\0<>]/;
33
export const NAMESPACE_REPLACE_REGEX = /^(xlink|xmlns|xml)([A-Z])/;
4-
export const HTML_LOWER_CASE = /^accessK|^auto[A-Z]|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|spellC|src[A-Z]|tabI|item[A-Z]/;
4+
export const HTML_LOWER_CASE = /^accessK|^auto[A-Z]|^cell|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|spellC|src[A-Z]|tabI|useM|item[A-Z]/;
55
export const SVG_CAMEL_CASE = /^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/;
66

77
// DOM properties that should NOT have "px" added when numeric

test/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ export const htmlAttributes = {
297297
autoFocus: 'autofocus',
298298
autoPlay: 'autoplay',
299299
capture: 'capture',
300-
cellPadding: 'cellPadding',
301-
cellSpacing: 'cellSpacing',
300+
cellPadding: 'cellpadding',
301+
cellSpacing: 'cellspacing',
302302
charSet: 'charset',
303303
challenge: 'challenge',
304304
checked: 'checked',
@@ -414,7 +414,7 @@ export const htmlAttributes = {
414414
target: 'target',
415415
title: 'title',
416416
type: 'type',
417-
useMap: 'useMap',
417+
useMap: 'usemap',
418418
value: 'value',
419419
volume: 'volume',
420420
width: 'width',

0 commit comments

Comments
 (0)