rocwong / markdown-it-table-x

A table plugin for Markdown-it
0 stars 0 forks source link

plugin.apply is not a function #1

Open mstenz opened 1 year ago

mstenz commented 1 year ago

want to use in combination with 11ty,but it doesnt work:

 //markdown-it
  const markdownIt = require('markdown-it');
  const markdownItAttrs = require('markdown-it-attrs');
  const markdownItTableX = require('markdown-it-table-x');

  const markdownItOptions = {
    html: true,
    breaks: true,
    linkify: false
  };
  const markdownLib = markdownIt(markdownItOptions)
    .use(markdownItAttrs)
    .use(markdownItTableX);
  eleventyConfig.setLibrary('md', markdownLib);

[11ty] Eleventy CLI Fatal Error: (more in DEBUG output) [11ty] 1. Error in your Eleventy config file '/mnt/xxxxxx/.eleventy.js'. (via EleventyConfigError) [11ty] 2. plugin.apply is not a function (via TypeError) [11ty] [11ty] Original error stack trace: TypeError: plugin.apply is not a function

any Idea what is wrong?

rocwong commented 1 year ago

you can try this

const markdownItTableX = require('markdown-it-table-x').default;