CrowCpp / Crow

A Fast and Easy to use microframework for the web.
https://crowcpp.org
Other
3.17k stars 350 forks source link

Including a {{}} in a mustache template isn't ignored when it's commented out #869

Closed lazypenguin34 closed 1 month ago

lazypenguin34 commented 1 month ago

This means an HTML mustache template like this:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Simple Web Server!</title>
</head>
    <body>
        <p>Hello {{person}}!</p> <!-- {{}} defines a simple variable in mustache -->
    </body>
</html>

Will give an error like this: An uncaught exception occurred: crow::mustache error: empty tag is not allowed

Removing the {{}} from the comment fixes the problem, but it might be nice to be able to put it in a comment sometimes.

gittiver commented 1 month ago

I just noticed that you referring to an html-comment. mustache has no idea about what kind of file is used as template, therefore this is intended behavior not a bug.

will close this issue.