mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Split micromark.cjs into separate -parse and -helpers files.
This commit is contained in:
parent
5701d0bf52
commit
33631a5984
47 changed files with 353 additions and 1236 deletions
|
|
@ -3,7 +3,7 @@
|
|||
"use strict";
|
||||
|
||||
const { addError, addErrorDetailIf, getHtmlAttributeRe } = require("../helpers");
|
||||
const { filterByPredicate, filterByTypes, getHtmlTagInfo } = require("../helpers/micromark.cjs");
|
||||
const { filterByPredicate, filterByTypes, getHtmlTagInfo } = require("../helpers/micromark-helpers.cjs");
|
||||
const { filterByTypesCached } = require("./cache");
|
||||
|
||||
// Regular expression for identifying HTML anchor names
|
||||
|
|
@ -22,7 +22,7 @@ const tokensInclude = new Set(
|
|||
* Converts a Markdown heading into an HTML fragment according to the rules
|
||||
* used by GitHub.
|
||||
*
|
||||
* @param {import("../helpers/micromark.cjs").Token} headingText Heading text token.
|
||||
* @param {import("../helpers/micromark-helpers.cjs").Token} headingText Heading text token.
|
||||
* @returns {string} Fragment string for heading.
|
||||
*/
|
||||
function convertHeadingToHTMLFragment(headingText) {
|
||||
|
|
@ -51,7 +51,7 @@ function convertHeadingToHTMLFragment(headingText) {
|
|||
/**
|
||||
* Unescapes the text of a String-type micromark Token.
|
||||
*
|
||||
* @param {import("../helpers/micromark.cjs").Token} token String-type micromark Token.
|
||||
* @param {import("../helpers/micromark-helpers.cjs").Token} token String-type micromark Token.
|
||||
* @returns {string} Unescaped token text.
|
||||
*/
|
||||
function unescapeStringTokenText(token) {
|
||||
|
|
@ -104,7 +104,7 @@ module.exports = {
|
|||
|
||||
// Process link and definition fragments
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../helpers/micromark.cjs").TokenType[][] */
|
||||
/** @type import("../helpers/micromark-helpers.cjs").TokenType[][] */
|
||||
const parentChilds = [
|
||||
[ "link", "resourceDestinationString" ],
|
||||
[ "definition", "definitionDestinationString" ]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue