Update ssml.cleanse to stop removing spaces before decimals #236
Conversation
aminimalanimal
added
some commits
May 5, 2017
|
Apologies—I'm uncertain why the Travis CI build is failing. |
|
The build failure is clearly about the changed behavior, so please run and fix the tests and maybe add more? LMK if you need help. |
|
I just uploaded a change that passes the existing tests. Uncertain what the intention behind replacing |
|
btw, when I clicked on the travis-ci build bot earlier, it didn't provide me with any sort of failed test output like running |
ericblade
commented
May 5, 2017
•
|
umm.. a possible? point? might be that SSML is intended for the voice output, not the card output. Or is this some sort of auto-generated card, not a requested card? In any case, I think that Alexa takes hints from the output punctuation, so not sure why we're pulling things out of it .. Basically, I think I'm asking what is the point or purpose of this function? |
|
The way the change is implemented right now needs additional tests that would fail with the old code, please. Otherwise it's easy to reintroduce a regression. When I code reviewed this first the output changes in tests made sense, now they are back to the original version, which is probably not what was intended? |
|
@ericblade The |
|
@dblock Looking into... |
It seems to me like the expectations behind all existing tests are still valid, so I'm not sure what you mean. I'm still seeing the expected output that I made the change for (which broke the tests), and removing the space that was added while stripping the SSML tags un-broke the tests. I've added a test to prevent regression. Thanks for your patience and explanations in this matter. I haven't done much TDD, so the thought to add a test to ensure that my change stays in place didn't occur to me. |
|
Looks good, thanks. Merging. |
aminimalanimal commentedMay 5, 2017
•
edited
alexa-app was unexpectedly stripping spaces that occur before periods. Since periods are also decimals, this produced issues with the expected output of our bartender app's card text.
Things like:
were showing up as:
I think that this sort of cleansing should probably not be done at all, instead letting app developers to have control over their output, but this PR only removes the item that affected us. Perhaps the others will always be ideal to strip spaces for, but it's a hard thing to predict—after all, our use-case wasn't immediately obvious. :)