speechmarkdown/speechmarkdown-js

Support both double and single quotes

rmtuckerphx opened this issue · 1 comments

The audio tag supports both double and single quotes:

!['https://www.speechmarkdown.org/test.mp3']  // YES
!["https://www.speechmarkdown.org/test.mp3"]  // YES

But other tags such as emphasis, only support double quotes:

(text)[emphasis:"strong"]  // YES
(text)[emphasis:'strong']  // NO

I submitted a pull request that addresses this issue.

Including the single quote character in the ipa character set caused issues with parsing single-quoted strings. Removing the single quote character from single-quoted strings addresses the issue.

See update to SpeechMarkdownGrammar.ts

Also updated numerous voice, rate, and pitch tests to validate single quotes.

There is still an issue with using single quote characters in single-quoted IPA strings. For example:

I say, <phoneme alphabet="ipa" ph="'pi.kæn">pecan</phoneme>.   WORKS
I say, <phoneme alphabet='ipa' ph='\'pi.kæn'>pecan</phoneme>. DOES NOT WORK

However, the above sample didn't work previously.