ekzyis 393d4c7603
Add Markdown formatting hotkeys: CTRL+K, CTRL+I, CTRL+B (#305)
* Fix usage of deprecated event.keyCode

* Add CTRL+K to insert markdown link formatting

* Also add CTRL+B and CTRL+I

* Fix undo not working after using setValue

Undo doesn't work if inputs are changed using javascript code like helpers.setValue().

The solution is to also use `document.execCommand()`.

See https://stackoverflow.com/questions/27027833/is-it-possible-to-edit-a-text-input-with-javascript-and-add-to-the-undo-stack

However, `document.execCommand()` is deprecated but there seems to be no alternative, see:

- https://stackoverflow.com/questions/60581285/execcommand-is-now-obsolete-whats-the-alternative
- https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#browser_compatibility
- https://github.com/codex-team/editor.js/discussions/2214

And so far, every browser still seems to support it: https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#browser_compatibility

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-06-12 12:29:50 -05:00
..
2022-07-30 08:51:04 -05:00
2023-02-08 13:39:53 -06:00
2022-07-21 17:55:05 -05:00
2023-02-08 13:39:53 -06:00
2023-01-26 10:11:55 -06:00
2022-10-25 16:35:32 -05:00
2021-09-23 15:09:07 -05:00
2023-05-01 16:52:02 -05:00
2023-05-06 16:51:17 -05:00
2022-08-11 15:38:10 -05:00
2022-08-31 14:09:49 -05:00
2023-06-03 17:49:04 -05:00
2022-08-18 13:15:24 -05:00
2023-01-10 12:55:17 -06:00
2023-01-18 12:49:20 -06:00
2023-05-11 14:34:42 -05:00
2023-05-31 19:44:06 -05:00
2023-05-01 16:52:02 -05:00
2023-05-11 14:34:42 -05:00
2023-01-26 10:11:55 -06:00
2023-05-06 16:51:17 -05:00
2023-05-06 16:51:17 -05:00
2022-01-27 13:18:48 -06:00
2022-12-07 18:04:02 -06:00
2023-05-01 15:58:30 -05:00
2023-05-01 15:58:30 -05:00
2023-05-02 19:22:38 -05:00
2023-01-10 12:55:17 -06:00
2023-01-18 12:49:20 -06:00
2023-05-02 19:22:38 -05:00
2021-10-15 13:05:34 -05:00
2022-09-06 10:08:53 -05:00
2022-06-08 16:26:44 -05:00
2023-02-03 13:10:18 -06:00
2023-05-06 16:51:17 -05:00
2023-05-06 16:51:17 -05:00
2022-07-30 08:51:04 -05:00
2023-05-01 15:58:30 -05:00
2023-01-18 12:49:20 -06:00
2023-05-01 15:58:30 -05:00
2022-10-27 15:25:42 -05:00
2023-01-26 10:11:55 -06:00
2023-05-06 16:51:17 -05:00
2023-05-06 16:51:17 -05:00
2023-05-01 15:58:30 -05:00
2022-10-20 17:44:44 -05:00
2023-05-01 15:58:30 -05:00
2023-05-31 19:44:06 -05:00
2023-05-01 15:58:30 -05:00
2023-01-05 13:24:09 -06:00
2023-01-05 19:06:31 -06:00
2023-02-09 12:41:28 -06:00
2022-05-18 11:59:59 -05:00
2022-12-01 15:31:04 -06:00
2023-06-02 19:55:45 -05:00
2022-05-05 15:39:05 -05:00
2023-05-01 16:52:02 -05:00
2022-12-19 16:27:52 -06:00