@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 +9 -1
- package/dist/bin/wod.cjs.map +1 -1
- package/dist/bin/wod.mjs +1 -1
- package/dist/{chunk-4HQWTNS5.mjs → chunk-STJZNVE6.mjs} +3 -3
- package/dist/{chunk-4HQWTNS5.mjs.map → chunk-STJZNVE6.mjs.map} +1 -1
- package/dist/{compiler-CAOKDLIY.mjs → compiler-QMJ4EHWL.mjs} +12 -4
- package/dist/compiler-QMJ4EHWL.mjs.map +1 -0
- package/dist/index.cjs +15 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/compiler-CAOKDLIY.mjs.map +0 -1
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(`${
|
|
533
|
+
problems.push(`${where}:${line} \`${snippet}\``);
|
|
526
534
|
}
|
|
527
535
|
});
|
|
528
536
|
}
|