Remove pedantic markdown, allow underscores

This commit is contained in:
Aaron Carlino 2019-11-19 17:11:20 +13:00
parent 04eefa3e37
commit 7cc97c77d7
1 changed files with 8 additions and 0 deletions

View File

@ -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`]