Files
hive/mcp-server/node_modules/markdown-it/lib/rules_inline/escape.mjs
anthonyrawlins e89f2f4b7b Add comprehensive development roadmap via GitHub Issues
Created 10 detailed GitHub issues covering:
- Project activation and management UI (#1-2)
- Worker node coordination and visualization (#3-4)
- Automated GitHub repository scanning (#5)
- Intelligent model-to-issue matching (#6)
- Multi-model task execution system (#7)
- N8N workflow integration (#8)
- Hive-Bzzz P2P bridge (#9)
- Peer assistance protocol (#10)

Each issue includes detailed specifications, acceptance criteria,
technical implementation notes, and dependency mapping.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-12 19:41:01 +10:00

70 lines
1.4 KiB
JavaScript

// Process escaped chars and hardbreaks
import { isSpace } from '../common/utils.mjs'
const ESCAPED = []
for (let i = 0; i < 256; i++) { ESCAPED.push(0) }
'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
.split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1 })
export default function escape (state, silent) {
let pos = state.pos
const max = state.posMax
if (state.src.charCodeAt(pos) !== 0x5C/* \ */) return false
pos++
// '\' at the end of the inline block
if (pos >= max) return false
let ch1 = state.src.charCodeAt(pos)
if (ch1 === 0x0A) {
if (!silent) {
state.push('hardbreak', 'br', 0)
}
pos++
// skip leading whitespaces from next line
while (pos < max) {
ch1 = state.src.charCodeAt(pos)
if (!isSpace(ch1)) break
pos++
}
state.pos = pos
return true
}
let escapedStr = state.src[pos]
if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) {
const ch2 = state.src.charCodeAt(pos + 1)
if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) {
escapedStr += state.src[pos + 1]
pos++
}
}
const origStr = '\\' + escapedStr
if (!silent) {
const token = state.push('text_special', '', 0)
if (ch1 < 256 && ESCAPED[ch1] !== 0) {
token.content = escapedStr
} else {
token.content = origStr
}
token.markup = origStr
token.info = 'escape'
}
state.pos = pos + 1
return true
}