Ghost: Alt+L in editor triggers numbered list

Created on 14 Jul 2017  路  14Comments  路  Source: TryGhost/Ghost

Issue Summary

Numbered list should be triggered by Ctrl+Alt+L but they are also triggered by Alt+L
I need to use Alt+L to type "艁" letter.

Technical details:

  • Ghost Version: rc1
  • Node Version: 6
  • Browser/OS: Chrome
  • Database: MariaDB
bug help wanted

All 14 comments

Begging for fix in rc2 :D

@PaszaVonPomiot I'm not able to replicate this - for me Cmd-L toggles unordered list and Cmd-Alt-L toggles ordered list.

Alt-L outputs
Alt-Shift-L outputs

Are you on Windows per chance?

@kevinansfield yes, I'm a Windows 10 user.
Here's screencast. When I press right ALT the cursor changes to big "+" sign and then I press "L"
hover1

Hmm, I've just checked on windows 10 Chrome/Edge and can't reproduce, it's possible that's related to how my keyboard is mapped via my VM though. Ctrl-L and Ctrl-Alt-L worked fine for the list toggles 馃

@kevinansfield the problem is that RAlt-L should not toggle list for selected paragraph.
I've checked on Firefox and Edge - the same issue. Then I've checked with different keyboard settings as normally I use "Polish (programmers)" keyboard layout

image

On English RAlt-L does not enable the list but on Polish it does.
and

According to tooltip numbered list should be only:
image

@PaszaVonPomiot I fully understand that for you this is an incredibly annoying bug, however it appears to be very specific to your language/environment.

We're now only fixing urgent bugs before the release of 1.0.0, if you'd like to submit a fix, we can review and merge it for the first post 1.0.0 bugfix release :) Otherwise we'll get to it as soon as we can.

The same issue is with Romainan keyboard ALT-L and ALT-P (this one publishes the post instead of inserting "搂") character.

The editor content shortcuts are handled in our fork of simplemde https://github.com/kevinansfield/simplemde-markdown-editor/blob/ghost/src/js/simplemde.js.

Definitely open to PRs with fixes or research/links to show how it's possible to deal with different keyboard layouts in JS key event handlers.

I won't be able to help with js as I'm not a programmer but hopefuly this will be useful. It appears that SimpleMDE has the same issue. First we have to understand that in JavaScript we use two parameters to determine which modifier key has been pressed and those are:

  • key

    • Ctrl
    • Alt
    • AltGr (right alt)
  • Location

    • Left
    • Right

If we press AltGr using standard English (US) keyboard then all browsers will detect:
Key 'Alt' is down. Location: Right

However if we press AltGr using Polish (programmers) or Romanian keyboards then js will detect:

  • In Edge and Firefox
    Key 'Control' is down. Location: Left
    Key 'Alt' is down. Location: Right
  • In Chrome
    Key 'Control' is down. Location: Left
    Key 'AltGraph' is down. Location: Right

So the solution I think will be to check not only for key that is being pressed but also for its location. In our case the numbered list should be triggered by:

Ctrl + Alt (only left) +L

Useful links

Snippet to test keypresses
Numeric key locations

Thanks!

Copied proposed solution to simplemde repo - this isn't something to track here

@JohnONolan it is unfortunate that you are closing this even for tracking as it is blocker for Poland and Romania. I mean we can't just stop using "艂" character and I see no resonable workaround so far.

@paszavonpomiot it's tracked in your issue in SimpleMDE which is where this needs to be fixed, keeping multiple issues open means that communication gets split and comments such as yours above don't end up in the right place. Core team monitors our 3rd party deps as well as the core repos

It appears that upstream markdown editor development has halted. Any ideas where to go from here?

Yep. You could fix it, or find someone else to fix it for you, and open a pull request to SimpleMDE.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

mattferderer picture mattferderer  路  4Comments

kirrg001 picture kirrg001  路  3Comments

ArthurianX picture ArthurianX  路  4Comments

hjzheng picture hjzheng  路  4Comments