-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add usage of DynamiHTML in remix #1114
base: master
Are you sure you want to change the base?
Conversation
export function replaceDjangoUnicode(unicodeString: string) { | ||
return unicodeString | ||
.replaceAll(/\\u005C/g, "\\\\") | ||
.replaceAll(/\\u0027/g, `\\`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unicode escape sequence \u0027
represents a single quote character ('
), but this code incorrectly replaces it with a backslash (\
). The replacement string should be '
instead of \\
to maintain the original meaning of the text.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
__html: parsedLoaderOutput.dynamicBodyBeginning.map((dhtml) => | ||
replaceDjangoUnicode(dhtml) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array of strings needs to be concatenated to avoid unwanted commas in the rendered HTML. Consider updating to:
__html: parsedLoaderOutput.dynamicBodyBeginning.map((dhtml) => replaceDjangoUnicode(dhtml)).join('')
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
No description provided.