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

Problem with field containing a string ($) character #26

Closed
ghost opened this issue May 10, 2011 · 3 comments
Closed

Problem with field containing a string ($) character #26

ghost opened this issue May 10, 2011 · 3 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented May 10, 2011

I am pulling a feed from the following URL: http://voicesfromjapan.blogspot.com/feeds/posts/default?alt=json-in-script which contains string ($) characters as the names of fields. For instance, in the object that returns, the text for the title is in the feed.entry.title.$t field. When I put "title.$t" in my template, the field doesn't get rendered. If I use "title.type" (another field in title), it is rendered. I'm assuming this issue has to do with the $ in the title as it is messing up the regex that replaces the text--is that a safe assumption? I would try to fix it myself; however, I'm not that great with regular expressions.

@twigkit
Copy link
Collaborator

twigkit commented May 10, 2011

Hi thanks for reporting this. Yes that would be the issue. I'm close to wrapping up 1.5 so I'll have a look at this for you ASAP and let you know how it goes.

@ghost ghost assigned mrolafsson May 10, 2011
@ghost
Copy link
Author

ghost commented May 10, 2011

I think I figured out how to get it to work. In the replaceVariables method I changed the regEx to the following: /{{[ ]?([A-Za-z0-9$.[]]?)([ ]?|[ ]?._?)?[ ]?}}/g

Of course this would need to be fully tested, but so far, so good!

@twigkit
Copy link
Collaborator

twigkit commented May 10, 2011

Great, glad you worked around it. That seems like the correct solution, I'll just have to change it in a couple of other places to make sure works throughout. Thanks for the fix!!!

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

No branches or pull requests

1 participant