Le mercredi 08 février 2023 à 11:44 +0100, Dominique Devienne via Boost a écrit :
On Wed, Feb 8, 2023 at 11:12 AM Ruben Perez via Boost
wrote: There are 4 use-cases IMHO, for a templating engine: 1) pure text-template. No escaping; 2) text-template to embed in some custom format, with its own escaping rules; 3) template generates HTML, and "some" characters of the placeholders need escaping; 4) template generates text, possibly HTML-like, meant to be embedded into HTML, thus "more" escaping is necessary.
#3 use regular mustaches, {{foo}}, while #4 uses "thick" ones, {{{foo}}}.
I did not check what boost.mustache does, but from the documentation ( https://mustache.github.io/mustache.5.html ): “All variables are HTML escaped by default. If you want to return unescaped HTML, use the triple mustache: {{{name}}}.”. I understand “unescaped HTML” as “plain text”. So thick mustaches {{{foo}}} would be #1. If that's not the case (ie it can't produce plain text), that would make boost.mustache completely useless for me. Regards, Julien