Skip to content

Commit 8f184ef

Browse files
authored
Merge pull request #353 from preactjs/fix/popover
fix: Ensure `popoverTarget` and `popoverTargetAction` are lower-cased
2 parents e2c8fa1 + 05ef584 commit 8f184ef

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.changeset/blue-moons-behave.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 `popoverTarget` and `popoverTargetAction` 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|readO|rowS|spellC|src[A-Z]|tabI|item[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]/;
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ export const htmlAttributes = {
375375
ping: 'ping',
376376
placeholder: 'placeholder',
377377
playsInline: 'playsinline',
378+
popoverTarget: 'popovertarget',
379+
popoverTargetAction: 'popovertargetaction',
378380
poster: 'poster',
379381
preload: 'preload',
380382
readonly: 'readonly',

0 commit comments

Comments
 (0)