@vxrn/mdx 1.10.0 → 1.10.1-1772664153219

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vxrn/mdx",
3
- "version": "1.10.0",
3
+ "version": "1.10.1-1772664153219",
4
4
  "type": "commonjs",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -27,7 +27,10 @@ export const rehypeHighlightCode = (options = {}) => {
27
27
  return
28
28
  }
29
29
 
30
- const [_, lang] = node.properties.className[0].split('-')
30
+ const langClass = node.properties.className[0]
31
+ if (!langClass) return
32
+ const [_, lang] = langClass.split('-')
33
+ if (!lang || !refractor.registered(lang)) return
31
34
  const codeString = toString(node)
32
35
  let result = refractor.highlight(codeString, lang)
33
36