All files / plugins / linebreaks.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
21
x1
 
x3
 
x1
 
 
 
 
 
 
 
 
 
 
x3
x3
x3
x4
x4
x3


















// Imports
import type { Plugin } from "../renderer.ts"
import remarkBreaks from "remark-breaks"

/**
 * Force line-breaks to be hard-breaks.
 *
 * @example
 * ```md
 * foo
 * bar
 * ```
 * ```html
 * <p>foo<br>bar</p>
 * ```
 */
export default {
  remark(processor) {
    return processor.use(remarkBreaks)
  },
} as Plugin