From 05ae46c38043007bb8c36b084cfa09e4966fd7cc Mon Sep 17 00:00:00 2001 From: Canhua Li Date: Wed, 14 Sep 2022 10:58:49 -0700 Subject: [PATCH] prefix adaptivecards# for ttpolicy --- source/nodejs/adaptivecards/src/card-elements.ts | 4 ++-- source/nodejs/adaptivecards/src/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/nodejs/adaptivecards/src/card-elements.ts b/source/nodejs/adaptivecards/src/card-elements.ts index 950833c340..7a634ac9f5 100644 --- a/source/nodejs/adaptivecards/src/card-elements.ts +++ b/source/nodejs/adaptivecards/src/card-elements.ts @@ -1109,7 +1109,7 @@ export class TextBlock extends BaseTextBlock { // Markdown processing is handled outside of Adaptive Cards. It's up to the host to ensure that markdown is safely // processed. private static readonly _ttMarkdownPolicy = window.trustedTypes?.createPolicy( - "markdownPassthroughPolicy", + "adaptivecards#markdownPassthroughPolicy", { createHTML: (value) => value } ); @@ -1118,7 +1118,7 @@ export class TextBlock extends BaseTextBlock { // _originalInnerHtml so that we can restore/recalculate truncation later if space availability has changed (see // TextBlock.restoreOriginalContent()) private static readonly _ttRoundtripPolicy = window.trustedTypes?.createPolicy( - "restoreContentsPolicy", + "adaptivecards#restoreContentsPolicy", { createHTML: (value) => value } ); diff --git a/source/nodejs/adaptivecards/src/utils.ts b/source/nodejs/adaptivecards/src/utils.ts index f12918373f..7ac662fc4a 100644 --- a/source/nodejs/adaptivecards/src/utils.ts +++ b/source/nodejs/adaptivecards/src/utils.ts @@ -190,7 +190,7 @@ export function truncateText(element: HTMLElement, maxHeight: number, lineHeight * TextBlock.truncateIfSupported}), but had a bug where it might actually pass through an element * for which innerHTML yielded actual HTML (since fixed). */ -const ttDeprecatedPolicy = window.trustedTypes?.createPolicy("deprecatedExportedFunctionPolicy", { +const ttDeprecatedPolicy = window.trustedTypes?.createPolicy("adaptivecards#deprecatedExportedFunctionPolicy", { createHTML: (value) => value });