Files
NapCatQQ/.pnpm-store/v3/files/c0/8dd68f68d87df4df657a0fe521c2feae2eb5651dc19ce1421158bbce41d8260ee999f1a3e3569a992a9fa0ec80e6bf112afad2750bf5b055b135fdaa53c7d5
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

23 lines
568 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* @import {State} from 'mdast-util-to-markdown'
* @import {Code} from 'mdast'
*/
/**
* @param {Code} node
* @param {State} state
* @returns {boolean}
*/
export function formatCodeAsIndented(node, state) {
return Boolean(
state.options.fences === false &&
node.value &&
// If there’s no info…
!node.lang &&
// And there’s a non-whitespace character…
/[^ \r\n]/.test(node.value) &&
// And the value doesn’t start or end in a blank…
!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(node.value)
)
}