Skip to content

Commit ce68028

Browse files
chore: remove unused ImageSizing related code
1 parent 7838eaf commit ce68028

File tree

5 files changed

+0
-88
lines changed

5 files changed

+0
-88
lines changed

plugins/utils/handlers.js

-12
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,6 @@ module.exports = {
231231
[u('text', '\u00A0')]
232232
);
233233
},
234-
ImageSizing: (h, node) => {
235-
const style = stripNulls({
236-
height: findAttribute('height', node),
237-
width: findAttribute('width', node),
238-
verticalAlign: findAttribute('verticalAlign', node),
239-
});
240-
241-
const [image] = node.children;
242-
set(image, 'data.style', compileStyleObject(style));
243-
244-
return one(h, image, node.parent);
245-
},
246234
TechTile: (h, node) => {
247235
const attributes = JSON.stringify(getAllAttributes(node));
248236
return h(

rehype-plugins/image-sizing/index.js

-38
This file was deleted.

scripts/actions/__tests__/deserialize-html.test.js

-25
Original file line numberDiff line numberDiff line change
@@ -176,31 +176,6 @@ test('deserializes TechTileGrid components', async () => {
176176
expect(mdx).toEqual(input.trim());
177177
});
178178

179-
test('deserializes block ImageSizing component', async () => {
180-
const input = `
181-
<ImageSizing
182-
width="32px"
183-
height="32px"
184-
>
185-
![test.png](./images/test.png)
186-
</ImageSizing>
187-
`;
188-
189-
const mdx = await deserializeHTML(await serializeMDX(input));
190-
191-
expect(mdx).toEqual(input.trim());
192-
});
193-
194-
test('deserializes inline ImageSizing component', async () => {
195-
const input = `
196-
This is a test with an <ImageSizing width="32px" height="32px">![test.png](./images/test.png)</ImageSizing> inline image.
197-
`;
198-
199-
const mdx = await deserializeHTML(await serializeMDX(input));
200-
201-
expect(mdx).toEqual(input.trim());
202-
});
203-
204179
test('kitchen sink', async () => {
205180
const input = fs.readFileSync(`${__dirname}/kitchen-sink.mdx`, 'utf-8');
206181

scripts/actions/__tests__/kitchen-sink.mdx

-9
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ To instrument errors in transactions:
3636
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.
3737
3. [End the transaction](/docs/instrument-transactions-c-agent#end-transaction).
3838

39-
<ImageSizing
40-
width="32px"
41-
height="32px"
42-
>
43-
![debian.png](./images/debian.png)
44-
</ImageSizing>
45-
46-
This is a test with an inline image <ImageSizing width="32px">![image.png](./images/image.png)</ImageSizing>
47-
4839
<table>
4940
<thead>
5041
<tr>

scripts/actions/utils/handlers.js

-4
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ module.exports = {
202202
);
203203
},
204204
},
205-
ImageSizing: {
206-
serialize: serializeComponent,
207-
deserialize: deserializeComponent,
208-
},
209205
InstallFeedback: {
210206
serialize: serializeComponent,
211207
deserialize: deserializeComponent,

0 commit comments

Comments
 (0)