You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't Reference Capitalized Hashtable Elements #521
Attempting to reference a Hashtable element with a key containing an uppercase letter will fail. Dictionaries however work fine.
Example:
usingSystem.Collections;usingHandlebarsDotNet;conststringtemplate=@"Hello {{ NAME }}, have a nice day.";varcompiledTemplate=Handlebars.Compile(template);varnotWorkingOutput=compiledTemplate(newHashtable{{"NAME","bob"}});varworkingOutput=compiledTemplate(newDictionary<string,string>(){{"NAME","alice"}});Console.WriteLine(workingOutput);Console.WriteLine(notWorkingOutput);
Activity
rexm commentedon Jun 22, 2022
What happens with a HashTable element with a lowercase key?
AceCoderLaura commentedon Aug 30, 2022
If you use a lowercase key in the Hashtable you can reference it with any casing from the template.
fix: case-sensitive key lookup for IDictionary/Hashtable (issue #521)
Merge pull request #638 from Handlebars-Net/fix/issue-521