An open API service indexing awesome lists of open source software.

https://github.com/markedjs/marked-base-url


https://github.com/markedjs/marked-base-url

extension marked

Last synced: 9 months ago
JSON representation

Awesome Lists containing this project

README

          

# marked-base-url

Prefix relative url with base url.

# Usage

```js
// 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)");
//

my url

// BROWSER

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>

```