mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Comments: Further range of content reference ux improvements
- Added reference indicator to comment create form. - Added remove action. - Extracted reference text to translations. - Changed reference hash to be text-based instead of HTML based. - Added reference display for newly added comments. - Handled reference marker delete on comment delete.
This commit is contained in:
@ -251,9 +251,9 @@ export function findTargetNodeAndOffset(parentNode: HTMLElement, offset: number)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a hash for the given HTML element.
|
||||
* Create a hash for the given HTML element content.
|
||||
*/
|
||||
export function hashElement(element: HTMLElement): string {
|
||||
const normalisedElemHtml = element.outerHTML.replace(/\s{2,}/g, '');
|
||||
return cyrb53(normalisedElemHtml);
|
||||
const normalisedElemText = (element.textContent || '').replace(/\s{2,}/g, '');
|
||||
return cyrb53(normalisedElemText);
|
||||
}
|
Reference in New Issue
Block a user