From 7cc97c77d73d1d3c6bd2d99c0b86065bda58070b Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Tue, 19 Nov 2019 17:11:20 +1300 Subject: [PATCH] Remove pedantic markdown, allow underscores --- gatsby-config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gatsby-config.js b/gatsby-config.js index 932dbf6..af5369f 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -47,6 +47,7 @@ module.exports = { { resolve: 'gatsby-transformer-remark', options: { + pedantic: false, plugins: [ { resolve: `gatsby-remark-prismjs`, @@ -81,13 +82,18 @@ module.exports = { whitelist: ['algolia-autocomplete', 'pre', 'code'], ignore: ['prismjs/','docsearch.js/', 'src/theme/assets/search/algolia.css'], content: [ + // All the markdown in the git repos path.join(process.cwd(), '.cache/gatsby-source-git/**/*.md'), + // Components path.join(process.cwd(), 'src/components/!(*.d).{ts,js,jsx,tsx}'), + // Static pages (e.g. 404) path.join(process.cwd(), 'src/pages/!(*.d).{ts,js,jsx,tsx}'), + // Page templates path.join(process.cwd(), 'src/templates/!(*.d).{ts,js,jsx,tsx}'), ], extractors: [ { + // Simple extractor just matches against components and templates (e.g. JSX) extractor: class { static extract(content) { return content.match(/[A-Za-z0-9-_:\/]+/g) || []; @@ -96,6 +102,8 @@ module.exports = { extensions: ['js', 'ts', 'jsx', 'tsx'] }, { + // Match markdown files for icon classes (icon, iconBrand). Add each one to the + // allowed selectors defined in FontAwesome. Everything else in FA should be removed. extractor: class { static extract(content) { const selectors = [`file-alt`]