${p.author}
Collector
- Add bookmark ${opts.article ? "" : `
- #${p.position.toLocaleString("en-US")} `}
${p.body}
// SYNTHETIC XenForo 2 thread pages for the forum-thread tests. The forum, the // thread, the members and every word are invented; the markup follows the // shape XenForo 2 serves (article.message, .bbWrapper, the attribution header, // the page nav), and one variant is shaped the way a browser's "Save page as" // rewrites a page. export const ORIGIN = "https://forum.example"; export const THREAD_PATH = "/threads/the-teapot-collectors-thread.4242/"; export const THREAD_URL = `${ORIGIN}${THREAD_PATH}`; export type FakePost = { id: number; author: string; userId: number; // Epoch seconds. ts: number; position: number; body: string; editedTs?: number; attachments?: { href: string; name: string }[]; }; export function message(p: FakePost, opts: { savedAssets?: boolean; article?: boolean } = {}): string { const iso = new Date(p.ts * 1000).toISOString().replace(".000Z", "+0000"); const avatar = opts.savedAssets ? `./The Teapot Collectors Thread_files/${p.userId}.jpg` : `/data/avatars/m/0/${p.userId}.jpg?1700000000`; const attachments = p.attachments?.length ? `` : ""; const edited = p.editedTs ? `
` : ""; return ` `; } export function pageNav(page: number, last: number): string { if (last <= 1) return ""; const items: string[] = []; for (const n of [1, page - 1, page, page + 1, last]) { if (n < 1 || n > last || items.some((i) => i.includes(`>${n}<`))) continue; items.push( `I disagree, @Marigold.
`;