All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
15 lines
409 B
JavaScript
15 lines
409 B
JavaScript
module.exports = formatCodeAsIndented
|
||
|
||
function formatCodeAsIndented(node, context) {
|
||
return (
|
||
!context.options.fences &&
|
||
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)
|
||
)
|
||
}
|