lang HTML: HEADER := $HTML"" func escape(t:Text->HTML): t = t:replace_all({ $/&/: "&", $//: ">", $/"/: """, $/'/: "'", }) return HTML.without_escaping(t) func escape_int(i:Int->HTML): return HTML.without_escaping("$i") func paragraph(content:HTML->HTML): return $HTML"
$content
" func main(): >> HTML.HEADER = $HTML"" >> HTML.HEADER.text_content = "" >> user := "I <3 hax" >> html := $HTML"Hello $user!" = $HTML"Hello I <3 hax!" >> html ++ $HTML"Hello I <3 hax!
" >> Text(html) = '$HTML"Hello I <3 hax!"'