diff --git a/.changeset/blue-moons-behave.md b/.changeset/blue-moons-behave.md new file mode 100644 index 00000000..497be8a8 --- /dev/null +++ b/.changeset/blue-moons-behave.md @@ -0,0 +1,5 @@ +--- +'preact-render-to-string': patch +--- + +Ensure `popoverTarget` and `popoverTargetAction` are serialized to lower case diff --git a/src/lib/util.js b/src/lib/util.js index 55fc0b1e..12b5a4cc 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]|^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]/; 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..cadfb55a 100644 --- a/test/utils.js +++ b/test/utils.js @@ -375,6 +375,8 @@ export const htmlAttributes = { ping: 'ping', placeholder: 'placeholder', playsInline: 'playsinline', + popoverTarget: 'popovertarget', + popoverTargetAction: 'popovertargetaction', poster: 'poster', preload: 'preload', readonly: 'readonly',