Skip to content

Commit

Permalink
check dom parser to ensure it is on client component.
Browse files Browse the repository at this point in the history
  • Loading branch information
BobanL committed May 15, 2024
1 parent 1810436 commit b8b30f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions containers/ecr-viewer/src/app/services/formatService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ export const formatString = (input: string): string => {
* @example @returns [{resultId: 'Result.123', resultName: 'foo', tables: [{}, {},...]}, ...]
*/
export function formatTablesToJSON(htmlString: string): TableJson[] {
if (typeof DOMParser === "undefined") {
return [];
}
const parser = new DOMParser();
const doc = parser.parseFromString(htmlString, "text/html");
const jsonArray: any[] = [];
Expand Down

0 comments on commit b8b30f9

Please sign in to comment.