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

Less than not supported in templates #576

Open
jasonsultana opened this issue Feb 15, 2021 · 1 comment
Open

Less than not supported in templates #576

jasonsultana opened this issue Feb 15, 2021 · 1 comment

Comments

@jasonsultana
Copy link

jasonsultana commented Feb 15, 2021

I have a template with the following snippet:

if (A < B)

RazorEngine compiles this to:

if (A WriteLiteral("< B)\n            {");

This is inside a @{} Razor code block, so the less than in this case should not be treated as the start of a HTML tag.

@jasonsultana
Copy link
Author

jasonsultana commented Feb 15, 2021

A messy workaround in the interim is to:

A) Move the condition into your model, by exposing a LessThan(A, B) method; or
B) Inverse the condition ie if (!(A >= B))

@jasonsultana jasonsultana changed the title Less than / Greater than not supported in templates Less than not supported in templates Feb 15, 2021
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