@labdigital/mdpostprocess
v0.1.3
Published
Usage::
Downloads
12
Keywords
Readme
Markdown post processor
Usage::
const processor = new MarkdownPostProcessor("my")
processor.registerURL("product", /product\/(?<key>[A-Za-z0-9\-\_]+)/
const rawText = "see my://product/key for more information"
const processedText = await processor.process(rawText, (tags) => {
tags.get('product')?.forEach((p) => {
p.replaceValue = "/product/some-product-slug"
})
return tags
})
// Outputs see /product/some-product-slug for more information
console.log(processedText)