Ghost: Editor: Backticks using German keyboard doesn't trigger code formatting

Created on 26 Aug 2018  路  6Comments  路  Source: TryGhost/Ghost

Issue Summary

When using a german keyboard layout backticks do not trigger the markdown code expansions.

To Reproduce

  1. Switch keyboard layout to German
  2. Attempt to use the backtick key to format text as per markdown (working demo)

Technical details:

  • Ghost Version: 2.0.3
  • Node Version: 8.11.4
  • Browser/OS: Chrome Version 68.0.3440.106 (Official Build) (64-bit), macOS 10.13.6 (17G65)
  • Database: MySQL 5.7.23

First up: the new editor is totally awesome! 馃帀 really great work. I am currently in the process of implementing a RTE of sorts myself and now I have yours as a clear goal to aim to. Great work!

As described above, the only thing missing (for now) is inline code formatting. Currently it is
cumbersome to write a paragraph, see that I need code formatting, cut, /m, choosing markdown, pasting, jumping back to my position and add the backticks.

I have searched the issue tracker, but looking for code has quite a few false positives so sorry if I missed a previous issue.

Keep doing your great work. 馃挭

PS: this issue is not about something fancy like highlighting in inline code, just the <code>..</code> tags.

admin client bug editor

Most helpful comment

@apfelbox this is definitely related to the German keyboard layout, I can reproduce when I switch my mac to that. I've updated the issue title and description accordingly

All 6 comments

Inline code blocks can be created using single backticks (
`` code goes here`
````
)

and normal code blocks can be created using triple backticks (

```
  // begin code block
  // do some magic
```

)

That doesn鈥檛 seem to work in the new v2+ mobiledoc-based editor.

@apfelbox inline and block code are definitely supported in the new editor. If they're not working for you are you seeing errors in the DevTools console? What browser are you using?

editor-code

Hmm, that doesn't seem to work for me:

reproduce

I have no errors in the console. I have however a German keyboard layout, and in this layout you have to hit space after typing `, as to indicate, that it shouldn't be placed upon an a (脿) or something similiar. Doesn't look like this in your typing, that's why I am mentioning it.

Funny thing though: if I copy the markdown code and just paste it in a regular paragraph, the code is picked up correctly.

@apfelbox this is definitely related to the German keyboard layout, I can reproduce when I switch my mac to that. I've updated the issue title and description accordingly

Fix for ` not triggering text expansions on German keyboards on Windows/macOS should be in the next release. Annoyingly Linux does not expose keyboard events for dead keys through browsers in a way that we can track.

Unfortunately ` as the first char in a paragraph still won't work when using dead keys because of this issue https://github.com/TryGhost/Ghost/issues/9801

Was this page helpful?
0 / 5 - 0 ratings