Günter Milde - 2 days ago

Thanks for the report.

IMO, the issue is "SmartQuotes misclassifies an opening quote before non-ASCII punctuation when there are bracktes around".

Test sample:

The misclassification happens also in other cases:
  ('...') ("...") ('--') ("--") ('---') ("---") ASCII patterns

  ('…') ("…") ('–') ("–") ('—') ("—") ("—") Unicode punctuation


* No difference between single and double quotes
* No difference between smartquote patterns or direct Unicode input.

Word characters:
('a') ('b') ('c') ('D') ASCII
('ä') ('Ö') ('ß') ('λ') non-ASCII

ASCII punctuation and non-word characters:
('!') ('?') (';') (':') ('.') (',') ('/') ('#') ('+') ('-') ('*') ('=')
('^') ('"') ('%') ('$') but ('&')

non-ASCII punctuation:
('¡') ('¿') ('‧') ('‰') ('⁋') ('∀')


* ASCII punctuation (except the ampersand) is OK,
  non-ASCII punctuation is problematic.

OTOH, without brackets, everything is fine:
  '.' '&' '...' '--' '¡' '¿' '‧' '‰' '⁋'.

There are other misclassifications, e.g., the quote after an EM-DASH at the
end of a paragraph:

ASCII pattern ('---') ('---')

Unicode ('—') ('—')

I'm not sure if this is an issue worth fixing, [...]

Nor am I, "smartquotes" is intended as a simple helper and will always have its limitations (cf. caveats).