Skip to content

Commit

Permalink
fix: [#9441] Multi-line SSML causes escaping issues (#9444)
Browse files Browse the repository at this point in the history
* Remove line breaks from SSML tags

* Update yarn-berry.lock

* Update yarn-berry.lock files

* Update yarn-berry.lock

* Update yarn-berry file

* Fix hash

---------

Co-authored-by: tracyboehrer <[email protected]>
Co-authored-by: Chris Whitten <[email protected]>
Co-authored-by: Joel Mut <[email protected]>
Co-authored-by: Joel Mut <[email protected]>
  • Loading branch information
5 people authored May 16, 2024
1 parent 4447aca commit 407ce74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const getInitialItems = <T extends ArrayBasedStructuredResponseItem>(
const fixMultilineItems = (items: TemplateBodyItem[]) => {
return items.map((item) => {
if (item.kind === 'variation' && /\r?\n/g.test(item.value)) {
// if it's an SSML tag, remove the line breaks.
if (/^<speak/g.test(item.value.trim())) {
return {
...item,
value: item.value.replace(/[\r\n]+/g, ''),
};
}
return {
...item,
// Escape all un-escaped -
Expand Down
4 changes: 2 additions & 2 deletions extensions/azurePublish/yarn-berry.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ __metadata:

"@bfc/code-editor@file:../../Composer/packages/lib/code-editor::locator=azurePublish%40workspace%3A.":
version: 0.0.0
resolution: "@bfc/code-editor@file:../../Composer/packages/lib/code-editor#../../Composer/packages/lib/code-editor::hash=c0b75e&locator=azurePublish%40workspace%3A."
resolution: "@bfc/code-editor@file:../../Composer/packages/lib/code-editor#../../Composer/packages/lib/code-editor::hash=b4c0c5&locator=azurePublish%40workspace%3A."
dependencies:
"@emotion/react": ^11.1.3
"@emotion/styled": ^11.1.3
Expand All @@ -1973,7 +1973,7 @@ __metadata:
"@bfc/ui-shared": "*"
react: 16.13.1
react-dom: 16.13.1
checksum: cac54f344ec07fd53cf666252414dc50ebc096ff6d61b4e08c1689c52a6b88d20bce28e8547ce4002f084362bdd414465e9fdd71669bfe4d41ca21a511569e34
checksum: a87f49bddf7cd6eef842cc1a609c7cb276b51d33ffc7a467d46d236ff4e6211fb2c6c8e44b98895901966764d741c056e8114d6f28c70dd05436828cb7958d62
languageName: node
linkType: hard

Expand Down

0 comments on commit 407ce74

Please sign in to comment.