<commit_before>const Selector = {
  WELCOME_TITLE: '.welcome__title',
  ARTICLE_HEADLINE: '.article h1:first-of-type',
};


/**
 * A mapping of labels to marked representations. These marked representations
 * are different than what the marking algorithm would produce, but look better
 * on the page.
 */
const SPECIAL_CASES = {
  'Material Components for iOS': 'Material•Components for•iOS¬'
};


export function addHiddenMarks() {
  addMarksToAllMatching(Selector.ARTICLE_HEADLINE);
  addMarksToAllMatching(Selector.WELCOME_TITLE);
}


function addMarksToAllMatching(selector) {
  const matchingElements = Array.from(document.querySelectorAll(selector))
  matchingElements.forEach((el) => addMarksToElement(el));
}


function addMarksToElement(el) {
  const text = el.textContent.trim();

  // We convert to text containing marks instead of HTML first, so that our
  // SPECIAL_CASES mapping is more readable.
  const markedText = addMarksToText(text);
  el.innerHTML = convertMarkedTextToHtml(markedText);
}


function addMarksToText(text) {
  return text in SPECIAL_CASES ?
      SPECIAL_CASES[text] :
      text<commit_msg>Updates hidden marks to include a couple more special cases.<commit_after>const Selector = {
  WELCOME_TITLE: '.welcome__title',
  ARTICLE_HEADLINE: '.article h1:first-of-type',
};


/**
 * A mapping of labels to marked representations. These marked representations
 * are different than what the marking algorithm would produce, but look better
 * on the page.
 */
const SPECIAL_CASES = {
  'Material Components for iOS': 'Material•Components for•iOS¬',
  'Material Components for Web': 'Material•Components for•Web¬',
  'Material Components for Android': 'Material•Components for•Android¬',
};


export function addHiddenMarks() {
  addMarksToAllMatching(Selector.ARTICLE_HEADLINE);
  addMarksToAllMatching(Selector.WELCOME_TITLE);
}


function addMarksToAllMatching(selector) {
  const matchingElements = Array.from(document.querySelectorAll(selector))
  matchingElements.forEach((el) => addMarksToElement(el));
}


function addMarksToElement(el) {
  const text = el.textContent.trim();

  // We convert to text containing marks instead of HTML first, so that our
  // SPECIAL_CASES mapping is more readable.
  const markedText = addMarksToText(text);
  el.innerHTML = convertMarkedTextToHtml(markedText);
}


function addMarksToText(text) {
  return text in SPECIAL_CASES ?
      SPECIAL_CASES[text] :
      text
{'fraction_non_alphanumeric': 0.0964840556009812, 'fraction_numerical': 0.0008176614881439084, 'mean_word_length': 5.07196029776675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2478860', 'n_tokens_mistral': 761, 'n_tokens_neox': 730, 'n_words': 196}