mgmeyers / obsidian-smart-typography

Converts quotes to curly quotes, dashes to em dashes, and periods to ellipses
GNU General Public License v3.0
241 stars 11 forks source link

Trouble with accents #25

Open marekpola opened 2 years ago

marekpola commented 2 years ago

I am having trouble when writing letters with accents. Some letter can be typed via two keys . Example: to type letter ó you first press ' then o. However Smart-typography interprets the first pressing as a single opening quote character and changes it to the ‚ After pressing o the result is ‚ó
which is not what one would expect (as you have to delete the opening quote).

alexandergunnarson commented 11 months ago

Same thing happening to me.

jkurei commented 5 months ago

Another report of this happening. I love the extension but I can't write in Spanish with it.

To illustrate the issue, I'd usually type Aqu'i est'a la prueba, which would be rendered as Aquí está la prueba. With this extension enabled, I get Aqu’í est’á la prueba.

Quick video showing this. Notice I'm not typing the accent twice each time, only once.

https://github.com/mgmeyers/obsidian-smart-typography/assets/1428611/f51f3967-4762-4c02-919a-b648c3ce6599

If fixing it is hard, which I think it might be, a good step forward would be to change the options screen. Right now there is only 1 setting for both double and single quotes. If this was two separate settings, I could disable it for single quotes and still get the benefit for doubles, which are what I use most actually.

image
cpatrickalves commented 4 months ago

Any solution?

padrewill commented 3 months ago

Adding a data point. I use the US international keyboard on MacOS — heavy Spanish usage, in addition to English — and the nature of the way quote marks work on this keyboard as potential diacritic markers means that it doesn't play nice with Smart Typography.

In normal usage, this particular keyboard format treats the first stroke of either a single- or double-quote as a moment to listen for a letter that can be accented (single quote) or given an umlaut (double quote). If the next stroke is one of those letters, it adds a diacritic. If the stroke is a non-relevant letter, it goes ahead and gives you the quote mark before the letter. If you need a quote mark before an accented letter, you have to hit space to release the quote mark, and then form the accented letter as normal.

Smart Typography appears to view the first stroke as the definitive quote mark to be made curly, so it adds it in. Meanwhile, the keyboard itself continues to follow its own rules, resulting in doubled quote marks at the finish of every quote-text, and either doubled quote marks (one curly and one straight) at the beginning or else a quote mark and a wrongly accented letter, depending on use case.

Examples: “"sprint”” ‘'sprint’’ “äpple”” ‘ápple’’

Similarly, if you actually want an accented character, then you get a quote mark when you weren't looking for one.

Examples: ‘éste “Äpfel

Given the way the plugin works, I don't know if this is fixable or not, or if it's worth the effort for the use case. But I thought it couldn't hurt to say. It's an excellent plug-in, and I'd love to start using it if anything changes here. 🙂