Last modified: 2011-04-30 01:21:17 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 T23303, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21303 - HTML comments are stripped from site JavaScript (loaded via gen=js)
HTML comments are stripped from site JavaScript (loaded via gen=js)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.15.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-26 18:45 UTC by AJF
Modified: 2011-04-30 01:21 UTC (History)
3 users (show)

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


Attachments

Description AJF 2009-10-26 18:45:47 UTC
Below line from my Monobook.js:

var rex = new RegExp ('<!--' + 'hak dla skryptu' + '-->', 'i');

Is rendered as:

var rex = new RegExp ('', 'i');

In JavaScript loaded from wikipages.

This bug makes impossible to use HTML comments for making marks for AJAX code.
Comment 1 Roan Kattouw 2009-10-26 18:47:28 UTC
A temporary workaround is to use '<!' + '--'
Comment 2 AJF 2009-10-26 18:51:25 UTC
why '<--' + 'something' + '-->' is stripped and '<-' + '-something-' + '->' not?
Comment 3 Roan Kattouw 2009-10-26 18:58:12 UTC
Because it contains <!-- some text --> ; the parser doesn't look at quotes. Putting quotes, spaces and a plus in such a way that <!-- is no longer together works around it.

'<!--' + blah + '-->' is interpreted as quote comment quote
'<!' + '--' + blah + '--' + '>' doesn't have a special sequence
Comment 4 Platonides 2009-10-26 19:13:53 UTC
monobook.js is loaded via action=raw, it shouldn't "disappear". And in fact i see the content right in http://test.wikipedia.org/w/index.php?title=User:Platonides/monobook.js&action=raw&ctype=text/javascript&urid=243z2_79308
Where is it being removed?

Comment 5 AJF 2009-10-26 19:28:41 UTC
On my wiki it occurs only in site JavaScript (MediaWiki:Monobook.js) in user JS it's not stripped. It's same with and without extensions.
Comment 6 Splarka 2009-10-27 00:13:56 UTC
> monobook.js is loaded via action=raw, it shouldn't "disappear".

Actually, MediaWiki:Monobook.js is being loaded via gen=js (and combined with Common.js), which does do some limited parsing. This is a feature/bug in gen=js (and may be a dupe).
Comment 7 Alexandre Emsenhuber [IAlex] 2010-01-14 19:39:42 UTC
Fixed in r61058.

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


Navigation
Links