Skip to content

Instantly share code, notes, and snippets.

View premasagar's full-sized avatar

Prem Rose premasagar

View GitHub Profile
function compile (template) {
function addText (buffer, text, unescaped) {
unescaped = !!unescaped;
buffer.push("\tprint(");
buffer.push(unescaped ? text : "\"" + text
.split("\r").join("\\r")
.split("\n").join("\\n")
.split("\t").join("\\t")
.split("\"").join("\\\"")
+ "\""