浏览代码

feat: try properties.metastring if no data.meta

oedotme 3 年之前
父节点
当前提交
61cbe074a3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/generator.js

+ 1 - 1
src/generator.js

@@ -176,7 +176,7 @@ const rehypePrismGenerator = (refractor) => {
         return
       }
 
-      let meta = node.data && node.data.meta ? /** @type {string} */ (node.data.meta) : ''
+      let meta = /** @type {string} */ (node?.data?.meta || node?.properties?.metastring || '')
       // Coerce className to array
       if (node.properties.className) {
         if (typeof node.properties.className === 'boolean') {