Skip to content

Parsing object as a filter argument fails with spaces inside #3210

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

Closed
sqal opened this issue Jul 2, 2016 · 4 comments · Fixed by #3734
Closed

Parsing object as a filter argument fails with spaces inside #3210

sqal opened this issue Jul 2, 2016 · 4 comments · Fixed by #3734

Comments

@sqal
Copy link
Contributor

sqal commented Jul 2, 2016

Vue.js version

1.0.26

Reproduction Link

https://jsfiddle.net/0o853fzd/

Take a look at example. You can see that when i try to pass object to the filter as an argument it doesn't work when there is some space in the string.

Err

Isn't supposed to PR #834 fix this issue? or is it forbidden to use spaces when passing obejct to the filter like this?

@sqal sqal changed the title Parsing object as a filter argument fails in some cases Parsing object as a filter argument fails with spaces inside Jul 2, 2016
@yyx990803
Copy link
Member

This is because the 1.x filter syntax uses space as the argument delimiter. If anyone wants to work on this, the relevant logic is here: https://github.com/vuejs/vue/blob/dev/src/parsers/directive.js#L20-L35

@defcc
Copy link
Member

defcc commented Sep 20, 2016

I am working on a simple expression parser to parse the filter syntax rather then the regex way。Is it an acceptable method ? If so I will make a pull request soon.

@yyx990803
Copy link
Member

@defcc code size is also a concern here. We don't want to bloat the code for a relatively rare use case.

@defcc
Copy link
Member

defcc commented Sep 21, 2016

ok, got it. @yyx990803

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants