-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
input pattern requires double-escaping #830
Comments
attribute strings are regular js strings, so single escapes should work, something funky going on otherwise |
My sentiments exactly — I was very surprised that single escaping didn't work. It probably means that the attribute string is being parsed twice on it's way to the output. On Dec 7, 2012, at 7:09 AM, TJ Holowaychuk notifications@github.com wrote:
|
HI, visionmedia. After I read the source https://github.com/visionmedia/jade/blob/master/lib/compiler.js#L571 . |
The problem is that we're 'undoing' the escaping when we eval. For example we convert |
* upstream/master: (26 commits) if watching and compile failed don't bomb the watch improve the hygiene of compiled functions Fix expression buffering bug Add test case for pugjs#830 pugjs#847 Escape JavaScript strings as late as possible Add some tests that wouldn't have passed before Fix interpolation in blocks of text Fix attribute interpolation Use character-parser for js-expression parsing move filters to an external library simplifying escaping of newlines so it only happens in text escaping update jade(1) reference to include the watch option tests only replace new lines if not a js file fix indentation issue Don't lock coffee-script dev-dependency Mention include file extension filters in readme Update slim repo url Revert "Eliminate useless var definitions." Release 0.28.2 ...
I'm still experiencing this bug. |
You should have to do a single layer of escaping (because the value is a JavaScript expression):
should produce: <input pattern="\S+(\.\S+)+"/> Which is working for me. If that doesn't work for you, please open a new issue. I'm locking this issue as this bug was definitely fixed, any new bugs should be opened as a fresh issue. |
Trying to figure out why my input pattern was not working, I asked html2jade to translate the following input pattern:
But it does not work as advertised:
Single escaping does not work:
Only after double-escaping the slashes do I get the desired escaping for my input pattern:
The text was updated successfully, but these errors were encountered: