-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing of inline <script> #20
Comments
You may be able to do it like this: <script>
//<!-- @ifdef DEBUG -->
var blah = 1 + 2;
//<!-- @endif -->
</script> If you can't it may be route to allow support for it. |
Yeah, the format for mixed source in a file is not intelligent, it doesn't differentiate between languages embedded within a parent source, so @drkibitz's method should work. |
Hi, umm, nope, doesn't work. It removes the code but keeps the // from the last // Kind regards Edit: Ok, so I got it, at least functional, working. Won't workvar toBeKept1;
//<!-- @ifdef DEBUG -->
var toBeRemoved;
//<!-- @endif -->
var toBeKept2; will be rendered to:var toBeKept1;
// var toBeKept2; Works:var toBeKept1;
//<!-- @ifdef DEBUG -->
var toBeRemoved;
//<!-- @endif -->
var toBeKept2; will be rendered to:var toBeKept1;
//
var toBeKept2; So... it works, but it should remove the //, too. Kind regards Edit: And finally another update: It either works when removing the code or when keeping the code, but not in both cases. |
Hi, ugh, got it working: //<!-- @ifdef DEBUG -->//
var code;
//<!-- @endif -->// Either leaves you with one line '////' (code removed) or code between lines of '////' (code kept). Looks funny, but works. Don't know what happens when the code gets minified, so it might be a cool idea (and I'd be very happy) to fix it. Kind regards |
Sorry, should have reviewed the example code above, it should work with straight html syntax, eg do this (remote, can't verify)
|
Hi, I totally forgot that it's possible to use HTML comments inside the Kind regards |
Hi,
I wonder if it's my fault or if it's currently not supported:
I have an *.html document with some inline < script >, and I tried to remove a block:
//@ifdef DEBUG
< some js here >
//@endif
but it just doesn't work. Is js-parsing deactivated when parsing *.html-files? Are you planning to support inlined scripts?
Kind regards
Marc
The text was updated successfully, but these errors were encountered: