<commit_before>webui.directive("textarea", function() {
  return {
    restrict: "E",
    link: function(scope, element) {
      element.attr(
        "placeholder",
        element.attr("placeholder").replace(/\\n/g, "\n")
      ).bind("keydown keypress", function(event) {
        if (event.ctrlKey && event.which === 13) {
          event.preventDefault();
          scope.$close();
        }
      });
    }
  };
});
<commit_msg>Fix "Cannot read property 'replace' of undefined"<commit_after>webui.directive("textarea", function() {
  return {
    restrict: "E",
    link: function(scope, element) {
      element.attr(
        "placeholder",
        function(index, placeholder) {
          if (placeholder !== undefined) {
            return placeholder.replace(/\\n/g, "\n");
          } else {
            return placeholder;
          }
        }
      ).bind("keydown keypress", function(event) {
        if (event.ctrlKey && event.which === 13) {
          event.preventDefault();
          scope.$close();
        }
      });
    }
  };
});

{'fraction_non_alphanumeric': 0.16619183285849953, 'fraction_numerical': 0.003798670465337132, 'mean_word_length': 2.0114285714285716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5492445', 'n_tokens_mistral': 304, 'n_tokens_neox': 301, 'n_words': 58}