@krotovm/gitlab-ai-review 1.0.24 → 1.0.25

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.
@@ -17,9 +17,17 @@ export function normalizeReviewFindingsMarkdown(input) {
17
17
  const normalized = input.replace(/\r\n/g, "\n").trim();
18
18
  if (normalized === "" || normalized === NO_ISSUES_SENTENCE)
19
19
  return normalized;
20
- const lines = normalized.split("\n");
20
+ // Some providers collapse each finding into one long line.
21
+ // Expand inline markers so parser can recover structured blocks.
22
+ const expanded = normalized
23
+ .replace(/\s+(File:\s*)/gi, "\n$1")
24
+ .replace(/\s+(Line:\s*)/gi, "\n$1")
25
+ .replace(/\s+(Why:\s*)/gi, "\n$1")
26
+ .replace(/(Why:\s*[^\n]+?)\s+([-*•]\s*\[(?:high|medium)\])/gi, "$1\n$2")
27
+ .trim();
28
+ const lines = expanded.split("\n");
21
29
  const findings = [];
22
- const headerRe = /^\s*-?\s*\[(high|medium)\]\s+(.+?)\s*$/i;
30
+ const headerRe = /^\s*(?:[-*•]\s*)?\[(high|medium)\]\s+(.+?)\s*$/i;
23
31
  const fileRe = /^\s*[-*]?\s*File:\s*(.+?)\s*$/i;
24
32
  const lineRe = /^\s*[-*]?\s*Line:\s*(.+?)\s*$/i;
25
33
  const whyRe = /^\s*[-*]?\s*Why:\s*(.+?)\s*$/i;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@krotovm/gitlab-ai-review",
4
- "version": "1.0.24",
4
+ "version": "1.0.25",
5
5
  "description": "CLI tool to generate AI code reviews for GitLab merge requests.",
6
6
  "main": "dist/cli.js",
7
7
  "bin": {