Page MenuHomePhabricator

Implement syntax highlighting in editor for markup within <score> tags.
Open, LowPublicFeature

Description

Feature summary (what you would like to be able to do):

Identify errors in particular mismatched/misnested brackets in the syntax used for the <score> </score> more quickly by means of appropriate syntax highlighting in the editor for code contained within those tags, which is not mediawiki markup.

Steps to reproduce (a list of clear steps to create the situation that made you report this, including full links if applicable):

  • Firstly Ensure you are using WikiEditor ( "Enable the editing toolbar" is enabled in Special:Preferences. )
  • https://en.wikipedia.org/w/index.php?title=Symphony_No._4_(Bruckner)&oldid=1039928058 (which contains an error around line 599, namely a missing brace at the end of a voice.)
  • The example under the heading "Third version (1881)" misrenders
  • Edit tab
  • Enable syntax highlighting. (The pencil Icon will be blue if syntax highlighting is enabled.)

No syntax highlighting is displayed for lillypond markup within the <score></score> tags, (which would have assisted in identifying the mismatched bracket more quickly.

(Aside: The missing brace was corrected in https://en.wikipedia.org/w/index.php?title=Symphony_No._4_(Bruckner)&diff=prev&oldid=1039932845 at line 599)

Use case(s) (describe the actual underlying problem which you want to solve, and not only a solution):

Syntax highlight and matching bracket identification within the wikitext-editor used on pages, for the markup contained within <score></score> tags.

Currently it is possible to write markup, which is valid markup for the score extension tag, but which is malformed in terms of how certain tags or 'commands' are nested, leading to rendering errors. These are often due to missing or misplaced brace { or } characters in the markup, as evidenced (and repaired) in the links provided.

The existing editor is able to highlight and match brackets in mediawiki markup, allowing errors such as that in the first linked page to be identified more quickly. It would be useful to be able to do this for the markup used in the score extension.

Event Timeline

Aklapper changed the task status from Open to Stalled.Aug 21 2021, 10:55 PM

@ShakespeareFan00: Hi, could you please provide steps to reproduce? The title mentions "editor" but the "steps" only link to some diff. Thanks.

Aklapper changed the task status from Stalled to Open.Aug 22 2021, 8:38 AM
Aklapper edited projects, added WikiEditor; removed MediaWiki-Page-editing.

Enable syntax highlighting.

After switching to WikiEditor there is an item in the toolbar. But I only guess that you use WikiEditor. See https://www.mediawiki.org/wiki/Editor . (For future reference, more complete spte are welcome.)

This is what I was seeing on a current revision on the page.

Sample edit window.png (364×1 px, 36 KB)

The Mediawiki markup is highlighted... The lillypond markup inside the Score extension is not.

MusikAnimal removed a project: Community-Tech.
MusikAnimal subscribed.

While I agree with its usefulness, in my opinion this is outside the scope of CodeMirror. The syntax highlighting offered is meant to be for wikitext. The lillypond markup is in fact not wikitext. If someone wants to take a stab at this we can probably help with code review, but I don't believe Community Tech will have time for this. Sorry!