AI-assisted engineering/AI-collaboration build

Fix render for the order email templates

AI-collaboration buildHard45 min

Order confirmation emails are built from HTML templates and customer data. Since the renderer was rewritten, some emails show mangled text and some leave parts out.

Your task

Fix render so it honors its contract. The assistant may help, and it may be wrong more than once.

  • {{ name }} inserts the value with & < > " and ' each escaped once, and {{{ name }}} inserts it as it is
  • an inserted value is never read as a tag
  • a dotted name looks up one step at a time, and a missing step or a value of None renders as nothing
  • {{#items}}...{{/items}} repeats its inside for each element of the list items, and inside it {{.}} is the element
  • inside a section, a name, or the first part of a dotted one, is looked up in the element first, then outside the section
  • leave run_case alone; it is what the tests call

Hidden tests run at submit. Your prompts, runs and edits are the trace the critique reads.