Selaa lähdekoodia

feat: try properties.metastring if no data.meta

oedotme 3 vuotta sitten
vanhempi
säilyke
61cbe074a3
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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') {