forked from newrelic/docs-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add an image sizing codemod to remove block level image sizing…
… elements
- Loading branch information
1 parent
15b4808
commit a278d05
Showing
2 changed files
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const visit = require('unist-util-visit'); | ||
const { isMdxBlockElement } = require('./utils/mdxast'); | ||
|
||
const imageSizing = () => (tree) => { | ||
visit(tree, isMdxBlockElement('ImageSizing'), (node, idx, parent) => { | ||
parent.children[idx] = node.children[0]; | ||
}); | ||
}; | ||
|
||
module.exports = imageSizing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,5 @@ module.exports = [ | |
watermarks, | ||
landingPageHero, | ||
techTiles, | ||
require('./imageSizing'), | ||
]; |