remove-markdown icon indicating copy to clipboard operation
remove-markdown copied to clipboard

Extract text and link from inline links

Open tafel opened this issue 3 months ago • 0 comments

Hello,

For inline links extraction, the current behaviour is to replace [text](http://link.net) either by text (replaceLinksWithURL = false) or by http://link.net (replaceLinksWithURL = true).

Is it possible to print both text and link, like text: http://link.net ?

Maybe with an option separator?

Options should be like:

const plainText = removeMd(markdown, {
  separateLinksAndText: ': ' // default to null
})

// in index.js, something like
if (options.separateLinksAndText) {
  output.replace(/\[([^\]]+)\]\(([^)]+)\)/g, `$1${options.separateLinksAndText}$2`);
}

Thanks

tafel avatar Nov 21 '25 07:11 tafel