@orca-pt/orca-components 1.0.5 → 1.0.6

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.
@@ -460,9 +460,21 @@ function useContentParser(description) {
460
460
  return parseContent(content || "");
461
461
  });
462
462
  }
463
+ function stripIncompleteMarkers(content) {
464
+ let result = content;
465
+ for (const marker of MARKERS) {
466
+ const startIdx = result.lastIndexOf(marker.start);
467
+ if (startIdx === -1) continue;
468
+ const afterStart = result.substring(startIdx + marker.start.length);
469
+ if (!afterStart.includes(marker.end)) {
470
+ result = result.substring(0, startIdx);
471
+ }
472
+ }
473
+ return result;
474
+ }
463
475
  function parseContent(content) {
464
476
  const parts = [];
465
- let remainingContent = content;
477
+ let remainingContent = stripIncompleteMarkers(content);
466
478
  let iteration = 0;
467
479
  const MAX_ITERATIONS = 100;
468
480
  while (remainingContent.length > 0 && iteration < MAX_ITERATIONS) {