diff --git a/example/backend/request.js b/example/backend/request.js index 6d79027..9739bf7 100644 --- a/example/backend/request.js +++ b/example/backend/request.js @@ -65,7 +65,7 @@ function fetchParamsFromInit(init) { headers.set('origin', HOST_ORIGIN); return { method: init.method, - body: init.body, + body: init.body ? new URLSearchParams(init.body) : null, headers, redirect: 'error', credentials: 'omit', diff --git a/example/frontend/tester/index.js b/example/frontend/tester/index.js index 35ca697..f9bd548 100644 --- a/example/frontend/tester/index.js +++ b/example/frontend/tester/index.js @@ -25,6 +25,7 @@ window.ampContainerConfig = Object.assign( imageProxyURL: process.env.CONFIG_IMAGE_PROXY_URL, xhrProxyURL: process.env.CONFIG_XHR_PROXY_URL, templateProxyURL: process.env.CONFIG_TEMPLATE_PROXY_URL, + transformTemplateProxyOutput: true, linkRedirectURL: process.env.CONFIG_LINK_REDIRECT_URL, loadTimeout: 3000, }, diff --git a/example/package.json b/example/package.json index 4d6c200..63f1ab3 100644 --- a/example/package.json +++ b/example/package.json @@ -9,7 +9,7 @@ "parcel-bundler": "^1.12.4" }, "scripts": { - "test": "jest --forceExit" + "test": "jest --forceExit --runInBand" }, "alias": { "@ampproject/email-viewer": ".." diff --git a/src/framecontainer/rendering-modules/ViewerRenderProxy.ts b/src/framecontainer/rendering-modules/ViewerRenderProxy.ts index 601fae6..f99ab7a 100644 --- a/src/framecontainer/rendering-modules/ViewerRenderProxy.ts +++ b/src/framecontainer/rendering-modules/ViewerRenderProxy.ts @@ -4,7 +4,11 @@ import { parseHTMLFragment, serializeHTML, postJSON } from '../../util'; import { transformingModules } from '../../preprocessing/preprocessing-modules/index'; import { Config } from '../../config'; -const TEMPLATE_TRANSFORMING_MODULES = ['HyperlinkRewrite', 'ImageURLRewrite']; +const TEMPLATE_TRANSFORMING_MODULES = [ + 'CSS', + 'HyperlinkRewrite', + 'ImageURLRewrite', +]; /** * Proxies XHR requests that include mustache template rendering coming from the diff --git a/src/preprocessing/preprocessing-modules/CSS/whitelist.ts b/src/preprocessing/preprocessing-modules/CSS/whitelist.ts index 5171776..a1b24e8 100644 --- a/src/preprocessing/preprocessing-modules/CSS/whitelist.ts +++ b/src/preprocessing/preprocessing-modules/CSS/whitelist.ts @@ -61,8 +61,10 @@ export const ALLOWED_PROPERTIES_WITH_URL = new Set([ ]); export const ALLOWED_PROPERTIES = new Set([ + '-moz-appearance', '-webkit-appearance', '-webkit-tap-highlight-color', + 'align-content', 'align-items', 'align-self', 'appearance', @@ -158,6 +160,7 @@ export const ALLOWED_PROPERTIES = new Set([ 'font-variant-numeric', 'font-variation-settings', 'font-weight', + 'gap', 'grid', 'grid-area', 'grid-auto-columns', @@ -231,6 +234,7 @@ export const ALLOWED_PROPERTIES = new Set([ 'resize', 'richness', 'right', + 'row-gap', 'speak', 'speak-header', 'speak-numeral',