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.
Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| mw.html: Document mw.html.elements optional parameters | mediawiki/core | master | +125 -91 |
Event Timeline
Change 250198 had a related patch set uploaded (by TheDJ):
mw.html: Document which mw.html.elements params are optional
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
@Krinkle the commit that was merged looks like it added tests and updated the documentation - can this be closed?