1.1.3 • Published 3 months ago

marked-base-url v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

marked-base-url

Prefix relative url with base url.

Usage

// ESM
import {marked} from "marked";
import {baseUrl} from "marked-base-url";

marked.use(baseUrl("https://example.com/folder/"));
const html = marked.parse("[my url](./relative/path)");
// <p><a href="https://example.com/folder/relative/path">my url</a></p>

// BROWSER
<script src="https://cdn.jsdelivr.net/npm/marked"></script>
<script src="https://cdn.jsdelivr.net/npm/marked-base-url"></script>
<script>
    marked.use(markedBaseUrl.baseUrl("https://example.com/folder/"));
    const html = marked.parse("[my url](./relative/path)");
    // <p><a href="https://example.com/folder/relative/path">my url</a></p>
</script>
1.1.3

3 months ago

1.1.2

5 months ago

1.1.1

6 months ago

1.1.0

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.2

10 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

10 months ago

1.0.1

1 year ago

1.0.0

1 year ago