-
Notifications
You must be signed in to change notification settings - Fork 683
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
fix(pagebuilder): Html content type unescapes when GraphQL does not #2283
fix(pagebuilder): Html content type unescapes when GraphQL does not #2283
Conversation
1bee42d
e30f3da
to
1bee42d
Compare
let html; | ||
if (node.dataset.decoded) { | ||
html = node.innerHTML; | ||
if (process.env.NODE_ENV !== 'production') { |
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.
I think we remove logs in production bundles anyways - shouldn't need to gate with a condition. If I'm wrong we probably have to go clean up our app :D
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.
We might, but I just wanted to be explicit. This is a pattern we ought to follow. We may later remove the drop_console in some cases!
|
Works fine. Tested this PR against -
|
* Removed cart and checkout routes from 6.0 branch. (#2255) * - Mock version in test so snaps dont fail during releases (#2266) - Fixup regex to handle line breaks * [security] minimist >= 1.2.2 (#2267) * Requires at least minimist 1.2.2 due to security vuln Signed-off-by: sirugh <[email protected]> * Switches to yarn and requires minimist 1.2.2 for security vuln Signed-off-by: sirugh <[email protected]> * v6.0.0-alpha.1 * v6.0.0-beta.1 * Jimothy/6.0 release notes (#2279) * Add unsorted PR list * Add items to separate lists * Finish organizing PRs in sections * Finish highlights * Remove entries that were part of previous releases * Update PageBuilder to Page Builder Co-authored-by: Devagouda <[email protected]> * fix(pagebuilder): Html content type unescapes content when GraphQL does not (#2283) Co-authored-by: Devagouda <[email protected]> * [PWA-479] Extension Files Missing From Packages (#2305) * Add extensible files and directories to published packages * Revert version bumps Co-authored-by: Devagouda <[email protected]> * v6.0.0-beta.2 * [bug]: Fix (remove) OOTB tests from scaffold (#2321) * Ignores buildpack and test directories during create-pwa Signed-off-by: sirugh <[email protected]> * Fix glob pattern to match sub directories AND contents Signed-off-by: sirugh <[email protected]> * Fixes tests and makes ignore pattern easier to construct Signed-off-by: sirugh <[email protected]> * [Doc] 6.0 release notes updates (#2323) * Add new PRs to changelog and update compatibility table * Fix wrong entry placement * v6.0.0-beta.3 * v6.0.0-rc.1 * v6.0.0 * Enable cart and checkout routes Co-authored-by: Revanth Kumar Annavarapu <[email protected]> Co-authored-by: Tommy Wiebell <[email protected]> Co-authored-by: Stephen <[email protected]> Co-authored-by: devops-pwa-codebuild <[email protected]> Co-authored-by: James Calcaben <[email protected]> Co-authored-by: James Zetlen <[email protected]>
Description
Due to an apparent regression in M2.3.5, the GraphQL API now passes HTML content (in CMS blocks, anyway) through at least one PageBuilder-related render. The effect is that HTML content nodes, whose content itself was HTML encoded (
<div>
became<div>
), was no longer HTML encoded. This broke the PageBuilder Html content type by stripping all HTML tags from it.The Html "config aggregator" was using
node.textContent
to get and unescape its HTML, but when GraphQL has already unescaped it, we must use innerHTML instead. This PR updates the config aggregator with that logic.Because the bug in MC-32787 may indicate a misconfiguration, the config aggregator logs a message in development mode.
Related Issue
Closes https://jira.corp.magento.com/browse/MC-32787.
Acceptance
Verification Stakeholders
@sirugh
@davemacaulay
@dpatil-magento
Specification
Verification Steps
MAGENTO_BACKEND_URL=<host>
a 2.3.4 instance.yarn run watch:venia
MAGENTO_BACKEND_URL=<host>
a 2.3.5 instanceyarn run watch:venia
develop
this formatting is bonkers.