Преглед на файлове

Merge pull request #56 from oedotme/main

feat: meta string support with astro
Timothy преди 3 години
родител
ревизия
9bf1e72fd5
променени са 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') {