testomatio-editor-blocks 0.4.48 → 0.4.49

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.
@@ -776,6 +776,7 @@ function parseTestStep(lines, index, allowEmpty = false, snippetId) {
776
776
  let expectedResult = "";
777
777
  let next = index + 1;
778
778
  let inExpectedResult = false;
779
+ let blankLineSeenOutsideCodeBlock = false;
779
780
  const stepIndent = current.length - current.trimStart().length;
780
781
  while (next < lines.length) {
781
782
  const line = lines[next];
@@ -789,6 +790,7 @@ function parseTestStep(lines, index, allowEmpty = false, snippetId) {
789
790
  }
790
791
  else {
791
792
  stepDataLines.push("");
793
+ blankLineSeenOutsideCodeBlock = true;
792
794
  }
793
795
  }
794
796
  next += 1;
@@ -894,6 +896,10 @@ function parseTestStep(lines, index, allowEmpty = false, snippetId) {
894
896
  next += 1;
895
897
  continue;
896
898
  }
899
+ // After a blank line outside a code block, stop adding to step data
900
+ if (blankLineSeenOutsideCodeBlock) {
901
+ break;
902
+ }
897
903
  if (STEP_DATA_LINE_REGEX.test(rawTrimmed)) {
898
904
  const content = unescapeMarkdown(rawTrimmed);
899
905
  stepDataLines.push(content);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testomatio-editor-blocks",
3
- "version": "0.4.48",
3
+ "version": "0.4.49",
4
4
  "description": "Custom BlockNote schema, markdown conversion helpers, and UI for Testomatio-style test cases and steps.",
5
5
  "type": "module",
6
6
  "main": "./package/index.js",
@@ -1046,6 +1046,26 @@ describe("markdownToBlocks", () => {
1046
1046
  );
1047
1047
  });
1048
1048
 
1049
+ it("does not include content after a blank line in step data", () => {
1050
+ const markdown = [
1051
+ "### Steps",
1052
+ "",
1053
+ "* step",
1054
+ " expected",
1055
+ "",
1056
+ " ![](http://localhost:3000/attachments/mlbix3nOJa.png =303x*)",
1057
+ ].join("\n");
1058
+
1059
+ const blocks = markdownToBlocks(markdown);
1060
+ const stepBlocks = blocks.filter((b) => b.type === "testStep");
1061
+ expect(stepBlocks).toHaveLength(1);
1062
+ expect(stepBlocks[0].props).toMatchObject({
1063
+ stepTitle: "step",
1064
+ stepData: "expected",
1065
+ expectedResult: "",
1066
+ });
1067
+ });
1068
+
1049
1069
  it("parses bullet lists written with asterisk markers", () => {
1050
1070
  const markdown = [
1051
1071
  "### Preconditions",
@@ -941,6 +941,7 @@ function parseTestStep(
941
941
  let expectedResult = "";
942
942
  let next = index + 1;
943
943
  let inExpectedResult = false;
944
+ let blankLineSeenOutsideCodeBlock = false;
944
945
  const stepIndent = current.length - current.trimStart().length;
945
946
 
946
947
  while (next < lines.length) {
@@ -955,6 +956,7 @@ function parseTestStep(
955
956
  expectedResult += "\n";
956
957
  } else {
957
958
  stepDataLines.push("");
959
+ blankLineSeenOutsideCodeBlock = true;
958
960
  }
959
961
  }
960
962
  next += 1;
@@ -1066,6 +1068,11 @@ function parseTestStep(
1066
1068
  continue;
1067
1069
  }
1068
1070
 
1071
+ // After a blank line outside a code block, stop adding to step data
1072
+ if (blankLineSeenOutsideCodeBlock) {
1073
+ break;
1074
+ }
1075
+
1069
1076
  if (STEP_DATA_LINE_REGEX.test(rawTrimmed)) {
1070
1077
  const content = unescapeMarkdown(rawTrimmed);
1071
1078
  stepDataLines.push(content);