md-annotator-opencode 0.5.6 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/annotator.html +205 -203
- package/dist/index.js +25 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27450,13 +27450,31 @@ function parseMarkdownToBlocks(markdown) {
|
|
|
27450
27450
|
}
|
|
27451
27451
|
if (trimmed.startsWith(">")) {
|
|
27452
27452
|
flush();
|
|
27453
|
-
|
|
27454
|
-
|
|
27455
|
-
|
|
27456
|
-
|
|
27457
|
-
|
|
27458
|
-
|
|
27459
|
-
|
|
27453
|
+
const blockquoteStartLine = currentLineNum;
|
|
27454
|
+
const bqLines = [trimmed.replace(/^>\s*/, "")];
|
|
27455
|
+
while (i + 1 < lines.length && lines[i + 1].trim().startsWith(">")) {
|
|
27456
|
+
i++;
|
|
27457
|
+
bqLines.push(lines[i].trim().replace(/^>\s*/, ""));
|
|
27458
|
+
}
|
|
27459
|
+
const alertMatch = bqLines[0].match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]$/);
|
|
27460
|
+
if (alertMatch) {
|
|
27461
|
+
blocks.push({
|
|
27462
|
+
id: `block-${currentId++}`,
|
|
27463
|
+
type: "alert",
|
|
27464
|
+
alertType: alertMatch[1].toLowerCase(),
|
|
27465
|
+
content: bqLines.slice(1).join("\n"),
|
|
27466
|
+
order: currentId,
|
|
27467
|
+
startLine: blockquoteStartLine
|
|
27468
|
+
});
|
|
27469
|
+
} else {
|
|
27470
|
+
blocks.push({
|
|
27471
|
+
id: `block-${currentId++}`,
|
|
27472
|
+
type: "blockquote",
|
|
27473
|
+
content: bqLines.join("\n"),
|
|
27474
|
+
order: currentId,
|
|
27475
|
+
startLine: blockquoteStartLine
|
|
27476
|
+
});
|
|
27477
|
+
}
|
|
27460
27478
|
continue;
|
|
27461
27479
|
}
|
|
27462
27480
|
if (trimmed.startsWith("```")) {
|