It's a classic DSL; it's more readable and easier to write than equivalent HTML/JS mix (it's both shorter and has less tokens). Such DSLs are used in some languages extensively, I think the most related is xexpr DSL, for example, http://docs.racket-lang.org/web-server/servlet.html#%28def._... (the part in the code snipped starting with "response/xexpr"). It's in Lisp, which means they could write it without messing with language parser, but the idea is pretty much the same.
It's a classic DSL; it's more readable and easier to write than equivalent HTML/JS mix (it's both shorter and has less tokens). Such DSLs are used in some languages extensively, I think the most related is xexpr DSL, for example, http://docs.racket-lang.org/web-server/servlet.html#%28def._... (the part in the code snipped starting with "response/xexpr"). It's in Lisp, which means they could write it without messing with language parser, but the idea is pretty much the same.