From 5bf7d31aedcf97fcbf10570fd52a58beab7993e4 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Fri, 10 May 2024 20:37:33 -0500 Subject: [PATCH 1/3] fix: Ensure `cellPadding`, `cellSpacing`, and `useMap` are lower-cased --- src/lib/util.js | 2 +- test/utils.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/util.js b/src/lib/util.js index 55fc0b1e..57e69bae 100644 --- a/src/lib/util.js +++ b/src/lib/util.js @@ -1,7 +1,7 @@ export const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/; export const UNSAFE_NAME = /[\s\n\\/='"\0<>]/; export const NAMESPACE_REPLACE_REGEX = /^(xlink|xmlns|xml)([A-Z])/; -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|readO|rowS|spellC|src[A-Z]|tabI|item[A-Z]/; +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|readO|rowS|spellC|src[A-Z]|tabI|useM|item[A-Z]/; 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/; // DOM properties that should NOT have "px" added when numeric diff --git a/test/utils.js b/test/utils.js index d0438a34..2581b0cd 100644 --- a/test/utils.js +++ b/test/utils.js @@ -297,8 +297,8 @@ export const htmlAttributes = { autoFocus: 'autofocus', autoPlay: 'autoplay', capture: 'capture', - cellPadding: 'cellPadding', - cellSpacing: 'cellSpacing', + cellPadding: 'cellpadding', + cellSpacing: 'cellspacing', charSet: 'charset', challenge: 'challenge', checked: 'checked', @@ -412,7 +412,7 @@ export const htmlAttributes = { target: 'target', title: 'title', type: 'type', - useMap: 'useMap', + useMap: 'usemap', value: 'value', volume: 'volume', width: 'width', From 62c16b760dafec55bd87c36c39c56e6495fea966 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Fri, 10 May 2024 20:40:44 -0500 Subject: [PATCH 2/3] docs: Add changeset --- .changeset/gorgeous-eyes-cheer.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/gorgeous-eyes-cheer.md diff --git a/.changeset/gorgeous-eyes-cheer.md b/.changeset/gorgeous-eyes-cheer.md new file mode 100644 index 00000000..cc85c9d5 --- /dev/null +++ b/.changeset/gorgeous-eyes-cheer.md @@ -0,0 +1,5 @@ +--- +'preact-render-to-string': patch +--- + +Ensure `cellPadding`, `cellSpacing`, and `useMap` are serialized to lower case From 77bd64028edc2e247a0babf3ca03d1346dd5df54 Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Sat, 11 May 2024 00:48:09 -0500 Subject: [PATCH 3/3] Update src/lib/util.js --- src/lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/util.js b/src/lib/util.js index c1c63d57..fd86e5d6 100644 --- a/src/lib/util.js +++ b/src/lib/util.js @@ -1,7 +1,7 @@ export const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/; export const UNSAFE_NAME = /[\s\n\\/='"\0<>]/; export const NAMESPACE_REPLACE_REGEX = /^(xlink|xmlns|xml)([A-Z])/; -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]/ +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]/; 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/; // DOM properties that should NOT have "px" added when numeric