Skip to content

Fix SSML stripping inside tags#1103

Closed
DaTeVo wants to merge 3 commits into
brailcom:masterfrom
DaTeVo:fix/module-strip-ssml-tag
Closed

Fix SSML stripping inside tags#1103
DaTeVo wants to merge 3 commits into
brailcom:masterfrom
DaTeVo:fix/module-strip-ssml-tag

Conversation

@DaTeVo

@DaTeVo DaTeVo commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Fix module_strip_ssml() to ignore XML entities inside SSML tags.

Previously:

<tag attr="Tom &amp; Jerry">Hello</tag>

produced:

&Hello

It now produces:

Hello

Signed-off-by: DaTeVo <voeltemata@gmail.com>
@sthibaul

Copy link
Copy Markdown
Collaborator

Thanks for spotting this!

I'm thinking that the loop could instead be reworked a bit. I was actually surprised that it was including i == len. We don't actually need that, but we need to terminate the out string. It seems to me we should rather simplify the loop:

  • use i<len in the for loop,
  • add out[n++] = 0 after the loop to terminate the out string,
  • and then we can just introduce if (omit) continue; where you added your if, and remove the last if, to just copy one character when it's not a known ssml entity.

@DaTeVo

DaTeVo commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the review. I will take care of it on Wednesday.

Signed-off-by: DaTeVo <voeltemata@gmail.com>
Comment thread src/modules/module_utils.c Outdated
Comment thread src/modules/module_utils.c Outdated
Co-authored-by: Jean-François David <jeanfrancoismanutea@gmail.com>
@sthibaul

Copy link
Copy Markdown
Collaborator

squashed and pushed, thanks!

@sthibaul sthibaul closed this Jun 17, 2026
@DaTeVo DaTeVo deleted the fix/module-strip-ssml-tag branch June 17, 2026 23:30
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.

3 participants