@scalar/code-highlight 0.3.6 → 0.4.1

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.
@@ -2959,10 +2959,16 @@ function rehypeHighlight(options) {
2959
2959
  ruleId: "missing-language",
2960
2960
  source: "rehype-highlight"
2961
2961
  });
2962
- /* c8 ignore next 5 -- throw arbitrary hljs errors */
2963
2962
  return;
2964
2963
  }
2965
- throw cause;
2964
+ file.message("Could not highlight code block", {
2965
+ ancestors: [parent, node],
2966
+ cause,
2967
+ place: node.position,
2968
+ ruleId: "highlight-error",
2969
+ source: "rehype-highlight"
2970
+ });
2971
+ return;
2966
2972
  }
2967
2973
  if (!lang && result.data?.language) node.properties.className.push("language-" + result.data.language);
2968
2974
  if (result.children.length > 0) node.children = result.children;