Omikhleia/markdown.sile

Language specific smart quotes

Omikhleia opened this issue · 1 comments

Both pandocast and markdown support smart single and double quotes, but they replace " by English quotation marks.

Some languages have different preferences for quotation marks, see e.g. https://en.wikipedia.org/wiki/Quotation_mark#Summary_table

This should perhaps be implemented, i.e. using appropriate single or double quotation marks depending on the (current) language

  • Possibly in a specific dependency packages ("smartquotes" ?) for re-usability elsewhere
  • Perhaps using Fluent, but that might be an overkill?

E.g.

::: { lang=de }
Lorem "dolor"
:::

Should output Lorem „dolor“ rather than Lorem “dolor”

This could really improve typesetting (as those characters are not easily available from the keyboard, and this is the very rationale behind "smart" quotes).

Caveat: Some languages allow more than one way, and country code (as used by SILE, e.g. fr) are not always sufficient.

See also https://github.com/pandoc/lua-filters/blob/master/pandoc-quotes.lua/pandoc-quotes.lua which does this (for Pandoc) using a custom Lua filter.