Page MenuHomePhabricator

Incorrect syntax highlighting for: [https://example.com
Closed, DeclinedPublic

Description

Steps to reproduce

  1. Enable Wikitext syntax highlighting
  2. Open Wikipedia:Sandbox
  3. Edit it as source
  4. Type [https://example.com

Actual results

Screenshot from 2018-01-16 21-20-41.png (336×37 px, 2 KB)

Expected results

The [ is not highlighted as if its a link as it gets rendered as plain text.

Screenshot

Screenshot from 2018-01-17 11-35-50.png (256×52 px, 2 KB)

Event Timeline

Bhsd subscribed.

CodeMirror has to make reasonable assumptions about the Wikitext which may be incomplete during editing (the so-called error tolerance). In this particular case, CodeMirror has to assume that [https://example.com is an incomplete external link instead of a plain [ plus a free external link, which makes total sense to most situations.