mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 18:26:05 +08:00
feat: enhance markdown preview for backlinks (#8956)
fix AF-1770 fix AF-1771 --- fix: doc link middlewares feat: markdown renderer feat: allow multiple backlink for a single doc feat: showing correct doc ref link feat: trim long para & ident lists feat: list indentition fix feat: database/latext handling feat: other block types handling fix: lint
This commit is contained in:
@@ -48,11 +48,23 @@ export const InfoTable = ({
|
||||
[docId, docsSearchService]
|
||||
)
|
||||
);
|
||||
|
||||
const backlinks = useLiveData(
|
||||
useMemo(
|
||||
() => LiveData.from(docsSearchService.watchRefsTo(docId), null),
|
||||
[docId, docsSearchService]
|
||||
)
|
||||
useMemo(() => {
|
||||
return LiveData.from(docsSearchService.watchRefsTo(docId), []).map(
|
||||
links => {
|
||||
const visitedDoc = new Set<string>();
|
||||
// for each doc, we only show the first block
|
||||
return links.filter(link => {
|
||||
if (visitedDoc.has(link.docId)) {
|
||||
return false;
|
||||
}
|
||||
visitedDoc.add(link.docId);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
);
|
||||
}, [docId, docsSearchService])
|
||||
);
|
||||
|
||||
const onBacklinkPropertyChange = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user