executablebooks / MyST-Parser

An extended commonmark compliant parser, with bridges to docutils/sphinx
https://myst-parser.readthedocs.io
MIT License
735 stars 194 forks source link

Specify the first- and second-level quotes for the smartquotes extension #424

Open jppellet opened 3 years ago

jppellet commented 3 years ago

Description / Summary

The smartquotes extension will output curly quotes “” and ‘’ instead of "" and '', which is great. But not all languages use these quotes. It would be great to have a way to specify them.

Value / benefit

Better support for non-English languages

Implementation details

Custom quotes can directly be passed to the md instance as markdown-it supports this. The "quotes" option of md is an array of four strings that specify opening and closing first- and second-level string. For instance, it could be set to ['«\u202F', '\u202F»', '“', '”'] for French.

Tasks to complete

No response

welcome[bot] commented 3 years ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

chrisjsewell commented 3 years ago

Heya, yeh cheers it should be quite easy to add to https://github.com/executablebooks/MyST-Parser/blob/be4838c35d374a51427a92a2736b29a9abc018d4/myst_parser/main.py#L31

Kamik423 commented 10 months ago

Ideally it should be configured according to the language set in sphinx.