archive/directives/process/process_js_directives.js
function consume_template (proc_stack) {
  let template = "`";
  proc_stack.tSkip(1);

  let escaping = 0;
  let done = false;

  while (!done) {
    let c = proc_stack.tAccept();
    if (c == "\\") {
      escaping ^= 1;

    } else {
      if (c == "`" && !escaping) {
        done = true;
      }

      escaping = 0;
    }

    template += c;
  }

  return template;
}
function consume_template (proc_stack) {
  let template = "`";
  proc_stack.tSkip(1);

  let escaping = 0;
  let done = false;

  while (!done) {
    let c = proc_stack.tAccept();
    if (c == "\\") {
      escaping ^= 1;

    } else {
      if (c == "`" && !escaping) {
        done = true;
      }

      escaping = 0;
    }

    template += c;
  }

  return template;
}
Called on match `\``