Bug 1142524 - JST filter does not correctly escape backslashes in string literals
Summary: JST filter does not correctly escape backslashes in string literals
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-webassets
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Praveen Kumar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-17 00:28 UTC by Dan Callaghan
Modified: 2014-11-25 20:08 UTC (History)
3 users (show)

Fixed In Version: python-webassets-0.9-4.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-20 23:01:34 UTC
Type: Bug


Attachments (Terms of Use)

Description Dan Callaghan 2014-09-17 00:28:27 UTC
Description of problem:
If a template contains a backslash (for example, as part of a regexp on <input pattern=""/> or anywhere else) the backslash is not escaped when the template is converted to a JavaScript string literal by the JST filter.

Version-Release number of selected component (if applicable):
python-webassets-0.9-1.fc20.noarch

How reproducible:
not easily, but reliably

Steps to Reproduce:
1. Set up a project using webassets JST filter
2. Write a JST template with a backslash, for example: <input pattern="\S+"/>
3. Check the resulting JS file produced by webassets.

Actual results:
window.JST['mytemplate'] = _.template('<input pattern="\S+"/>');

Expected results:
window.JST['mytemplate'] = _.template('<input pattern="\\S+"/>');

Additional info:
Upstream PR that was merged for 0.10:
https://github.com/miracle2k/webassets/pull/284

The patch applies cleanly to 0.9.
https://github.com/danc86/webassets/commit/fad3aded6837751f68b6f3af6851ef19c64dd04c.patch

Comment 1 Fedora Update System 2014-11-10 11:51:08 UTC
python-webassets-0.9-4.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/python-webassets-0.9-4.el7

Comment 2 Fedora Update System 2014-11-10 11:52:51 UTC
python-webassets-0.9-4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/python-webassets-0.9-4.fc20

Comment 3 Fedora Update System 2014-11-10 11:53:59 UTC
python-webassets-0.9-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-webassets-0.9-4.fc19

Comment 4 Fedora Update System 2014-11-12 02:43:20 UTC
Package python-webassets-0.9-4.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-webassets-0.9-4.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-14770/python-webassets-0.9-4.fc20
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2014-11-20 23:01:34 UTC
python-webassets-0.9-4.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2014-11-20 23:02:52 UTC
python-webassets-0.9-4.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2014-11-25 20:08:48 UTC
python-webassets-0.9-4.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.