speechmarkdown / speechmarkdown-js

Speech Markdown grammar, parser, and formatters for use with JavaScript.
MIT License
76 stars 16 forks source link

Ampersand leads to InvalidSsmlException #57

Closed beevelop closed 1 year ago

beevelop commented 3 years ago

Converting the following string

Hallo Wie gehts? & Was machst Du hier?

leads to the following InvalidSsmlException when trying to pass it to AWS Polly:

InvalidSsmlException: Invalid SSML request
    at Object.extractError (/app/node_modules/aws-sdk/lib/protocol/json.js:52:27)
    at Request.extractError (/app/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
    at Request.callListeners (/app/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/app/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/app/node_modules/aws-sdk/lib/request.js:688:14)
    at Request.transition (/app/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/app/node_modules/aws-sdk/lib/state_machine.js:14:12)

Is escaping "dangerous" characters like & something Speechmarkdown should deal with? Is this something the developer should sanitize prior to passing it to Speechmarkdown?

Further references