Skip to content
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

backslashes get over-escaped in expressions #784

Closed
jcmf opened this issue Oct 8, 2012 · 1 comment
Closed

backslashes get over-escaped in expressions #784

jcmf opened this issue Oct 8, 2012 · 1 comment

Comments

@jcmf
Copy link

jcmf commented Oct 8, 2012

Javascript expressions seem to be double-escaped somehow. For example, if I try to make a regular expression literal that matches a literal dot, I end up with something that instead matches a literal backslash followed by any character:

> console.log(src)
.url #{result.u.replace('http://', '').replace(/^www\./, '')}
undefined
> console.log(jade.compile(src, {client: true, compileDebug: false}).toString()) 
function anonymous(locals, attrs, escape, rethrow, merge) {
attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;
var buf = [];
with (locals || {}) {
var interp;
buf.push('<div class="url">' + escape((interp = result.u.replace('http://', '').replace(/^www\\./, '')) == null ? '' : interp) + '</div>');
}
return buf.join("");
}
undefined

I see a bunch of recent backslash-related activity, including #731, not sure whether or how this is related exactly.

@tj
Copy link
Contributor

tj commented Oct 9, 2012

patching this up

tj added a commit that referenced this issue Oct 9, 2012
@tj tj closed this as completed in 30c173d Oct 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants