From 7a52ddeba2a68388b544f529d2d92104420f77b0 Mon Sep 17 00:00:00 2001 From: Shipwreckt Date: Fri, 31 Oct 2025 20:02:14 +0000 Subject: Changed from static to 11ty! --- node_modules/markdown-it/lib/rules_block/code.mjs | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 node_modules/markdown-it/lib/rules_block/code.mjs (limited to 'node_modules/markdown-it/lib/rules_block/code.mjs') diff --git a/node_modules/markdown-it/lib/rules_block/code.mjs b/node_modules/markdown-it/lib/rules_block/code.mjs new file mode 100644 index 0000000..e45e6f9 --- /dev/null +++ b/node_modules/markdown-it/lib/rules_block/code.mjs @@ -0,0 +1,30 @@ +// Code block (4 spaces padded) + +export default function code (state, startLine, endLine/*, silent */) { + if (state.sCount[startLine] - state.blkIndent < 4) { return false } + + let nextLine = startLine + 1 + let last = nextLine + + while (nextLine < endLine) { + if (state.isEmpty(nextLine)) { + nextLine++ + continue + } + + if (state.sCount[nextLine] - state.blkIndent >= 4) { + nextLine++ + last = nextLine + continue + } + break + } + + state.line = last + + const token = state.push('code_block', 'code', 0) + token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n' + token.map = [startLine, state.line] + + return true +} -- cgit v1.2.3