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 2 commits into from Jun 4, 2016


Copy link

@frxnz frxnz commented May 27, 2016

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

{{ [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 May 27, 2016

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.

Copy link
Contributor Author

@frxnz frxnz commented May 31, 2016

@rexm Added a check for the closing square bracket

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
Copy link

@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
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants