Skip to content

fix(helpers): decode XML entities in ssml_to_deepgram - #842

Open
theluckystrike wants to merge 1 commit into
deepgram:mainfrom
theluckystrike:fix/ssml-unescape-xml-entities
Open

theluckystrike wants to merge 1 commit into
deepgram:mainfrom
theluckystrike:fix/ssml-unescape-xml-entities

Conversation

@theluckystrike

Copy link
Copy Markdown

Fixes #811.

ssml_to_deepgram() stripped SSML tags without decoding XML entities, leaving literal &amp;, &apos;, &quot;, and numeric character references in both plain text and <phoneme> word/ph values.

This change decodes XML entities with html.unescape() inside replace_phoneme() before building the pronunciation control, and unescapes plain text segments outside inline controls after stripping remaining tags.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ssml_to_deepgram leaves XML entities such as &amp; and &apos; in the TTS text

1 participant