Last modified: 2014-10-03 12:10:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T73594, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71594 - mw.html doesn't accept tags containing numbers
mw.html doesn't accept tags containing numbers
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Jackmcbarn
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-03 04:51 UTC by Mr. Stradivarius
Modified: 2014-10-03 12:10 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mr. Stradivarius 2014-10-03 04:51:29 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
Comment 1 Gerrit Notification Bot 2014-10-03 11:53:27 UTC
Change 164535 had a related patch set uploaded by Jackmcbarn:
Allow numbers in tag names

https://gerrit.wikimedia.org/r/164535
Comment 2 Gerrit Notification Bot 2014-10-03 12:09:20 UTC
Change 164535 merged by jenkins-bot:
Allow numbers in tag names

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links