lang HTML HEADER := $HTML"" convert(t:Text->HTML) t = t.translate({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'", }) return HTML.from_text(t) convert(i:Int->HTML) return HTML.from_text("$i") func paragraph(content:HTML->HTML) return $HTML"

$content

" struct Bold(text:Text) convert(b:Bold -> HTML) return $HTML"$(b.text)" func main() >> HTML.HEADER = $HTML"" >> HTML.HEADER[1] = $HTML"<" >> HTML.HEADER.text = "" >> user := "I <3 hax" >> html := $HTML"Hello $user!" = $HTML"Hello I <3 hax!" >> html ++ $HTML"
" = $HTML"Hello I <3 hax!
" >> $HTML"$(1 + 2)" = $HTML"3" >> $HTML"$(Int8(3))" = $HTML"3" >> html.paragraph() = $HTML"

Hello I <3 hax!

" >> Text(html) = '\$HTML"Hello I <3 hax!"' >> b := Bold("Some with junk") >> $HTML"Your text: $b" = $HTML"Your text: Some <text> with junk"