Urara-Blog/node_modules/.pnpm-store/v3/files/0d/8a2846d83163067371f1e119880a2a511357b2cc9a0db4efd49b3eb0a627b4d0c198240154eb5b2bb028ec3170887221f971dae87f1bad7b7b568a9b5463ed
2022-08-14 01:14:53 +08:00

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
}