atom-community / markdown-preview-plus

Markdown Preview + Community Features
https://atom.io/packages/markdown-preview-plus
Other
370 stars 85 forks source link

How to Disable Auto Text Substitution of Letters Enclosed in Parenthesis? #504

Closed ghost closed 4 years ago

ghost commented 4 years ago

I need to use enclosed letters in parenthesis as I type in markdown. Unfortunately, MPP automatically replaces text such as "(R)" or "(C)" to the registered or copyright symbol. Those symbols appear in the preview. I would ideally like to type the letter R inside parenthesis without having this automatic text replacement but I cannot find the setting that is appropriate for this? Does anyone know how to go about this?

lierdakil commented 4 years ago

Currently, no way to control that via settings (will add one shortly), but markdown-it lacks granularity in this aspect: you can either turn all typographic replacements on, or turn all of them off. This includes smart quotes and dash replacements (-- → – , --- → —).

However, if you escape the right parenthesis, no replacement will happen:

(R) will be replaced with ®

But (R\) will not be

The caveat is there seems to be a bug, wherein if other replacements are used within the same paragraph, \ is ignored, i.e.

Here (R\) will be replaced with ® despite the `\` due to other replacements in this paragraph: (tm)
ghost commented 4 years ago

Thank you for the response. I recently came from using QOwnNotes, which is a markdown note taking app, and I was accustomed to using enclosed letters in parenthesis without expecting auto text substitution to letter-like symbols.

I migrated over to using Atom for markdown for more stability and options. The default Markdown Preview package doesn't have this auto text substitution but I prefer to use MPP because of its additional features and settings. It's just that one caveat of having (C) automatically turn into © without being able to control it. My temporary solutions are:

( C ) whitespaces before and after the letter

or write an inline code such as (C) so that it doesn't automatically replace with © in the preview.

Perhaps it's a niche setting to ask for, but I think having the ability to toggle auto text substitution off would be very useful in my case. Otherwise, it's a great markdown package.

lierdakil commented 4 years ago

Added a toggle in v4.6.0, titled "Typographic Replacements". Find it under markdown-it settings: image