https://bugzilla.wikimedia.org/show_bug.cgi?id=71594
Bug ID: 71594
Summary: mw.html doesn't accept tags containing numbers
Product: MediaWiki extensions
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Scribunto
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Web browser: ---
Mobile Platform: ---
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
--
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l