@bitcobblers/wod-wiki-engine 0.35.2120 → 0.35.2123

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.
package/dist/bin/wod.cjs CHANGED
@@ -515,6 +515,14 @@ function validateWodBlockSyntax(blocks) {
515
515
  const section = wodWikiCore.parseDocumentSections(block.rawContent, { registeredWidgets: SEED_REGISTERED_WIDGETS }).find((s) => s.scriptBlock);
516
516
  const source = section?.scriptBlock?.content ?? block.rawContent;
517
517
  if (!source.trim()) continue;
518
+ const where = block.sourcePath ?? block.noteId;
519
+ if (section?.sport) {
520
+ const parsed = wodWikiLang.parseScript(source, { sport: section.sport });
521
+ for (const error of parsed.errors ?? []) {
522
+ problems.push(`${where}: ${error.message}`);
523
+ }
524
+ continue;
525
+ }
518
526
  const doc = source.endsWith("\n") ? source : source + "\n";
519
527
  const tree = wodWikiLang.whiteboardParser.parse(doc);
520
528
  tree.iterate({
@@ -522,7 +530,7 @@ function validateWodBlockSyntax(blocks) {
522
530
  if (!node.type.isError) return;
523
531
  const line = doc.slice(0, node.from).split("\n").length;
524
532
  const snippet = source.slice(node.from, Math.min(node.to, node.from + 60)).split("\n")[0];
525
- problems.push(`${block.sourcePath ?? block.noteId}:${line} \`${snippet}\``);
533
+ problems.push(`${where}:${line} \`${snippet}\``);
526
534
  }
527
535
  });
528
536
  }