remark-relative-links
Rewrites absolute URLs to relative ones with remark
Installation
yarn add remark-relative-links
Usage
Source
const html = ;const remark = ;const relativeLinks = ; ;
Yields
Blog
API
remark.use(relativeLinks[, options])
Add target and rel attributes to external links.
options.domainRegex
Required
Regex used to decipher what domain to "relative-ize". The example provided should handle most cases.