https://github.com/markedjs/marked-base-url
https://github.com/markedjs/marked-base-url
extension marked
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/markedjs/marked-base-url
- Owner: markedjs
- License: mit
- Created: 2023-04-01T18:29:57.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-09-29T20:42:30.000Z (9 months ago)
- Last Synced: 2025-09-29T21:41:26.500Z (9 months ago)
- Topics: extension, marked
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/marked-base-url
- Size: 3.23 MB
- Stars: 6
- Watchers: 4
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)");
//
// 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>
```