Skip to content

Commit

Permalink
chore: remove unused ImageSizing related code
Browse files Browse the repository at this point in the history
  • Loading branch information
roadlittledawn committed Oct 9, 2023
1 parent 7838eaf commit ce68028
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 88 deletions.
12 changes: 0 additions & 12 deletions plugins/utils/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,6 @@ module.exports = {
[u('text', '\u00A0')]
);
},
ImageSizing: (h, node) => {
const style = stripNulls({
height: findAttribute('height', node),
width: findAttribute('width', node),
verticalAlign: findAttribute('verticalAlign', node),
});

const [image] = node.children;
set(image, 'data.style', compileStyleObject(style));

return one(h, image, node.parent);
},
TechTile: (h, node) => {
const attributes = JSON.stringify(getAllAttributes(node));
return h(
Expand Down
38 changes: 0 additions & 38 deletions rehype-plugins/image-sizing/index.js

This file was deleted.

25 changes: 0 additions & 25 deletions scripts/actions/__tests__/deserialize-html.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,31 +176,6 @@ test('deserializes TechTileGrid components', async () => {
expect(mdx).toEqual(input.trim());
});

test('deserializes block ImageSizing component', async () => {
const input = `
<ImageSizing
width="32px"
height="32px"
>
![test.png](./images/test.png)
</ImageSizing>
`;

const mdx = await deserializeHTML(await serializeMDX(input));

expect(mdx).toEqual(input.trim());
});

test('deserializes inline ImageSizing component', async () => {
const input = `
This is a test with an <ImageSizing width="32px" height="32px">![test.png](./images/test.png)</ImageSizing> inline image.
`;

const mdx = await deserializeHTML(await serializeMDX(input));

expect(mdx).toEqual(input.trim());
});

test('kitchen sink', async () => {
const input = fs.readFileSync(`${__dirname}/kitchen-sink.mdx`, 'utf-8');

Expand Down
9 changes: 0 additions & 9 deletions scripts/actions/__tests__/kitchen-sink.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ To instrument errors in transactions:
2. Record an with [`newrelic_notice_error()`](https://source.datanerd.us/c-agent/c-agent/blob/master/examples/ex_notice_error.c), supplying the required parameters.
3. [End the transaction](/docs/instrument-transactions-c-agent#end-transaction).

<ImageSizing
width="32px"
height="32px"
>
![debian.png](./images/debian.png)
</ImageSizing>

This is a test with an inline image <ImageSizing width="32px">![image.png](./images/image.png)</ImageSizing>

<table>
<thead>
<tr>
Expand Down
4 changes: 0 additions & 4 deletions scripts/actions/utils/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ module.exports = {
);
},
},
ImageSizing: {
serialize: serializeComponent,
deserialize: deserializeComponent,
},
InstallFeedback: {
serialize: serializeComponent,
deserialize: deserializeComponent,
Expand Down

0 comments on commit ce68028

Please sign in to comment.