Page MenuHomePhabricator

Vue ResourceLoader support: JavaScript in script elements parsed as HTML leading to parsing error
Open, Needs TriagePublic


As demonstrates, simply using something that looks like HTML in your JS causes a JS error.

This can even happen with an inline comment such as:
// '<a>!!!</a>';

This is unexpected.

[0217d5a6ea867720268d76a6] /w/load.php?lang=en-gb&   RuntimeException from line 1337 of /Users/jrobson/git/core/includes/resourceloader/ResourceLoaderFileModule.php: Error parsing file 'X.vue' in module '': HTML parse errors:
Unexpected end tag : a
 on line 2
#0 /Users/jrobson/git/core/includes/resourceloader/ResourceLoaderFileModule.php(345): ResourceLoaderFileModule->getPackageFiles(ResourceLoaderContext)
#1 /Users/jrobson/git/core/includes/resourceloader/ResourceLoaderModule.php(693): ResourceLoaderFileModule->getScript(ResourceLoaderContext)
#2 /Users/jrobson/git/core/includes/resourceloader/ResourceLoaderModule.php(661): ResourceLoaderModule->buildContent(ResourceLoaderContext)
#3 /Users/jrobson/git/core/includes/resourceloader/ResourceLoader.php(1182): ResourceLoaderModule->getModuleContent(ResourceLoaderContext)
#4 /Users/jrobson/git/core/includes/resourceloader/ResourceLoader.php(890): ResourceLoader->makeModuleResponse(ResourceLoaderContext, array, array)
#5 /Users/jrobson/git/core/load.php(46): ResourceLoader->respond(ResourceLoaderContext)
#6 {main}

Event Timeline

Restricted Application added a project: Performance-Team. · View Herald TranscriptThu, May 21, 7:18 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdlrobson updated the task description. (Show Details)Thu, May 21, 7:19 PM

Change 598133 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@master] VueComponentParser: Use RemexHtml instead of PHP's HTML parser

Gilles moved this task from Inbox to Radar on the Performance-Team board.Tue, May 26, 8:00 PM
Gilles edited projects, added Performance-Team (Radar); removed Performance-Team.
Krinkle assigned this task to Catrope.Tue, May 26, 8:01 PM