cmints / website

Website for CMintS
https://cmints.io/
MIT License
1 stars 2 forks source link

Document adding markdown-it plugins #113

Closed Manvel closed 5 years ago

Manvel commented 5 years ago

ex.:

// Open external links in the new tab
const markdownLink = require("markdown-it-link-attributes");
const markdownOptions = {
  plugins: [
    [
      markdownLink, {
        pattern: /^https?:\/\//,
        attrs: {
          target: "_blank",
          rel: "noopener"
        }
      }
    ]
  ]
};

module.exports = {markdownOptions};

Can be either array of parameters with plugin as the first parameter or a plugin import.

Relevant links:

CMintS issue -> https://github.com/cmints/cmints/issues/186 Markdown-it documentation -> https://github.com/markdown-it/markdown-it#plugins-load

Manvel commented 5 years ago

See -> https://github.com/cmints/cmints/issues/190