mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(quotes): scope post-number lookup by subplebbit, OP quote always navigates to thread
- numberToCid scoped by subplebbit address to fix wrong preview in /all/ - OP quote click navigates to thread page instead of highlighting card
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { QUOTE_NUMBER_REGEX } from './url-utils';
|
||||
|
||||
export const getQuotedCidsFromContent = (content: string | undefined, numberToCid: Record<number, string>) => {
|
||||
if (!content) return undefined;
|
||||
export const getQuotedCidsFromContent = (content: string | undefined, numberToCid: Record<number, string> | undefined) => {
|
||||
if (!content || !numberToCid) return undefined;
|
||||
const cids = new Set<string>();
|
||||
for (const match of content.matchAll(new RegExp(QUOTE_NUMBER_REGEX.source, 'g'))) {
|
||||
const num = parseInt(match[1], 10);
|
||||
|
||||
Reference in New Issue
Block a user