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

Error occurs while parsing tag names containing hyphen-minus characters ("-", unicode number: U+002D) #28

Open
ArtemyB opened this issue Sep 9, 2019 · 0 comments

Comments

@ArtemyB
Copy link

ArtemyB commented Sep 9, 2019

Wanted to use GUIDs as tag names, but have a trouble with parsing them - the following exception occurs: Mustachio.IndexedParseException: The path '110E6231-BA3E-40DD-AF62-9802DCC02B61' is not valid. Please see documentation for examples of valid paths.
However when I remove all dashes from the tag name all works successfully. Is that an intentional feature or rather a bug?

Code example:

var guidTemplate1Txt = "There was GUID with dashes: {{110E6231-BA3E-40DD-AF62-9802DCC02B61}}";
var guidTemplate2Txt = "There was GUID w/o dashes: {{110E6231BA3E40DDAF629802DCC02B61}}";

var template1 = Mustachio.Parser.Parse(guidTemplate1Txt);
var template2 = Mustachio.Parser.Parse(guidTemplate2Txt);

var model1 = new Dictionary<string, obj>() { { "110E6231-BA3E-40DD-AF62-9802DCC02B61", "content" } };

var model2 = new Dictionary<string, obj>() { { "110E6231BA3E40DDAF629802DCC02B61", "content" } };

var content1 = template1(model1); // Mustachio.IndexedParseException is thrown there
var content2 = template2(model2); // Works successfully
@ArtemyB ArtemyB changed the title Error occurs while parsing tag names containing dashes ("-") Error occurs while parsing tag names containing hyphen-minus characters ("-", unicode number: U+002D) Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant