[wp-trac] [WordPress Trac] #36459: Inconsistent triggering of backtick shortcut for code tags

WordPress Trac noreply at wordpress.org
Mon Apr 11 15:51:07 UTC 2016


#36459: Inconsistent triggering of backtick shortcut for code tags
--------------------------+-----------------------------
 Reporter:  Clorith       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Editor        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  javascript
--------------------------+-----------------------------

Comment (by gitlost):

 The backtick problem on keyboards that require a modifier might be solved
 by loosening the checks on `keyCode` values in the `keyup` event handler.
 I've tried testing it by setting up a Norwegian layout but I'm not sure I
 have the right set up. If it does solve the problem, it's quite a small
 change really as the checks are only done for optimization reasons.

 The quick typing issue is trickier as it's caused by typeahead getting
 into the selection on `keyup` which means that the current character
 needn't be a backtick. The change in the patch allows for one extra
 typeahead but if you're very quick you can put two in at least.

 The broken backtick issue causing others in the same paragraph not to work
 can be fixed by looking for the `endOffset` first and then looking
 backwards for the start.

 There's a couple of other changes, to ignore backticks that are empty or
 contain a single white space, and to ignore backticks when they're in the
 code nodes themselves.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36459#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list