Skip to content

Commit

Permalink
chore: escape MSSL predefined characters in text (#76)
Browse files Browse the repository at this point in the history
* chore: escape MSSL predefined characters in text

* chore: add " predefined character escape
  • Loading branch information
shenghuang147 authored Dec 8, 2023
1 parent 3f27db8 commit 91547d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ <h5 class="modal-title">阅读链接</h5>
}

function createSSML(text, voiceName) {
text = text.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('\'', '&apos;').replaceAll('"', '&quot;');
let ssml = '\
<speak xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="http://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" version="1.0" xml:lang="en-US">\
<voice name="'+ voiceName + '">\
Expand Down Expand Up @@ -238,4 +239,4 @@ <h5 class="modal-title">阅读链接</h5>
</script>
</body>

</html>
</html>

2 comments on commit 91547d6

@vercel
Copy link

@vercel vercel bot commented on 91547d6 Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ms-ra-forwarder – ./

ms-ra-forwarder-git-master-wxxxcxx.vercel.app
ms-ra-forwarder-wxxxcxx.vercel.app
ms-ra-forwarder.vercel.app

@xiao-132
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

竟发生了纠纷

Please sign in to comment.