<commit_before>import { Composer } from "../views/composer";
import { getParentElement } from "../dom/get_parent_element";

Composer.RegisterTextSubstitution(function(textContent) {
  return (textContent == "1." || textContent == "•" || textContent == "*");
}, function(editor, composer, range, textContent, e) {
  composer.selection.executeAndRestore(function() {
    range.deleteContents();

    var selection = composer.selection.getSelection().nativeSelection;
    selection.removeAllRanges();
    selection.addRange(range);

    var command = (textContent == "1.") ? "insertOrderedList" : "insertUnorderedList";
    composer.commands.exec(command);
  });
}, {
  word: true,
  sentence: false
});<commit_msg>Prevent default if the commit key was space<commit_after>import { Composer } from "../views/composer";
import { getParentElement } from "../dom/get_parent_element";
import { Constants } from "../constants";

Composer.RegisterTextSubstitution(function(textContent) {
  return (textContent == "1." || textContent == "•" || textContent == "*");
}, function(editor, composer, range, textContent, e) {
  composer.selection.executeAndRestore(function() {
    range.deleteContents();

    var selection = composer.selection.getSelection().nativeSelection;
    selection.removeAllRanges();
    selection.addRange(range);

    var command = (textContent == "1.") ? "insertOrderedList" : "insertUnorderedList";
    composer.commands.exec(command);
  });
  if (e.type === "keydown" && e.keyCode == Constants.SPACE_KEY) {
    e.preventDefault();
  }
}, {
  word: true,
  sentence: false
});
{'fraction_non_alphanumeric': 0.1610062893081761, 'fraction_numerical': 0.0025157232704402514, 'mean_word_length': 4.7644927536231885, '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': '7650860', 'n_tokens_mistral': 462, 'n_tokens_neox': 462, 'n_words': 93}