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

Quote issue: adding quote right after end of sentence punctuation adds new curly quote pair instead of closing it #48

Closed hsandt closed 1 month ago

hsandt commented 1 year ago

In my novel, while I usually open a quote pair and write my dialogue inside, I sometimes end up with only an opening quote and manually close the sentence with a closing quote at the end of sentence.

I noticed that after an end of sentence symbol (dot, exclamation mark, question mark, ellipsis: .!?…), inserting a quote adds a new curly quote pair instead of a closing curly quote. So I end with two opening curly quotes around my sentence.

To get around this, I either add the pair, then delete the opening curly quote, or add the quote before the end of sentence punctuation so quote closing works, then insert the punctuation.

It would be nice if end of sentence punctuation was detecting like other characters, and adding quote just after it would add a closing curly quote (it's also used for things like "it's" possessive curly quote, but obviously this doesn't happen after a punctuation).

Since some users may actually want to add a new sentence after the end of sentence punctuation (normally you should add a space after the previous sentence, but I don't know, maybe some languages don't have that), we could make it an option (default to true, though, as most latin languages probably benefit from this).

EDIT: also confirmed with comma , which is more rare, but happens when splitting a sentence to inject something like "she said" in the middle.

hsandt commented 1 year ago

I don't know if it should be considered a bug or a feature request. I'll prefix my issue title with "Feature request" if needed.

sginweitu4t899 commented 1 year ago

@hsandt According to the panel on the side, your feedback hasn't been labelled at all, but I might be missing something because I'm new. That might be why @mgmeyers hasn't commented or maybe seen this feedback. It looks like he isn't updating it because the plugin hasn't been updated in over a year. I'd call it a bug, not a feature, because the plugin should only swap normal punctuation marks for smart punctuation, not alter how we have to type to work around what looks like a bug in how the plugin interacts with the "auto pair brackets" editor setting.

hsandt commented 11 months ago

I just discovered that Typora had Edit > Smart Punctuation > Smart Quotes and verified that it was closing quote after punctuation as expected. It could be used as a base for comparison when testing and fixing the plugin's behaviour (and also as a workaround for now for other people who encounter this issue a lot).

sevmonster commented 2 months ago

Duplicate of #44

hsandt commented 1 month ago

Duplicate of #44

No, this is about adding a quote after a punctuation mark, to actually add a missing closing quote. #44 is about trying to replace an existing closing quote (typically added by the auto-match quotes), independently of the preceding character, and adding an unwanted extra quote.

hsandt commented 1 month ago

I just tested again on Smart Typography 1.0.18 and it just... works now. Yet this is still the version from 2022, so I don't see what has changed since. So I'll close this issue (if someone finds exact circumstances to retrigger the bug, feel free to comment).