Skip to content

Releases: luckrya/markdown-it-link-to-card

V0.3.3

09 Dec 07:57
Compare
Choose a tag to compare
  • add HTML character escape to avoid compilation exception.

V0.3.2

07 Dec 09:46
Compare
Choose a tag to compare
  • Fixed nesting exception between dom elements.

V0.3.1

31 Oct 12:34
Compare
Choose a tag to compare

A markdown-it plugin for turning page links into link cards (which contain brief information about the link).

  • Extract links with special flags (eg. [text]($:url)) and convert them into card information display.
  • Support for custom renderers to support rendering into anything you want.
  • Support injecting class names for cards to support custom styles.
import MarkdownIt from "markdown-it";
import { linkToCardPlugin } from "@luckrya/markdown-it-link-to-card";
import type { LinkToCardPluginOptions } from "@luckrya/markdown-it-link-to-card";

const md = MarkdownIt({ html: true }).use<LinkToCardPluginOptions>(
  linkToCardPlugin,
  {
    // options
    size: "small",
  }
);

const rendered = md.render(`

# Home

...

### Reference

  - [github](https://github.com)
  - [bing](https://cn.bing.com/)
  - [鐭ヤ箮 - 鍙戠幇椤礭(https://www.zhihu.com/explore)
  - [markdown-it-link-to-card](https://github.com/luckrya/markdown-it-link-to-card)

<br />

  - [github](@:https://github.com)
  - [bing](@:https://cn.bing.com)
  - [鐭ヤ箮 - 鍙戠幇椤礭(@:https://www.zhihu.com/explore)
  - [markdown-it-link-to-card](@:https://github.com/luckrya/markdown-it-link-to-card)

`);

Rendering results