Nested formatters break outside formatters
RokasVaitkevicius opened this issue · 7 comments
There is a bug, when speech markdown formatters are nested in one another, only inside formatters get parsed, while outside formatters are left as a plain text.
Example:
(break after this [0.2s] another break after this [0.2s])[rate:"slow"]
is parsed to:
break after this <break time="0.2s"/> another break after this <break time="0.2s"/>rate:"slow"
As you see prosody
tag is not added and formatter stays too. If I remove breaks from the text:
(break after this another break after this)[rate:"slow"]
it resolves to
<prosody rate="slow">break after this another break after this</prosody>
When left alone, prosody works.
I tried putting other formatters, not only breaks inside formatters and they didn't work correctly either.
For simplicity, the initial intention was to not support nesting. We can consider expanding the concept of sections to include additional (or maybe all) tags. Looking for feedback on this.
@rmtuckerphx Overall, ssml supports nested tags, why speechmarkdown shouldn't? Also, what do you mean by 'simplicity'? Is it library coding simplicity or speechmarkdown syntax simplicity that you are concerned with?
The primary users of speech markdown are content authors and designers and thirdly developers. Simplicity should always be framed with content authors in mind. It is true the SSML supports nesting. In some cases markdown also supports nesting, but it is towards markdown's simplicity that we should be leaning.
By allowing multiple tags in square braces, we remove the burden of nesting from the content author:
ex: My favorite chemical element is (Al)[sub:"aluminum";volume:"x-loud";rate:"slow";pitch:"low"]
Seems like the only issue might be with breaks. Trying to weigh which one would be better from a content author's perspective:
Option 1. (break after this [0.2s] another break after this [0.2s])[rate:"slow"]
Option 2. (break after this)[rate:"slow"] [0.2s] (another break after this)[rate:"slow"][0.2s]
My perspective is that Option 2 is simpler for content authors.
Would enjoy others to join in with their perspective.
Hullo. As a content creator, option 1 feels more intuitive to me and I nest tags fairly frequently (IPA combined with prosody is another good example), maybe worth asking a few others who write a lot of ssml what they think too?
@tomhewitson Thanks Tom for your feedback. You can already combine (which auto nests) IPA and prosody:
speech markdown: I say, (pecan)[ipa:"ˈpi.kæn";rate:"x-slow"].
converts to
SSML:
<speak>
I say, <prosody rate="x-slow"><phoneme alphabet="ipa" ph="ˈpi.kæn">pecan</phoneme></prosody>.
</speak>
Looks like there is no further conversation on this topic. Thanks for a good discussion and thanks for your involvement in this project.
I am open to nesting. That way those who want to use it can and those who don't are covered as well. We need someone to write the tests and implement.
Closing issue due to no activity.