UNPKG

remark-accurate-remove

Version:

Remove anything from the markdown accurately.

23 lines (20 loc) 791 B
import { Root } from 'mdast'; import { Plugin } from 'unified'; type BoundarySpecifier = 'including-start-boundary' | 'including-end-boundary' | 'including-boundaries'; type RemoveAllContent = ['all-content', ...BoundarySpecifier[]] | [BoundarySpecifier, 'all-content', ...BoundarySpecifier[]] | [BoundarySpecifier, BoundarySpecifier, 'all-content', ...BoundarySpecifier[]]; type RemoveHTML = ['html'] | ['html', { $: string; }]; type RemoveRegex = ['regex', RegExp | string]; type RemoveStep = { remove: RemoveAllContent; range: [string, string]; } | { remove: RemoveHTML; range?: [string, string]; } | { remove: RemoveRegex; range?: [string, string]; }; declare const remarkAccurateRemove: Plugin<[RemoveStep[]], Root, Root>; export { remarkAccurateRemove };