-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Deno Compile inserts literal \r\n into code base #8746
Comments
cc @kdy1 |
This should be fixed now thanks to swc-project/swc#1286. |
@jon49 are you experiencing the problem on 1.6.2? |
Whoops, looks like I misunderstood the problem. Looking at your code some more, though, it looks like the problem is that you're using // src/util/html.ts
function* htmlGenerator(literals, ...subs) {
- var length = literals.raw.length,
+ var length = literals.length,
s = "",
escape = true
for (var i = 0; i < length; i++) {
- let lit = literals.raw[i]
+ let lit = literals[i]
let sub = subs[i - 1]
if (sub) {
if (Array.isArray(sub)) { for (s of sub) if (s) yield s } This could still be considered a problem, though - replacing newlines with escape sequences does change the behaviour, even if only in a minor way. |
swc_bundler: - Allow `export *` and `import` from same source. (denoland/deno#8828, denoland/deno#8725) - Handle contextual keywords. (denoland/deno#8680) - Prevent duplicated identifiers. (denoland/deno#8725) swc_ecma_transforms: - dce: Preserve tags in tagged template literals. (denoland/deno#8746) - dce: Handle throw statement correctly. (denoland/deno#8736)
When I compile my scripts I have strings like so
When I compile my scripts into an executable deno turn my string into something like this (I'm assuming):
Here's what the HTML source code looks like:
Which cause my web page to have a bunch of literal
\r\n
new line characters peppered throughout.Here's my original code: https://github.com/jon49/VideoDownloader/blob/ea6e5b29058a421ffa1d1d2ce3cb7a983f1e64fe/src/pages/home/index.html.ts#L26
The text was updated successfully, but these errors were encountered: