mdast-util-to-hast
Advanced tools
Comparing version 11.2.0 to 11.2.1
@@ -19,3 +19,3 @@ /** | ||
const rows = node.children | ||
let index = rows.length | ||
let index = -1 | ||
const align = node.align || [] | ||
@@ -25,3 +25,3 @@ /** @type {Array.<Element>} */ | ||
while (index--) { | ||
while (++index < rows.length) { | ||
const row = rows[index].children | ||
@@ -28,0 +28,0 @@ const name = index === 0 ? 'th' : 'td' |
@@ -27,4 +27,2 @@ /** | ||
export type PositionLike = import('unist-util-position').PositionLike | ||
export type FootnoteDefinitionVisitor = | ||
import('unist-util-visit').Visitor<FootnoteDefinition> | ||
export type Content = Element | Text | Comment | ||
@@ -31,0 +29,0 @@ export type EmbeddedHastFields = { |
@@ -13,3 +13,2 @@ /** | ||
* @typedef {import('unist-util-position').PositionLike} PositionLike | ||
* @typedef {import('unist-util-visit').Visitor<FootnoteDefinition>} FootnoteDefinitionVisitor | ||
* | ||
@@ -99,4 +98,12 @@ * @typedef {Element|Text|Comment} Content | ||
visit(tree, 'footnoteDefinition', onfootnotedefinition) | ||
visit(tree, 'footnoteDefinition', (definition) => { | ||
const id = String(definition.identifier).toUpperCase() | ||
// Mimick CM behavior of link definitions. | ||
// See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8290999/index.js#L26>. | ||
if (!own.call(footnoteById, id)) { | ||
footnoteById[id] = definition | ||
} | ||
}) | ||
// @ts-expect-error Hush, it’s fine! | ||
@@ -169,15 +176,2 @@ return h | ||
} | ||
/** | ||
* @type {FootnoteDefinitionVisitor} | ||
*/ | ||
function onfootnotedefinition(definition) { | ||
const id = String(definition.identifier).toUpperCase() | ||
// Mimick CM behavior of link definitions. | ||
// See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8290999/index.js#L26>. | ||
if (!own.call(footnoteById, id)) { | ||
footnoteById[id] = definition | ||
} | ||
} | ||
} | ||
@@ -184,0 +178,0 @@ |
{ | ||
"name": "mdast-util-to-hast", | ||
"version": "11.2.0", | ||
"version": "11.2.1", | ||
"description": "mdast utility to transform to hast", | ||
@@ -45,3 +45,3 @@ "license": "MIT", | ||
"unist-util-position": "^4.0.0", | ||
"unist-util-visit": "^3.0.0" | ||
"unist-util-visit": "^4.0.0" | ||
}, | ||
@@ -51,5 +51,11 @@ "devDependencies": { | ||
"c8": "^7.0.0", | ||
"hast-util-to-html": "^8.0.0", | ||
"mdast-util-footnote": "^1.0.0", | ||
"mdast-util-from-markdown": "^1.0.0", | ||
"mdast-util-gfm": "^1.0.0", | ||
"micromark-extension-footnote": "^1.0.0", | ||
"micromark-extension-gfm": "^1.0.0", | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^9.0.0", | ||
"remark-preset-wooorm": "^8.0.0", | ||
"remark-cli": "^10.0.0", | ||
"remark-preset-wooorm": "^9.0.0", | ||
"rimraf": "^3.0.0", | ||
@@ -59,3 +65,3 @@ "tape": "^5.0.0", | ||
"typescript": "^4.0.0", | ||
"xo": "^0.42.0" | ||
"xo": "^0.44.0" | ||
}, | ||
@@ -62,0 +68,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57316
16
1554
- Removedunist-util-visit@3.1.0(transitive)
- Removedunist-util-visit-parents@4.1.1(transitive)
Updatedunist-util-visit@^4.0.0