myst-transforms
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -7,2 +7,3 @@ import type { Plugin } from 'unified'; | ||
transformers: LinkTransformer[]; | ||
selector?: string; | ||
}; | ||
@@ -9,0 +10,0 @@ export declare function linksTransform(mdast: Root, file: VFile, opts: Options): void; |
@@ -6,3 +6,4 @@ "use strict"; | ||
function linksTransform(mdast, file, opts) { | ||
var linkNodes = (0, unist_util_select_1.selectAll)('link', mdast); | ||
var _a; | ||
var linkNodes = (0, unist_util_select_1.selectAll)((_a = opts.selector) !== null && _a !== void 0 ? _a : 'link,card', mdast); | ||
linkNodes.forEach(function (link) { | ||
@@ -9,0 +10,0 @@ if (!link.urlSource) |
@@ -7,2 +7,3 @@ import type { Plugin } from 'unified'; | ||
transformers: LinkTransformer[]; | ||
selector?: string; | ||
}; | ||
@@ -9,0 +10,0 @@ export declare function linksTransform(mdast: Root, file: VFile, opts: Options): void; |
import { selectAll } from 'unist-util-select'; | ||
export function linksTransform(mdast, file, opts) { | ||
var linkNodes = selectAll('link', mdast); | ||
var _a; | ||
var linkNodes = selectAll((_a = opts.selector) !== null && _a !== void 0 ? _a : 'link,card', mdast); | ||
linkNodes.forEach(function (link) { | ||
@@ -5,0 +6,0 @@ if (!link.urlSource) |
@@ -7,2 +7,3 @@ import type { Plugin } from 'unified'; | ||
transformers: LinkTransformer[]; | ||
selector?: string; | ||
}; | ||
@@ -9,0 +10,0 @@ export declare function linksTransform(mdast: Root, file: VFile, opts: Options): void; |
{ | ||
"name": "myst-transforms", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "./dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/esm/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
236101
4415