diff --git a/.changeset/sweet-donkeys-film.md b/.changeset/sweet-donkeys-film.md new file mode 100644 index 000000000..9186f7b2a --- /dev/null +++ b/.changeset/sweet-donkeys-film.md @@ -0,0 +1,5 @@ +--- +'@emotion/serialize': patch +--- + +Fixed the issue with incorrectly throwing errors on valid content values containing `open-quote`. diff --git a/packages/css/test/__snapshots__/warnings.test.js.snap b/packages/css/test/__snapshots__/warnings.test.js.snap index 937a9da85..036eeb043 100644 --- a/packages/css/test/__snapshots__/warnings.test.js.snap +++ b/packages/css/test/__snapshots__/warnings.test.js.snap @@ -4,7 +4,6 @@ exports[`does not warn when valid values are passed for the content property 1`] .emotion-0 { content: normal; content: none; - content: counter; content: open-quote; content: close-quote; content: no-open-quote; @@ -22,6 +21,7 @@ exports[`does not warn when valid values are passed for the content property 1`] content: counter(chapter_counter); content: counters(section_counter, "."); content: attr(value string); + content: open-quote counter(chapter_counter); }
{ diff --git a/packages/react/__tests__/__snapshots__/warnings.js.snap b/packages/react/__tests__/__snapshots__/warnings.js.snap index 64d4331f8..467e6d8aa 100644 --- a/packages/react/__tests__/__snapshots__/warnings.js.snap +++ b/packages/react/__tests__/__snapshots__/warnings.js.snap @@ -4,7 +4,6 @@ exports[`does not warn when valid values are passed for the content property 1`] .emotion-0 { content: normal; content: none; - content: counter; content: open-quote; content: close-quote; content: no-open-quote; @@ -22,6 +21,7 @@ exports[`does not warn when valid values are passed for the content property 1`] content: counter(chapter_counter); content: counters(section_counter, "."); content: attr(value string); + content: open-quote counter(chapter_counter); }
{ diff --git a/packages/serialize/src/index.js b/packages/serialize/src/index.js index 13334e081..58d30954c 100644 --- a/packages/serialize/src/index.js +++ b/packages/serialize/src/index.js @@ -61,19 +61,8 @@ let processStyleValue = ( } if (process.env.NODE_ENV !== 'production') { - let contentValuePattern = /(attr|calc|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(/ - let contentValues = [ - 'normal', - 'none', - 'counter', - 'open-quote', - 'close-quote', - 'no-open-quote', - 'no-close-quote', - 'initial', - 'inherit', - 'unset' - ] + let contentValuePattern = /(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/ + let contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'] let oldProcessStyleValue = processStyleValue