Files
rspade_system/vendor/spatie/ignition/node_modules/micromark-util-classify-character/index.js
root f6fac6c4bc Fix bin/publish: copy docs.dist from project root
Fix bin/publish: use correct .env path for rspade_system
Fix bin/publish script: prevent grep exit code 1 from terminating script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 02:08:33 +00:00

35 lines
731 B
JavaScript
Executable File

/**
* @typedef {import('micromark-util-types').Code} Code
*/
import {
markdownLineEndingOrSpace,
unicodePunctuation,
unicodeWhitespace
} from 'micromark-util-character'
/**
* Classify whether a character code represents whitespace, punctuation, or
* something else.
*
* Used for attention (emphasis, strong), whose sequences can open or close
* based on the class of surrounding characters.
*
* Note that eof (`null`) is seen as whitespace.
*
* @param {Code} code
* @returns {number|undefined}
*/
export function classifyCharacter(code) {
if (
code === null ||
markdownLineEndingOrSpace(code) ||
unicodeWhitespace(code)
) {
return 1
}
if (unicodePunctuation(code)) {
return 2
}
}