Skip to content

Commit

Permalink
fix(helper/css): Update regex to match nonce attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
usualoma committed Nov 22, 2024
1 parent de64225 commit 2f06776
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helper/css/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const createCssContext = ({ id }: { id: Readonly<string> }): DefaultConte

const contextMap: WeakMap<object, usedClassNameData> = new WeakMap()

const replaceStyleRe = new RegExp(`(<style id="${id}">.*?)(</style>)`)
const replaceStyleRe = new RegExp(`(<style id="${id}"(?: nonce="[^"]*")?>.*?)(</style>)`)

const newCssClassNameObject = (cssClassName: CssClassNameCommon): Promise<string> => {
const appendStyle: HtmlEscapedCallback = ({ buffer, context }): Promise<string> | undefined => {
Expand Down

0 comments on commit 2f06776

Please sign in to comment.