<commit_before>import _ from 'lodash'
import HTMLElementAttributes from 'html-element-attributes/index.json'
import jsdom from 'jsdom'
import bail from 'bail'
import fs from 'fs'
import { join } from 'path'

const htmlAttributeListTitleSelector = 'h2:contains("All Supported HTML Attributes")'
const svgAttributeListTitleSelector = 'h2:contains("All Supported SVG Attributes")'
const reactDomElementDocUrl = 'https://facebook.github.io/react/docs/dom-elements.html'
const jQueryScriptUrl = 'http://code.jquery.com/jquery.js'
const attributeListParentNodeSelector = '.highlight'
const attributeFileName = 'react-html-attributes.json'

// attributes that cannot be crawled on the above website, copied from that site
const hardCodedReactHTMLAttributes = {
  '*': [
    'className',
    'dangerouslySetInnerHTML',
    'htmlFor',
    'style',
    'suppressContentEditableWarning',
    'itemProp',
    'itemScope',
    'itemType',
    'itemRef',
    'itemID',
  ],
  input: [
    'checked',
    'value',
    'onChange',
    'defaultValue',
    'defaultChecked',
    'autoCapitalize',
    'autoCorrect',
  ],
  textarea: [
    'value',
    'onChange',
    'defaultValue',
    'autoCapitalize',
    'autoCorrect',
  ],
  select: [
    'value',
    'onChange',
    'defaultValue',
  ],
  option: [
    'selected',
    'value',
  ],
  link: [
    'color',
  ],
}

const getAttributeList = (jQuery, listTitleSelector) => {
  const titleNode = jQuery(listTitleSelector)
  const attributeListNode = titleNode.nextAll(attributeListParentNodeSelector).first()

  return attributeListNode.text().replace(/\n/g, ' ').split(' ')
}

jsdom.env(<commit_msg>fix(build-json.js): Add a few SVG properties<commit_after>import _ from 'lodash'
import HTMLElementAttributes from 'html-element-attributes/index.json'
import jsdom from 'jsdom'
import bail from 'bail'
import fs from 'fs'
import { join } from 'path'

const htmlAttributeListTitleSelector = 'h2:contains("All Supported HTML Attributes")'
const svgAttributeListTitleSelector = 'h2:contains("All Supported SVG Attributes")'
const reactDomElementDocUrl = 'https://facebook.github.io/react/docs/dom-elements.html'
const jQueryScriptUrl = 'http://code.jquery.com/jquery.js'
const attributeListParentNodeSelector = '.highlight'
const attributeFileName = 'react-html-attributes.json'

// attributes that cannot be crawled on the above website, copied from that site
const hardCodedReactHTMLAttributes = {
  '*': [
    'className',
    'dangerouslySetInnerHTML',
    'htmlFor',
    'style',
    'suppressContentEditableWarning',
    'itemProp',
    'itemScope',
    'itemType',
    'itemRef',
    'itemID',
  ],
  input: [
    'checked',
    'value',
    'onChange',
    'defaultValue',
    'defaultChecked',
    'autoCapitalize',
    'autoCorrect',
  ],
  textarea: [
    'value',
    'onChange',
    'defaultValue',
    'autoCapitalize',
    'autoCorrect',
  ],
  select: [
    'value',
    'onChange',
    'defaultValue',
  ],
  option: [
    'selected',
    'value',
  ],
  link: [
    'color',
  ],
  svg: [
    'color',
    'height',
    'width',
  ]
}

const getAttributeList = (jQuery, listTitleSelector) => {
  const titleNode = jQuery(listTitleSelector)
  const attributeListNode = titleNode.nextAll(attributeListParentNodeSelector).first()

  return attributeListNode.text().replace(/\n/g, ' ').split(' ')
}

jsdom.env(
{'fraction_non_alphanumeric': 0.13847528290649197, 'fraction_numerical': 0.0011911852293031567, 'mean_word_length': 3.9689349112426036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1953698', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1071, 'n_words': 228}