Skip to content
m4bwav edited this page Sep 30, 2026 · 2 revisions

The repository has no issues filed, so these are the questions the rest of the wiki answers at length, with a pointer to each.

Why was my link not replaced?

Either it is not a plain link (a markdown link, code, an image address, no http:// or https://, followed by a double quote), or its page could not be read in time, is not HTML, or has no title. The call does not say which. The full list is on Edge cases and errors. If no link in the text was replaced, suspect the network first: a proxy Node is not using, Deno without --allow-net, or an untrusted certificate.

Does it request every link in my text?

Every plain http and https link that is not an image by its extension gets a request to check whether it is an image, and every one that is not gets a second request for its title. It requests localhost and private addresses as readily as public ones, from wherever it runs (How links are replaced). Run it on text you trust.

Can it work behind a proxy?

Yes, with Node 24 and NODE_USE_ENV_PROXY=1, or with undici's proxy agent on Node 20; Deno and Bun read HTTPS_PROXY themselves (Recipes).

How do I stop it from taking long?

timeout limits each page (10 seconds by default, spent once on the image check and once on the title); a signal such as AbortSignal.timeout(5000) limits the whole call, and the Promise then rejects (Recipes).

Why does the command line add a blank line to my file?

It prints the result with console.log, which ends with a line break, so a file that already ends with one gets a second (Commands).

Why is -t '"[{{title}}]({{url}})", *{{source}}*' not the same as the default?

In a template you pass, {{title}} is HTML-escaped; the built-in default writes the title unescaped and backslash-escapes markdown characters instead (Commands).

Can I use a different link format?

Yes, any mustache template with {{title}}, {{url}} and {{source}}: plain markdown links, the address in angle brackets, reference-style links (Recipes).

Will my 1.x code still work?

The 1.x call, require('markdown-plain-link-replacer').replacePlainLinks(markdown, callback, template), still works on Node 20 or later. Some answers differ, most of them where 1.1.16 crashed, never called back or broke the text (Versions and upgrading).

Does it run in a browser?

Not tested. Its tests run on Node, Bun and Deno.

Is it a markdown parser?

No. It reads just enough of the text to skip code, existing links, autolinks, reference definitions and HTML attributes (the README says so too), and changes nothing but the plain links it replaces.