Skip to content

Commit

Permalink
chore: escape MSSL predefined characters in text (wxxxcxx#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>

0 comments on commit 91547d6

Please # to comment.