diff --git a/src/webapp/app/api/reader/route.ts b/src/webapp/app/api/reader/route.ts index 5715010d..fbc5df1f 100644 --- a/src/webapp/app/api/reader/route.ts +++ b/src/webapp/app/api/reader/route.ts @@ -16,7 +16,10 @@ export async function GET(request: NextRequest) { const url = searchParams.get('url'); if (!url) { - return NextResponse.json({ error: 'Missing url parameter' }, { status: 400 }); + return NextResponse.json( + { error: 'Missing url parameter' }, + { status: 400 }, + ); } let targetUrl: URL; @@ -33,7 +36,8 @@ export async function GET(request: NextRequest) { // Mimic a real browser to avoid blocks 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36', - Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', + Accept: + 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-US,en;q=0.5', }, // 10 second timeout @@ -42,7 +46,9 @@ export async function GET(request: NextRequest) { if (!response.ok) { return NextResponse.json( - { error: `Failed to fetch URL: ${response.status} ${response.statusText}` }, + { + error: `Failed to fetch URL: ${response.status} ${response.statusText}`, + }, { status: 502 }, ); } @@ -50,7 +56,10 @@ export async function GET(request: NextRequest) { html = await response.text(); } catch (err) { const message = err instanceof Error ? err.message : 'Unknown error'; - return NextResponse.json({ error: `Failed to fetch URL: ${message}` }, { status: 502 }); + return NextResponse.json( + { error: `Failed to fetch URL: ${message}` }, + { status: 502 }, + ); } // Parse with jsdom, passing the URL so Readability can resolve relative links diff --git a/src/webapp/features/reader/components/ReaderButton/ReaderButton.module.css b/src/webapp/features/reader/components/ReaderButton/ReaderButton.module.css index 7e37d4e0..153e03ff 100644 --- a/src/webapp/features/reader/components/ReaderButton/ReaderButton.module.css +++ b/src/webapp/features/reader/components/ReaderButton/ReaderButton.module.css @@ -26,10 +26,18 @@ margin: 1.75em 0 0.5em; } -.readerContent :global(h1) { font-size: 1.6em; } -.readerContent :global(h2) { font-size: 1.35em; } -.readerContent :global(h3) { font-size: 1.15em; } -.readerContent :global(h4) { font-size: 1.0em; } +.readerContent :global(h1) { + font-size: 1.6em; +} +.readerContent :global(h2) { + font-size: 1.35em; +} +.readerContent :global(h3) { + font-size: 1.15em; +} +.readerContent :global(h4) { + font-size: 1em; +} .readerContent :global(a) { color: var(--mantine-color-blue-6); diff --git a/src/webapp/features/reader/components/ReaderButton/ReaderButton.tsx b/src/webapp/features/reader/components/ReaderButton/ReaderButton.tsx index 501e38e2..38a69839 100644 --- a/src/webapp/features/reader/components/ReaderButton/ReaderButton.tsx +++ b/src/webapp/features/reader/components/ReaderButton/ReaderButton.tsx @@ -20,7 +20,10 @@ import { } from '@mantine/core'; import { TbBook2, TbExternalLink, TbLink, TbLinkOff } from 'react-icons/tb'; import { MdErrorOutline } from 'react-icons/md'; -import { fetchReaderContent, type ReaderState } from '../../lib/fetchReaderContent'; +import { + fetchReaderContent, + type ReaderState, +} from '../../lib/fetchReaderContent'; import styles from './ReaderButton.module.css'; interface Props {