Skip to content
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: [#9441] Multi-line SSML causes escaping issues #9444

Merged
merged 14 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading