md-annotator-opencode 0.5.5 → 0.5.7

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.
@@ -4,7 +4,9 @@ description: Annotate a markdown file in the browser
4
4
 
5
5
  Use the `annotate_markdown` tool to open the specified file for interactive review.
6
6
 
7
- If a file path is provided as an argument, use that file.
7
+ **Arguments:** $ARGUMENTS
8
+
9
+ If arguments contain file path(s), use those files.
8
10
  Otherwise, ask the user which markdown file they want to annotate.
9
11
 
10
12
  The user can:
package/dist/index.js CHANGED
@@ -27450,13 +27450,31 @@ function parseMarkdownToBlocks(markdown) {
27450
27450
  }
27451
27451
  if (trimmed.startsWith(">")) {
27452
27452
  flush();
27453
- blocks.push({
27454
- id: `block-${currentId++}`,
27455
- type: "blockquote",
27456
- content: trimmed.replace(/^>\s*/, ""),
27457
- order: currentId,
27458
- startLine: currentLineNum
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("```")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-annotator-opencode",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "OpenCode plugin for interactive markdown annotation",
5
5
  "license": "MIT",
6
6
  "type": "module",