Page MenuHomePhabricator

Syntax highlighting in the Wikitext Editor 2017 (new wikitext mode) lacks some formatting compared to the 2010 editor
Closed, DuplicatePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):
Start editing an article using the standard wikitext editor. Then enable "new wikitext mode" in beta features and again start editing an article in the wikitext mode. Ensure that the syntax highlighting in both cases is turned on.

Compare the appearance.

What happens?:

Standard wikitext editor:

image.png (410×1 px, 133 KB)

New wikitext editor:

image.png (381×1 px, 131 KB)

Please notice that the new editor doesn't emphasize the section headings (== those ones ==) with a bigger font size, even though it used to do so. Moreover, no token is rendered in bold: subsection heading (=== these ===), bold text ('''lorem ipsum''') nor the template and parameter names.

The symbol in the subheading on the screenshots is just a way my font represents the sequence of three equal signs.

What should have happened instead?:
The syntax highlighting should be consistent between both wikitext editors.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
The screenshots were taken on plwiki. Browser: Microsoft Edge (Chromium) v99.0.1150.55

Event Timeline

matmarex renamed this task from Syntax highlighting in the Wikitext Editor 2017 (new wikitext mode) has regressed compared to the 2010 editor to Syntax highlighting in the Wikitext Editor 2017 (new wikitext mode) lacks some formatting compared to the 2010 editor.Mar 29 2022, 6:21 PM

This is a known problem, it works this way because of how the syntax highlighting is implemented in the 2017 editor. Basically, the highlighted text is placed on top of the normal editing area (instead of replacing it, like in the 2010 editor), and in order for the visible cursor position to match, it has to use the exact same font throughout.

Partial duplicate to T199740, and I'm pretty sure we have a header related task lying around.