fix(quotes): resolve external quote links across boards (#1064)

This commit is contained in:
Tommaso Casaburi
2026-03-12 17:41:11 +08:00
committed by GitHub
parent ef375e3578
commit fe55e6f332
58 changed files with 1719 additions and 92 deletions
+13
View File
@@ -180,6 +180,12 @@ export const isValidCrossboardPattern = (pattern: string): boolean => {
return true; // CID is exactly 46 alphanumeric chars
}
// Check if it's a directory + post number pattern: >>>/biz/123
const directoryPostNumberMatch = pathPart.match(/^([a-zA-Z0-9]{1,10})\/(\d+)$/);
if (directoryPostNumberMatch) {
return true;
}
// Check if it's a full address + thread pattern: >>>/board.eth/fullCid
const addressThreadMatch = pathPart.match(/^([^/]+)\/([a-zA-Z0-9]{46})$/);
if (addressThreadMatch) {
@@ -188,6 +194,13 @@ export const isValidCrossboardPattern = (pattern: string): boolean => {
return isValidDomain(address) || isValidIPNSKey(address);
}
// Check if it's a full address + post number pattern: >>>/board.eth/123
const addressPostNumberMatch = pathPart.match(/^([^/]+)\/(\d+)$/);
if (addressPostNumberMatch) {
const [, address] = addressPostNumberMatch;
return isValidDomain(address) || isValidIPNSKey(address);
}
// Check if it's just a full address pattern: >>>/board.eth
return isValidDomain(pathPart) || isValidIPNSKey(pathPart);
};