mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-06 21:09:14 +08:00
19 lines
529 B
Text
19 lines
529 B
Text
/**
|
|
* @typedef {import('../types.js').Handle} Handle
|
|
* @typedef {import('mdast').ThematicBreak} ThematicBreak
|
|
*/
|
|
|
|
import {checkRuleRepetition} from '../util/check-rule-repetition.js'
|
|
import {checkRule} from '../util/check-rule.js'
|
|
|
|
/**
|
|
* @type {Handle}
|
|
* @param {ThematicBreak} _
|
|
*/
|
|
export function thematicBreak(_, _1, context) {
|
|
const value = (
|
|
checkRule(context) + (context.options.ruleSpaces ? ' ' : '')
|
|
).repeat(checkRuleRepetition(context))
|
|
|
|
return context.options.ruleSpaces ? value.slice(0, -1) : value
|
|
}
|