Overriding the characters for beginning and ending smart quotes
#138
Closed
opened 8 years ago by saadatm
·
4 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
I am playing with Pollen for making a book in Urdu, which is a right-to-left (RTL) language.
When using Pollen's
smart-quotes
function, the quotes (obviously) come off wrong, because for Urdu (or for other RTL languages), their order should be opposite to what works with American English (i.e.”
should be the beginning quote and“
should be the ending one).So I was wondering if some setup values for quotes could be introduced, which the users can then override for specifying the characters for single/double beginning/ending quotes. Besides RTL languages, these could also be useful for a variety of other quote combinations.
Certainly it would be easy to update
smart-quotes
to accept optional arguments that let you set the replacements. Would that suffice?(I try to mint new setup values sparingly. They’re necessary for situations where a value needs to be used in multiple, difficult-to-reach places in the code. But
smart-quotes
, by contrast, is used directly in a decoder, so it seems simpler to just change its interface.)Makes sense. Changing the interface of
smart-quotes
to accept optional arguments can work too, yes.However, being a Racket newbie, here's a follow-up question: how can I pass arguments to
smart-quotes
(or any other function) while building atxexpr
like below?Would I have to do something like this?
Yes, exactly — make a helper function that sets the extra arguments.
All right. Thanks. :-)