Page MenuHomePhabricator

Math formula (inline) button uses Ctrl-m shortcut already in use for ULS preferred alternative keyboard
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
MarcoSwart
Mar 26 2026, 12:46 AM
Referenced Files
F75974689: 2026-04-14_08-51-01.webm
Apr 14 2026, 3:55 PM
F75974459: 2026-04-14_08-46-46.webm
Apr 14 2026, 3:55 PM
F75974112: 2026-04-14_08-40-20.png
Apr 14 2026, 3:55 PM
F75974140: 2026-04-14_08-38-23.png
Apr 14 2026, 3:55 PM
F75919877: 2026-04-13_21-48-25.png
Apr 14 2026, 5:00 AM
F75919132: 2026-04-13_21-47-57.webm
Apr 14 2026, 5:00 AM
F75919174: 2026-04-13_21-38-07.png
Apr 14 2026, 5:00 AM
F75919187: 2026-04-13_21-34-28.png
Apr 14 2026, 5:00 AM

Description

Steps to replicate the issue (include links if applicable):

When in editor on nl.wiktionary

  • with ULS input tools enabled
  • with (in my case) IPA-XSAMPA keyboard selected as preferred alternative keyboard
  • click Ctrl-m

What happens?:

  • the text <math display="inline"></math> is entered, while also the IPA-keyboard is toggled

