mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-16 05:13:06 +00:00
Fixes multiple mentions issue (#929)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
db52006a9d
commit
9f9650f938
@ -38,9 +38,13 @@ function extractBacklinks (backlinkId: Ref<Doc>, backlinkClass: Ref<Class<Doc>>,
|
|||||||
nds.forEach((kid) => {
|
nds.forEach((kid) => {
|
||||||
if (kid.nodeType === Node.ELEMENT_NODE && (kid as HTMLElement).localName === 'span') {
|
if (kid.nodeType === Node.ELEMENT_NODE && (kid as HTMLElement).localName === 'span') {
|
||||||
const el = kid as HTMLElement
|
const el = kid as HTMLElement
|
||||||
|
const ato = el.getAttribute('data-id') as Ref<Doc>
|
||||||
|
const atoClass = el.getAttribute('data-objectclass') as Ref<Class<Doc>>
|
||||||
|
const e = result.find(e => e.attachedTo === ato && e.attachedToClass === atoClass)
|
||||||
|
if (e === undefined) {
|
||||||
result.push({
|
result.push({
|
||||||
attachedTo: el.getAttribute('data-id') as Ref<Doc>,
|
attachedTo: ato,
|
||||||
attachedToClass: el.getAttribute('data-objectclass') as Ref<Class<Doc>>,
|
attachedToClass: atoClass,
|
||||||
collection: 'backlinks',
|
collection: 'backlinks',
|
||||||
backlinkId,
|
backlinkId,
|
||||||
backlinkClass,
|
backlinkClass,
|
||||||
@ -48,6 +52,7 @@ function extractBacklinks (backlinkId: Ref<Doc>, backlinkClass: Ref<Class<Doc>>,
|
|||||||
attachedDocId
|
attachedDocId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
nodes.push(kid.childNodes)
|
nodes.push(kid.childNodes)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user