// @ts-check "use strict"; const { addErrorDetailIf, escapeForRegExp, newLineRe, withinAnyRange } = require("../helpers"); const { filterByPredicate, filterByTypes, parse } = require("../helpers/micromark.cjs"); const ignoredChildTypes = new Set( [ "codeFencedFence", "definition", "reference", "resource" ] ); module.exports = { "names": [ "MD044", "proper-names" ], "description": "Proper names should have the correct capitalization", "tags": [ "spelling" ], "function": function MD044(params, onError) { let names = params.config.names; names = Array.isArray(names) ? names : []; names.sort((a, b) => (b.length - a.length) || a.localeCompare(b)); const codeBlocks = params.config.code_blocks; const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks; const htmlElements = params.config.html_elements; const includeHtmlElements = (htmlElements === undefined) ? true : !!htmlElements; const scannedTypes = new Set([ "data", "htmlFlowData" ]); if (includeCodeBlocks) { scannedTypes.add("codeFlowValue"); scannedTypes.add("codeTextData"); } const tokenAdjustments = new Map(); const contentTokens = filterByPredicate( params.parsers.micromark.tokens, (token) => scannedTypes.has(token.type), (token) => { let { children } = token; const { startLine, text } = token; if (!includeHtmlElements && (token.type === "htmlFlow")) { if (text.startsWith("