Commit 87716db
committed
refactor: extract constants and refactor command handlers in md-tree.js
## CHANGES
- Extract magic strings into PATTERNS, LIMITS, and MESSAGES constants
- Create dedicated handler methods for each CLI command
- Add sanitizeText method with aliases for backward compatibility
- Consolidate heading level adjustment into single adjustHeadingLevels method
- Improve error handling with consistent message formatting
- Remove code duplication in command parsing logic
- Add JSDoc comments for better code documentation1 parent d787ef7 commit 87716db
1 file changed
+208
-125
lines changed
0 commit comments