Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

String literal containing closing script tag makes generated HTML blow up #174

Closed
zwilias opened this issue Jul 11, 2017 · 2 comments
Closed

Comments

@zwilias
Copy link
Member

zwilias commented Jul 11, 2017

foo = "</script>"

Saving that in a file, compiling it to html and opening the result in a browser yields the following output:

'; var Elm = {}; Elm['Main'] = Elm['Main'] || {}; if (typeof _user$project$Main$main !== 'undefined') { _user$project$Main$main(Elm['Main'], 'Main', undefined); } if (typeof define === "function" && define['amd']) { define([], function() { return Elm; }); return; } if (typeof module === "object") { module['exports'] = Elm; return; } var globalElm = this['Elm']; if (typeof globalElm === "undefined") { this['Elm'] = Elm; return; } for (var publicModule in Elm) { if (publicModule in globalElm) { throw new Error('There are two Elm modules called `' + publicModule + '` on this page! Rename one of them.'); } globalElm[publicModule] = Elm[publicModule]; } }).call(this);

More info here: https://stackoverflow.com/questions/1659749/script-tag-in-javascript-string

@process-bot
Copy link

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@evancz
Copy link
Contributor

evancz commented Mar 7, 2018

Tracking over in the compiler. Thanks for the report!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants