@markup-carve/pandoc-carve 0.1.7 → 0.1.9

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/cli.js CHANGED
@@ -234,8 +234,21 @@ async function importToCarve(args) {
234
234
  }
235
235
  json = result.stdout;
236
236
  }
237
- const { pandocToCarve } = await import('./index.js');
238
- const { carve, warnings, diagnostics } = pandocToCarve(json);
237
+ const { pandocToCarve, PandocImportLimitError } = await import('./index.js');
238
+ let converted;
239
+ try {
240
+ converted = pandocToCarve(json);
241
+ }
242
+ catch (error) {
243
+ if (!(error instanceof PandocImportLimitError))
244
+ throw error;
245
+ if (args.diagnosticsFile !== undefined) {
246
+ report(args, [error.message], [error.diagnostic], 'pandoc-json');
247
+ process.exit(1);
248
+ }
249
+ throw error;
250
+ }
251
+ const { carve, warnings, diagnostics } = converted;
239
252
  const reportDiagnostics = args.from === 'json' ? diagnostics : [
240
253
  ...diagnostics,
241
254
  {
@@ -315,7 +328,7 @@ function diagnosticsForIncludes(warnings, suppressed, root) {
315
328
  const NORMALIZED_INCLUDE_RULES = new Set([
316
329
  'include-footnote-rename',
317
330
  'include-heading-clamp',
318
- 'include-heading-id-rename',
331
+ 'include-id-rename',
319
332
  ]);
320
333
  function displayIncludeFile(file, root, fallback) {
321
334
  if (!file || !root)