Page MenuHomePhabricator

Document that the second parameter of mw.html.element is optional
Closed, ResolvedPublic

Description

I would never have guessed that the second parameter of mw.html.element is optional by just looking at the source or the documentation, but it is: mw.html.element( 'br' )works and returns '<br/>', so I think it worth to document this.

Event Timeline

Schnark created this task.Feb 9 2015, 9:24 AM
Schnark raised the priority of this task from to Needs Triage.
Schnark updated the task description. (Show Details)
Schnark added a subscriber: Schnark.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 9 2015, 9:24 AM
Aklapper triaged this task as Low priority.Feb 9 2015, 11:23 AM

Change 250198 had a related patch set uploaded (by TheDJ):
mw.html: Document which mw.html.elements params are optional

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

Krinkle added a subscriber: Krinkle.EditedOct 31 2015, 11:17 PM

I would never have guessed that the second parameter of mw.html.element is optional by just looking at the source or the documentation, but it is: mw.html.element( 'br' )works and returns '<br/>', so I think it worth to document this.

The reason one would not guess from the source/documentation is because it is not supported. If it was supported, then you would see that in the code (even if the documentation is incomplete).

The fact that something works is not indicatory of support. Documentation comes after support, not the other way around.

Having said that, I'm happy to support this. It makes total sense. So let's update the code to reflect this support, including unit tests. After that then we can update the documentation (can be in the same commit of course!).

Change 250198 merged by jenkins-bot:
mw.html: Document mw.html.elements optional parameters

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

@Krinkle the commit that was merged looks like it added tests and updated the documentation - can this be closed?

TheDJ closed this task as Resolved.Dec 3 2019, 8:55 AM
TheDJ claimed this task.
TheDJ added a subscriber: TheDJ.

this can definitely be marked as solved yes..