Created
March 6, 2014 13:47
-
-
Save chrisjhoughton/9390050 to your computer and use it in GitHub Desktop.
DO NOT USE. CURRENTLY BUGGY. An extremely useful yet nasty function to pass native HTML into a JavaScript function. Compatible with IE8+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var multiline = function (fn) { | |
var reCommentContents = /\/\*\s*([\s\S]*?)\s*\*\//; | |
return reCommentContents.exec(fn.toString())[1]; | |
}; | |
var html = multiline(function(){/* | |
<div> | |
<marquee>HELLO</marquee> | |
</div> | |
*/}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment