<commit_before>/* eslint-disable */

// must have dl, with:
//  dts containing "This Version", "Latest Version", "Previous Version" in that order
//  this version is https://www.w3.org/TR/2013/WD-shortname-2013MMDD/
//  latest version is https://www.w3.org/TR/shortname/
//  #w3c-state date and this version date must match
//  dt for editor or author

const superagent = require('superagent');

const self = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'docIDFormat',
};
const thisError = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'docIDThisVersion',
};
const latestError = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'docIDLatestVersion',
};
const historyError = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'docIDHistory',
};
const editorError = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'editorSection',
};
exports.name = self.name;

/**
 * Check if link and href are consistant.
 * @param {} Object place to find <a>, current error message title when there is error.
 * @returns boolean whether element exists and can continue
 */
function checkLink({ sr, rule = self, element, linkName, mustHave = true }) {
    if (!element || !element.href) {
        if (mustHave) sr.error(rule, 'not-found', { linkName });
        return false;
    }
    const text = element.textContent.trim();<commit_msg>line wrap<commit_after>/* eslint-disable */

// must have dl, with:
//  dts containing "This Version", "Latest Version", "Previous Version" in that order
//  this version is https://www.w3.org/TR/2013/WD-shortname-2013MMDD/
//  latest version is https://www.w3.org/TR/shortname/
//  #w3c-state date and this version date must match
//  dt for editor or author

const superagent = require('superagent');

const self = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'docIDFormat',
};
const thisError = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'docIDThisVersion',
};
const latestError = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'docIDLatestVersion',
};
const historyError = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'docIDHistory',
};
const editorError = {
    name: 'headers.dl',
    section: 'front-matter',
    rule: 'editorSection',
};
exports.name = self.name;

/**
 * Check if link and href are consistant.
 * @param {} Object place to find <a>, current error message title when there is error.
 * @returns boolean whether element exists and can continue
 */
function checkLink({ sr, rule = self, element, linkName, mustHave = true }) {
    if (!element || !element.href) {
        if (mustHave) sr.error(rule, 'not-found', { linkName });
        return false;
    }
    const text = sr.norm(element.textContent).trim();
{'fraction_non_alphanumeric': 0.1486342674707343, 'fraction_numerical': 0.007804185881518269, 'mean_word_length': 3.2792109256449167, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '4496591', 'n_tokens_mistral': 911, 'n_tokens_neox': 883, 'n_words': 268}