careteditor / issues

Caret issues
https://caret.io
326 stars 12 forks source link

Feature request: Add typographic transformations #327

Open onvlt opened 7 years ago

onvlt commented 7 years ago

I'd find really nice if Caret supported SmartyPants typographic transformations:

  • Straight quotes ( " and ' ) into “curly” quote HTML entities
  • Backticks-style quotes (``like this'') into “curly” quote HTML entities
  • Dashes (“--” and “---”) into en- and em-dash entities
  • Three consecutive dots (“...”) into an ellipsis entity
astoilkov commented 7 years ago

HI @vanniewelt,

Thanks for the suggestion. We will look into it.

Do you have a workflow to workaround the missing support for typographic transformations?

onvlt commented 7 years ago

I don't have any workaround, I simply use this syntax and hope it will get supported one day :) Another nice transformation would be arrows (eg. -> to ). Possibilities are endless. Maybe user could even define his own transformation list.

pslobo commented 7 years ago

Hi @vanniewelt, I assume your not using MacOS. If you are, then you can enable that functionality in any text field in keyboard preferences. If not, and while this feature isn't implemented you can have a look at http://larsenwork.com/monoid/ and it's use of ligatures like <!-- --> <-- ->> <<- -> <- => <=> <==> ==> <== >>= =<< -- := =:= == !== != <= >= // /** /* */ && .& || !! :: >> << ¯\_(ツ)_/¯ __ ___ .. ...

onvlt commented 7 years ago

Thank you, I'm already using Fira Code, which offers same ligatures. What I'm actually looking for is a transformation in the preview. Anyway, this is sufficient solution for now.

markdstafford commented 6 years ago

I +1ed this. Since you're already using markdown-it, wouldn't this just be as simple as passing typographer: true through from preferences.md?

lensbart commented 5 years ago

@astoilkov @vanniewelt as an easy workaround that is useful across apps, (and assuming you’re using macOS), there are keyboard shortcuts for single and double smart quotes, and for en and em dashes.

I believe the shortcuts for em and en dashes have been switched around in the last update of macOS. For the ellipsis I don’t use a keyboard shortcut.

If you would add support for “typographic” quotes, please make sure that they’re not added inside of code snippets — this would be quite annoying 😊

Finally, one typographic feature request I would like to add myself: having discs instead of asterisk symbols for bullet lists. ✌️

jmakeig commented 5 years ago

Ideally Caret would just delegate to operating system’s built-in ability to manage this for you. For example, in macOS text inputs you can select Substitutions > Smart Quotes from the context menu. I suspect Caret is not using a native text input, though.

astoilkov commented 5 years ago

Caret isn't using a native text input but we will support these features in the future.