md-annotator 0.5.6 → 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.
@@ -101,16 +101,38 @@ export function parseMarkdownToBlocks(markdown) {
101
101
  continue
102
102
  }
103
103
 
104
- // Blockquotes
104
+ // Blockquotes & GitHub alerts
105
105
  if (trimmed.startsWith('>')) {
106
106
  flush()
107
- blocks.push({
108
- id: `block-${currentId++}`,
109
- type: 'blockquote',
110
- content: trimmed.replace(/^>\s*/, ''),
111
- order: currentId,
112
- startLine: currentLineNum
113
- })
107
+ const blockquoteStartLine = currentLineNum
108
+ const bqLines = [trimmed.replace(/^>\s*/, '')]
109
+
110
+ // Collect consecutive blockquote lines
111
+ while (i + 1 < lines.length && lines[i + 1].trim().startsWith('>')) {
112
+ i++
113
+ bqLines.push(lines[i].trim().replace(/^>\s*/, ''))
114
+ }
115
+
116
+ // Check for GitHub alert syntax: [!NOTE], [!TIP], etc.
117
+ const alertMatch = bqLines[0].match(/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]$/)
118
+ if (alertMatch) {
119
+ blocks.push({
120
+ id: `block-${currentId++}`,
121
+ type: 'alert',
122
+ alertType: alertMatch[1].toLowerCase(),
123
+ content: bqLines.slice(1).join('\n'),
124
+ order: currentId,
125
+ startLine: blockquoteStartLine
126
+ })
127
+ } else {
128
+ blocks.push({
129
+ id: `block-${currentId++}`,
130
+ type: 'blockquote',
131
+ content: bqLines.join('\n'),
132
+ order: currentId,
133
+ startLine: blockquoteStartLine
134
+ })
135
+ }
114
136
  continue
115
137
  }
116
138
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-annotator",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Browser-based Markdown annotator for AI-assisted review",
5
5
  "type": "module",
6
6
  "bin": {