Related wish: W141: Editing mathematics is too difficult
One idea we had was to add a keyboard shortcut and toolbar button to insert <math></math> and put the cursor in the middle. This should reduce the manual strain of having to type <math> over and over. This seems pretty useful and non-controversial.
Acceptance criteria
If the Math extension is installed:
- The WikiEditor (2010) toolbar should have two buttons, both in the "Insert" group of the "Advanced" section:
- "Math formula (inline)" with the keyboard shortcut Ctrl-m (or Command-m on Mac).
- "Math formula (block)" (no keyboard shortcut for WikiEditor-only)
- Keyboard shortcuts for MediaWiki-extensions-CodeMirror, documented in the help dialog (available by pressing Ctrl-Shift-/ (or Cmd-Shift-/ on Mac)
- Ctrl-m (or Command-m on Mac) for inline
- Shift-Ctrl-m for block
Clicking on the button or using the keyboard shortcut should insert <math display="inline"></math> (or <math display="block"></math>) and place the cursor in between the opening and closing tags.
Related: T419104: Auto-closing of tags in wikitext
Derived Requirement
Ensure that when the Math extension is enabled, users can insert math tags using toolbar buttons and keyboard shortcuts in the editor.
The editor must provide options to insert both inline and block math tags, and upon insertion, the cursor must be placed between the opening and closing <math> tags for immediate input.
Test Steps
Test Case 1: Ensure math toolbar buttons are present when Math extension is enabled
- Ensure the Math extension is enabled on the wiki.
- Log in to Wikipedia.
- Open the editor using WikiEditor (2010) on any editable page.
- Navigate to the "Advanced" section of the toolbar.
- Locate the "Insert" group.
- Observe the available buttons.
- ✅❓❌⬜ AC1: Two buttons labeled "Math formula (inline)" and "Math formula (block)" are present in the "Insert" group of the "Advanced" section.
Test Case 2: Ensure clicking math toolbar buttons inserts correct tags with cursor placement
- Open WikiEditor (2010) on an editable page.
- Click the "Math formula (inline)" button.
- Observe the inserted text and cursor position.
- Click the "Math formula (block)" button.
- Observe the inserted text and cursor position.
- ✅❓❌⬜ AC2: Clicking each button inserts the correct <math display="inline"></math> or <math display="block"></math> tag and places the cursor between the tags.
Test Case 3: Ensure keyboard shortcuts insert inline and block math tags
- Open WikiEditor (2010) on an editable page.
- Press Cmd + M (Mac) or Ctrl + M (non-Mac).
- Observe the inserted text and cursor position.
- Ensure CodeMirror is enabled.
- Press Shift + Cmd + M (Mac) or Shift + Ctrl + M (non-Mac).
- Observe the inserted text and cursor position.
- ✅❓❌⬜ AC3: The correct inline and block <math> tags are inserted using their respective keyboard shortcuts and the cursor is placed between the tags.
Test Case 4: Ensure keyboard shortcuts are documented in the help dialog
- Open an editable page with CodeMirror enabled.
- Open the help dialog using Cmd + Shift + / (Mac) or Ctrl + Shift + / (non-Mac).
- Locate the keyboard shortcuts section.
- Observe the listed shortcuts for math insertion.
- ✅❓❌⬜ AC4: The help dialog lists keyboard shortcuts for inserting inline and block math tags.
QA Results -Beta
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T420524#11750895 |
| 2 | ✅ | T420524#11750895 |
| 3 | ✅ | T420524#11750895 |
| 4 | ✅ | T420524#11750895 |



