Closed mbakeranalecta closed 6 years ago
Obvious question: what should be the default. Off?
Note that if #98 is implemented this becomes moot since it will be explicit in the schema.
One consideration is that if the regurgitate function is used on a document that has smartquotes declaration set to yes, it should change it to no. This would avoid the need to escape all the straight quotes to preserve them.
It seems to me that this should be extensible/configurable the same way annotation lookup is post #140. It is really the same case -- shortcuts used in a particular document for markup convenience.
An argument in favor of requiring a smart quotes declaration in a document is that individual documents can differ in whether smart quotes are appropriate. While SAM does a good job of not applying smart quotes to codeblocks etc, there are still cases where they could change the meaning of a file. Therefore having them on globally for a parser run is not appropriate. We need to know if the document author intended to use smart quotes or not. Given this it seems most transparent to default smart quoted to off and to require a smart quotes declaration in the document to turn them on.
Regurgitate should always flip the smart quotes declaration to off, and should probably make it explicit even if there was no declaration to begin with.
The exact set of substitutions and patterns should not be part of the language specification. It should be up to the parser to decide what its default set of substitutions is. Users should be able to specify their own set of substitution rules.
Implemented in Revision ad4365064bdfe61fa43228991a31b3174feb2957
Perhaps instead of making smartquotes an optional feature of the parser, we should make it a declaration in the document. That way the processing of a document should be consistent.