Procházet zdrojové kódy

feat: try properties.metastring if no data.meta

oedotme před 3 roky
rodič
revize
61cbe074a3
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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') {