Skip to content

Commit

Permalink
Merge pull request #153 from iterative/null-link-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
yathomasi authored Dec 19, 2022
2 parents edee2d6 + bf7326d commit eaa5ece
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/gatsby-theme-iterative/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ module.exports = ({
},
'gatsby-remark-responsive-iframe',
require.resolve('./plugins/resize-image-plugin'),
require.resolve('./plugins/external-link-plugin')
require.resolve('./plugins/external-link-plugin'),
require.resolve('./plugins/null-link-plugin')
]
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = async ({ markdownAST }) => {
const { visit } = await import('unist-util-visit')
visit(markdownAST, 'link', node => {
if (!node.url && node?.children?.[0]?.type === 'inlineCode') {
node.type = 'inlineCode'
node.value = node.children[0].value
}
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "null-link-plugin",
"version": "1.0.0",
"main": "index.js",
"author": "yathomasi",
"license": "Apache-2.0"
}

0 comments on commit eaa5ece

Please sign in to comment.