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

Fix whitespace bug with dictionary support #128

Merged
merged 2 commits into from Jun 4, 2016
Merged

Conversation

@frxnz
Copy link
Contributor

@frxnz frxnz commented May 27, 2016

Fixes some whitespace issues with dictionary support. The following now work:

{{ [expression] }}
{{[expression]}}

{{ parent.[expression] }}
{{parent.[other expression]}}
@@ -45,7 +45,7 @@ private string AccumulateWord(TextReader reader)
{
var peek = (char)reader.Peek();

if (peek == '}' || peek == '~' || peek == ')' || char.IsWhiteSpace(peek))
if (peek == '}' || peek == '~' || peek == ')' || (char.IsWhiteSpace(peek) && !buffer.ToString().Contains("[")))

This comment has been minimized.

@rexm

rexm May 27, 2016
Collaborator

I don't think this is a safe assumption. We shouldn't merely check to see if the buffer contains a [, but we should check to see if the buffer contains a [ but has no subsequent ] to ensure we are inside the brackets.

@frxnz
Copy link
Contributor Author

@frxnz frxnz commented May 31, 2016

@rexm Added a check for the closing square bracket

@muizsyed
Copy link

@muizsyed muizsyed commented Jun 3, 2016

+1 Hi Do you know when this will be merged? Incredibly useful fix

@rexm rexm merged commit d210e70 into Handlebars-Net:master Jun 4, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rexm
Copy link
Collaborator

@rexm rexm commented Jun 4, 2016

Pushed to nuget 1.7.1

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

Successfully merging this pull request may close these issues.

None yet

3 participants