Skip to content

Commit e9ca168

Browse files
committed
Fixed lint issues
1 parent e4175d0 commit e9ca168

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

blocks/spline-viewer/spline-viewer.js

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
import { getFragmentFromFile } from '../../scripts/scripts.js';
2+
13
export default async function decorate(block) {
2-
try {
3-
// get the content
4-
const fragment = await getFragmentFromFile('/fragments/spline.html');
5-
block.innerHTML = '';
6-
const fragmentHtml = parser.parseFromString(fragment, 'text/html');
7-
[...fragmentHtml.body.children].forEach((item) => {
8-
block.append(item);
9-
});
10-
} catch (e) {
11-
block.textContent = '';
12-
// eslint-disable-next-line no-console
13-
console.warn(`cannot load snippet at ${e}`);
14-
}
15-
}
4+
try {
5+
// get the content
6+
const fragment = await getFragmentFromFile('/fragments/spline.html');
7+
block.innerHTML = '';
8+
const parser = new DOMParser();
9+
const fragmentHtml = parser.parseFromString(fragment, 'text/html');
10+
[...fragmentHtml.body.children].forEach((item) => {
11+
block.append(item);
12+
});
13+
} catch (e) {
14+
block.textContent = '';
15+
// eslint-disable-next-line no-console
16+
console.warn(`cannot load snippet at ${e}`);
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* global WebImporter */
22
const splineViewer = (main, document) => {
3-
const splineViewerEl = main.querySelector('div#spline-viewer');
4-
if (splineViewerEl) {
5-
const block = [['Spline Viewer'], ['']];
6-
const table = WebImporter.DOMUtils.createTable(block, document);
7-
splineViewerEl.replaceWith(table);
8-
}
9-
};
10-
export default splineViewer;
3+
const splineViewerEl = main.querySelector('div#spline-viewer');
4+
if (splineViewerEl) {
5+
const block = [['Spline Viewer'], ['']];
6+
const table = WebImporter.DOMUtils.createTable(block, document);
7+
splineViewerEl.replaceWith(table);
8+
}
9+
};
10+
export default splineViewer;

0 commit comments

Comments
 (0)