Skip to content

Commit

Permalink
Use whisker for html
Browse files Browse the repository at this point in the history
Summary:
Whisker is a replacement for mustache and is largely backward compatible. It brings several quality of life improvements like... error checking.

You can read more about the details [in this post](https://fb.workplace.com/groups/498666380550247/permalink/2051389461944590/).

This diff moves `t_mstch_html_generator` to use whisker instead of mstch.

This requires some changes to the templates to work around the bugs in mstch that have been previously worked around.

#buildall

Reviewed By: dtolnay

Differential Revision: D67569371

fbshipit-source-id: adf9968a91ea8c24ce0d3c0deafba2e2bc66d341
  • Loading branch information
praihan authored and facebook-github-bot committed Dec 23, 2024
1 parent b9eab22 commit 45b991f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ class t_mstch_html_generator : public t_mstch_generator {
public:
using t_mstch_generator::t_mstch_generator;

std::optional<whisker_options> use_whisker() const override {
whisker_options opts;
opts.allowed_undefined_variables = {};
return opts;
}

std::string template_prefix() const override { return "html"; }

void generate_program() override {
Expand Down

0 comments on commit 45b991f

Please sign in to comment.