Last modified: 2014-10-03 12:10:06 UTC
In the debug console, the following code: = tostring( mw.html.create( 'h2' ) ) Produces the error "Lua error in mw.html.lua at line 368: Invalid tag name: h2." This is due to the over-zealous Lua pattern at line 78 of mw.html.lua [1] This should probably be changed from: return s:match( '^[a-zA-Z]+$' ) To: return s:match( '^[a-zA-Z]+[0-9]*$' ) Or as it seems that h1 to h6 are the only tags containing numbers, perhaps this could be: return s:match( '^[a-zA-Z]+$' ) or s:match( '^h[1-6]$' ) [1] https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FScribunto/8e22e0f1f85a296aab805aa2d45e3024acd03f55/engines%2FLuaCommon%2Flualib%2Fmw.html.lua#L78
Change 164535 had a related patch set uploaded by Jackmcbarn: Allow numbers in tag names https://gerrit.wikimedia.org/r/164535
Change 164535 merged by jenkins-bot: Allow numbers in tag names https://gerrit.wikimedia.org/r/164535