Skip to content

Added support for keystrokes for markdown files

Denys Mishunov requested to merge 361609-md-keystrokes-support-in-se into master

What does this MR do and why?

Introduces support for the keystrokes when editing markdown files in Source Editor. Several buttons on the markdown toolbar introduce the keystrokes. Until now, those keystrokes didn't work in the Web Editor. This MR addresses that.

Screenshots or screen recordings

Default Cleanup on file name change
Screen_Recording_2023-03-14_at_00.32.56 Screen_Recording_2023-03-14_at_00.34.35

How to set up and validate locally

  1. In rails console enable the toolbar either globally, or for your user

    Feature.enable(:source_editor_toolbar)
  2. In a repository, open a Markdown file. Alternatively, create a new file and give it a name of something like foo.md: the toolbar will be shown automatically once you focus out of the file name field

  3. Edit the file using the keystrokes shown for the buttons on the toolbar (bold, italic, etc.)

  4. Re-name the file to have an extension other than .md (.txt, for example).

  5. Try editing the document using the same keystrokes. None of the keystrokes should work now unless you re-name the file back to .md.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #361609 (closed)

Edited by Denys Mishunov

Merge request reports