What should have happened instead?:
*just the IPA-keyboard should be toggled (this keyboard shortcut is used by [https://www.mediawiki.org/wiki/Help:Extension:UniversalLanguageSelector/Input_methods Universal Language Selector] to

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
*I am aware that English Wikipedia has not enabled ULS, so I can imagine how it was overlooked that ctrl-m is already widely used to enable keyboards in other languages, but in these languages it is probably a more important option than the possibility to enter mathematical formulas.
*I suppose that this new shortcut is connected with the new corresponding button. I guess this will work nearly as well with a different shortcut or even without a shortcut.


Derived Requirement

Ensure that the math insertion keyboard shortcuts do not conflict with shortcuts used by the Universal Language Selector (ULS).

The inline and block math shortcuts must be updated to non-conflicting key combinations, and when ULS input tools are enabled, using the ULS shortcut must not trigger math insertion.

Test Steps

Test Case 1: Ensure updated keyboard shortcut inserts inline math without conflict

  1. Navigate to an editable page with WikiEditor enabled.

2.C

  1. Press Cmd + E (Mac) or Ctrl + E (non-Mac).
  2. Observe the editor content.
  3. ✅❓❌⬜ AC1: <math display="inline"></math> is inserted and the cursor is placed between the tags.

Test Case 2: Ensure updated keyboard shortcut inserts block math without conflict

  1. Navigate to an editable page with WikiEditor enabled.
  2. Ensure ULS input tools are disabled.
  3. Press Shift + Cmd + E (Mac) or Shift + Ctrl + E (non-Mac).
  4. Observe the editor content.
  5. ✅❓❌⬜ AC2: <math display="block"></math> is inserted and the cursor is placed between the tags.

Test Case 3: Ensure ULS shortcut works without triggering math insertion

  1. Navigate to Beta Meta-Wiki where ULS is enabled.
  2. Enable ULS input tools.
  3. Select a preferred alternative keyboard (e.g., IPA-XSAMPA).
  4. Open the editor on any editable page.
  5. Press Cmd + M (Mac) or Ctrl + M (non-Mac).
  6. Observe the behavior.
  7. ✅❓❌⬜ AC3: Only the ULS keyboard toggles and no <math> tags are inserted.

Test Case 4: Ensure no dual action occurs between ULS and math shortcuts

  1. Navigate to Beta Meta-Wiki with ULS enabled.
  2. Enable a ULS input keyboard.
  3. Open the editor.
  4. Press Cmd + M (Mac) or Ctrl + M (non-Mac).
  5. Observe both keyboard state and editor content.
  6. ✅❓❌⬜ AC4: Only the ULS action occurs and no math insertion is triggered.

Test Case 5: Ensure new math shortcuts work when ULS is enabled

  1. Navigate to Beta Meta-Wiki with ULS enabled.
  2. Enable a ULS input keyboard.
  3. Open the editor.
  4. Press Cmd + E (Mac) or Ctrl + E (non-Mac).
  5. Press Shift + Cmd + E (Mac) or Shift + Ctrl + E (non-Mac).
  6. Observe the editor content.
  7. ✅❓❌⬜ AC5: Inline and block math tags are inserted correctly without affecting ULS behavior.

QA Results -Beta

Event Timeline

MusikAnimal changed the task status from Open to In Progress.Apr 9 2026, 5:23 PM
MusikAnimal claimed this task.

Change #1269544 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/Math@master] ext.math.editpage.js: Change hotkey to Ctrl-e to avoid conflict with ULS

https://gerrit.wikimedia.org/r/1269544

With r1269544, I have changed the shortcut to Ctrl-e, which was another suggestion made at T420524#11725874. This is the keyboard shortcut for 'Edit this page' in some browsers, but that shouldn't be conflict when the user is already editing the page.

Change #1269544 merged by jenkins-bot:

[mediawiki/extensions/Math@master] ext.math.editpage.js: Change hotkey to Ctrl-e to avoid conflict with ULS

https://gerrit.wikimedia.org/r/1269544

QA notes in addition to the task description:

  • Keystroke is now Ctrl-e (or Cmd-e on Mac) for display:inline math tag
  • Shift-Ctrl-e (or Shift-Cmd-e) for the display:block math tag
  • UniversalLanguageSelector is enabled on Beta Meta-Wiki, so you can use that to test the conflict as described is fixed
GMikesell-WMF updated Other Assignee, added: GMikesell-WMF.
GMikesell-WMF updated the task description. (Show Details)

@MusikAnimal Confirmed that the math insertion keyboard shortcuts do not conflict with shortcuts used by the Universal Language Selector (ULS), as seen in screenshots/videos. I will mark this as Resolved. Thanks for all your work!

Test Result - Beta

Status: ✅ PASS / ❓ Need More Info
Environment:Beta
OS: macOS Tahoe 26.4
Browser: Chrome 146
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure updated keyboard shortcut inserts inline math without conflict

  1. Navigate to an editable page with WikiEditor enabled.
  2. Ensure ULS input tools are disabled.
  3. Press Cmd + E (Mac) or Ctrl + E (non-Mac).
  4. Observe the editor content.
  5. AC1: <math display="inline"></math> is inserted and the cursor is placed between the tags.
  • Toggle and Keyboard displays
CodeMirror OnlyWikiText Editor Only
2026-04-13_21-33-02.png (1,351×977 px, 791 KB)
2026-04-14_08-38-23.png (1,341×977 px, 584 KB)

Test Case 2: Ensure updated keyboard shortcut inserts block math without conflict

  1. Navigate to an editable page with WikiEditor enabled.
  2. Ensure ULS input tools are disabled.
  3. Press Shift + Cmd + E (Mac) or Shift + Ctrl + E (non-Mac).
  4. Observe the editor content.
  5. AC2: <math display="block"></math> is inserted and the cursor is placed between the tags.

*block math shortcut (Shift-Mod-E) only works with CodeMirror, not WikiEditor.

CodeMirror OnlyWikiText Editor Only
2026-04-13_21-32-28.png (1,348×960 px, 791 KB)
2026-04-14_08-40-20.png (1,362×969 px, 576 KB)

Test Case 3: Ensure ULS shortcut works without triggering math insertion

  1. Navigate to Beta Meta-Wiki where ULS is enabled.
  2. Enable ULS input tools.
  3. Select a preferred alternative keyboard (e.g., IPA-XSAMPA).
  4. Open the editor on any editable page.
  5. Press Cmd + M (Mac) or Ctrl + M (non-Mac).
  6. Observe the behavior.
  7. AC3: Only the ULS keyboard toggles and no <math> tags are inserted.
CodeMirror OnlyWikiText Editor Only
2026-04-13_21-34-28.png (1,589×1,147 px, 446 KB)

Test Case 4: Ensure no dual action occurs between ULS and math shortcuts

  1. Navigate to Beta Meta-Wiki with ULS enabled.
  2. Enable a ULS input keyboard.
  3. Open the editor.
  4. Press Shift + Cmd + E (Mac) or Shift + Ctrl + E (Mac) (non-Mac).
  5. Observe both keyboard state and editor content.
  6. AC4: Only the ULS action occurs and no math insertion is triggered.
CodeMirror OnlyWikiText Editor Only
2026-04-13_21-38-07.png (1,520×1,021 px, 438 KB)
See AC3

Test Case 5: Ensure new math shortcuts work when ULS is enabled

  1. Navigate to Beta Meta-Wiki with ULS enabled.
  2. Enable a ULS input keyboard.
  3. Open the editor.
  4. Press Cmd + E (Mac) or Ctrl + E (non-Mac).
  5. Press Shift + Cmd + E (Mac) or Shift + Ctrl + E (non-Mac).
  6. Observe the editor content.
  7. AC5: Inline and block math tags are inserted correctly without affecting ULS behavior.
CodeMirror OnlyWikiText Editor Only

2026-04-13_21-48-25.png (1,141×1,145 px, 264 KB)

On block, it shows but not the shortcut keys for it, as seen in the screenshot.

I think this is the expected behavior, because the block math shortcut (Shift-Mod-E) only works with CodeMirror, not WikiEditor.

By the way, I think the tests also need to be done with CodeMirror only (no WikiEditor) and WikiEditor only (no CodeMirror), because the implementations are different.

@Bhsd Good call on CodeMirror only and vice versa. Thanks for the info!

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.