<commit_before>function submitComment() {
  text = document.getElementById("comment-text").value;
  comments = document.getElementById("comments").innerHTML;
  comment = '<div class="comment">' + text + '</div>';
  document.getElementById("comments").innerHTML = comment + comments;
  document.getElementById("comment-text").value = "";
}

function openModal() {
  el = document.getElementById("modal");
  el.style.visibility = "visible";
}

function closeModal() {
  el = document.getElementById("modal");
  el.style.visibility = "hidden";
}

function closeModalEvent(event) {
  if (event.target.id == "modal") {
    closeModal();
  }
}

function shame() {
  link = document.getElementById("link").value;
  httpRequest = new XMLHttpRequest();
  httpRequest.open('POST', 'https://5w7zwh5alf.execute-api.us-east-1.amazonaws.com/prod/pygmentize');
  httpRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
  httpRequest.send(JSON.stringify({github_link: link}));
  closeModal();
}
<commit_msg>escape html<commit_after>function submitComment() {
  text = escapeHtml(document.getElementById("comment-text").value);
  comments = document.getElementById("comments").innerHTML;
  comment = '<div class="comment">' + text + '</div>';
  document.getElementById("comments").innerHTML = comment + comments;
  document.getElementById("comment-text").value = "";
}

function escapeHtml(str) {
  var div = document.createElement('div');
  div.appendChild(document.createTextNode(str));
  return div.innerHTML;
};

function unescapeHtml(escapedStr) {
  var div = document.createElement('div');
  div.innerHTML = escapedStr;
  var child = div.childNodes[0];
  return child ? child.nodeValue : '';
};

function openModal() {
  el = document.getElementById("modal");
  el.style.visibility = "visible";
}

function closeModal() {
  el = document.getElementById("modal");
  el.style.visibility = "hidden";
}

function closeModalEvent(event) {
  if (event.target.id == "modal") {
    closeModal();
  }
}

function shame() {
  link = document.getElementById("link").value;
  httpRequest = new XMLHttpRequest();
  httpRequest.open('POST', 'https://5w7zwh5alf.execute-api.us-east-1.amazonaws.com/prod/pygmentize');
  httpRequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
  httpRequest.send(JSON.stringify({github_link: link}));
  closeModal();
}

{'fraction_non_alphanumeric': 0.16821247892074198, 'fraction_numerical': 0.00463743676222597, 'mean_word_length': 5.4135135135135135, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6664294', 'n_tokens_mistral': 708, 'n_tokens_neox': 700, 'n_words': 116}