All files / plugins / ruby.ts

100.00% Branches 0/0
100.00% Lines 9/9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
x1
 
x1
 
x1
 
 
 
 
 
 
 
 
 
x1
x1
x1
x2
x2
x1

















// Imports
import type { Plugin } from "../renderer.ts"
import remarkRuby from "remark-ruby"

/**
 * Add support for {@link https://developer.mozilla.org/docs/Web/HTML/Element/ruby | ruby} text.
 *
 * @example
 * ```md
 * {漢字}^(kanji)
 * ```
 * ```html
 * <ruby>漢字<rp>(</rp><rt>kanji</rt><rp>)</rp></ruby>
 * ```
 */
export default {
  remark(processor) {
    return processor.use(remarkRuby)
  },
} as Plugin