Page MenuHomePhabricator

Clarify documentation for ve.dm.MWInlineExtensionNode
Closed, ResolvedPublic

Description

The documentation ve.dm.MWInlineExtensionNode for says:

extensionsName
Name of the extension and the parser tag name

However the property is actually only used for the parser tag name, and has no relationship to the name of the extension. The current documentation is confusing because new developers may not understand how to use this property correctly.

Event Timeline

Despite its name, the extensionName static property is only used for the parser tag's name, and we don't really care about the name of the extension. VisualEditor itself has the class ve.dm.MWPreNode, which sets .extensionName = 'pre', to support MediaWiki's built-in <pre> tags.

You should be able to just define two classes, one with .extensionName = 'pgn' and another with .extensionName = 'fen'. If you can confirm that this works for you, I suppose we should just correct the documentation in ve.dm.MWExtensionNode?

Wugapodes renamed this task from ve.dm.MWInlineExtensionNode should not assume a parser tag has the same name as the extension to Clarify documentation for ve.dm.MWInlineExtensionNode.Oct 3 2021, 9:02 PM
Wugapodes updated the task description. (Show Details)

Thanks @matmarex for clearing this up for me and for the additional example (I had only seen Score and Math). I can confirm that your solution works. Updating the documentation would be very helpful to avoid this confusion. I've update the task to that effect.

Change 730073 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] ve.dm.MWExtensionNode: Clarify documentation of 'extensionName'

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

Change 730073 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] ve.dm.MWExtensionNode: Clarify documentation of 'extensionName'

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