kainjow / Mustache

Mustache text templates for modern C++
Boost Software License 1.0
357 stars 49 forks source link

Parser chokes on open tags without close #57

Closed derekbsnider closed 3 years ago

derekbsnider commented 3 years ago

If the template contains dangling open tags, there will be no output (note, this works with https://github.com/no1msd/mstch).

Example:

int main()
{
    mustache tmpl{"Hello {{what}}! {{"};

    std::cout << "Rendered: " << tmpl.render({"what", "there"}) << std::endl;

    return 0;
}

Output: Rendered:

Expected: Rendered: Hello there! {{

kainjow commented 3 years ago

Did you check is_valid() and error_message()?

derekbsnider commented 3 years ago

I was expecting this implementation to work the same as the original.

kainjow commented 3 years ago

There are multiple implementations. I don’t think any can be classified as “original.”

derekbsnider commented 3 years ago

On https://mustache.github.io/ C++ links to https://github.com/no1msd/mstch, so I was considering it the original.