remark-trim-md-extension

1.0.0 • Public • Published

remark-trim-md-extension

Remark plugin to remove the .md extension when you have links to other md files. This is for example useful when you use markdown files as pages in NextJS.

Installation

npm install remark-trim-md-extension

Example usage

import remark from 'remark';
import html from 'remark-html';
import trimMdExtension from 'remark-trim-md-extension';

async function markdownToHtml(markdown) {
    const result = await remark()
        .use(html)
        .use(RemoveMdExtension)
        .process(markdown);

    return result.toString();
}

When given Here is a [link](local-file.md) this will result in Here is a <a href="local-file">link</a>

Package Sidebar

Install

npm i remark-trim-md-extension

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

2.51 kB

Total Files

4

Last publish

Collaborators

  • jeroeng