Skip to content

Add character replacements for typing convenience & typographic correctness #113

@thibaudcolas

Description

@thibaudcolas

Initially discussed in #53 (comment).

[Dropbox Paper] does some character replacements (--- inside of other text becomes —, -- becomes –, smartquotes) which I'm not sure what to think of.

At this stage, this editor is still in active development – we are mostly playing catch-up with other editors feature-wise. For now we should review what other editors are doing out of the box with respect to character replacement. In particular:

  • MS Word
  • MS Word Online
  • Google Docs
  • Apple Pages
  • Dropbox Paper
  • Open Office
  • Tiny MCE
  • CKEditor
  • (others welcome)

MS Word

TODO

MS Word Online

TODO

Google Docs

  • Whenever " is typed, it replaces it with .
  • Except when it is entered right after a letter (anything that's not whitespace, when it replaces it .
  • It does not do this for pasted text, just when typing.

All of the replacement options are under Tools > Preferences:

  • Automatically capitalize words
  • Use smart quotes
  • Automatically detect links
  • Automatically detect lists
  • Suggest action items
  • Suggest contacts in comments

Replacements:

"    “ or ” after a non-space character
'    ‘ or ’ after a non-space character
# Pressing space after entering any of those
(c)  ©
(r)  ®
-->  →
...  …
1/2  ½
1/3  ⅓
1/4  ¼
1/5  ⅕
1/6  ⅙
1/8  ⅛
2/3  ⅔
2/5  ⅖
3/4  ¾
3/5  ⅗
3/8  ⅜
4/5  ⅘
5/6  ⅚
5/8  ⅝
7/8  ⅞
<--  ←
<==  ⇐
<=>  ⇔
==>  ⇒
c/o  ℅
tm   ™

Apple Pages

No character replacement at all.

Dropbox Paper

Same smartquotes behavior as Google Docs.

  • Automatically detect links
  • Automatically detect lists
  • @mentions

Replacements:

"    “ or ” after a non-space character
'    ‘ or ’ after a non-space character
# Pressing space after entering any of those
-- — (has to have a space before the first hyphen)
--- — (has to have a space before the first hyphen)
# Without pressing space
--- <hr/>
-->  →
<--  ←
...  …

Open Office

TODO

Tiny MCE

TODO

CKEditor

TODO

Edit: optionally have a way to opt-out directly in the editor? Word-style "stop converting these".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions