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

Only first of consecutive attributes gets extracted. #95

Open
jimmypoms opened this issue Jun 30, 2015 · 0 comments
Open

Only first of consecutive attributes gets extracted. #95

jimmypoms opened this issue Jun 30, 2015 · 0 comments

Comments

@jimmypoms
Copy link

Given two consecutive attributes in a DOM node, only the first one gets extracted.

For example in the following div only string1 will get extracted:

<div attribute1="'string1'|translate" attribute2="'string2'|translate">
</div>

However if there is a non matching attribute between, it works as expected:

<div attribute1="'string1'|translate" class="test" attribute2="'string2'|translate">
</div>

This is due to the RegExp used inside extract.js and can be fixed by resetting lastIndex on line 311ff:

str = matches[2].replace(/\\\'/g, '\'');
self.addString(reference(n.startIndex), str);
noDelimRegex.lastIndex = 0;
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

1 participant