Skip to content

Commit

Permalink
Update App.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanomhub authored Mar 24, 2024
1 parent 9cabc03 commit d018bed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scr/Windows-Linux-Mac/scr/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import './App.css';
import fs from 'fs';
import path from 'path';
import { parseDocument } from 'linkedom';
import { parseHTML } from 'linkedom';
interface Data {
title: string;
imageUrl: string; // Renamed for clarity
Expand Down Expand Up @@ -37,9 +37,9 @@ const App: React.FC = () => {
}, []);

const extractLinks = (content: string): string[] => {
const { document } = parseDocument(content);
const { document } = parseHTML(content);
return Array.from(document.querySelectorAll('.link'))
.map((linkElement: Element) => linkElement.getAttribute('href') || '');
.map((linkElement: Element) => linkElement.getAttributeNS(null, 'href') || '');
};

const handlePageChange = (newPage: number) => {
Expand Down

0 comments on commit d018bed

Please sign in to comment.