mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-19 15:17:42 +02:00
chore: remove legacy migration and compat code (no users yet)
- traces: remove migrateLegacyLocationData() and legacy timestamp field - context: remove legacy @[Title](ID) mention format support No live users exist, so backwards compatibility is unnecessary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
504a686e9b
commit
7efe542dd1
2 changed files with 4 additions and 119 deletions
|
|
@ -11,9 +11,6 @@ export const MENTION_REGEX = /\[\[(.*?)\]\]/g;
|
|||
// Standard Markdown-Link-Format: [Titel](ID)
|
||||
export const MARKDOWN_LINK_REGEX = /\[(.*?)\]\((.*?)\)/g;
|
||||
|
||||
// Legacy format for backward compatibility
|
||||
export const LEGACY_MENTION_REGEX = /@\[(.*?)\]\((.*?)\)/g;
|
||||
|
||||
/**
|
||||
* Extract all document mentions from markdown content
|
||||
*/
|
||||
|
|
@ -38,15 +35,6 @@ export const extractMentions = (content: string): Array<{ title: string; id?: st
|
|||
});
|
||||
}
|
||||
|
||||
// Legacy Format: @[Dokumenttitel](dokumentId)
|
||||
const legacyRegex = new RegExp(LEGACY_MENTION_REGEX);
|
||||
while ((match = legacyRegex.exec(content)) !== null) {
|
||||
mentions.push({
|
||||
title: match[1],
|
||||
id: match[2],
|
||||
});
|
||||
}
|
||||
|
||||
return mentions;
|
||||
};
|
||||
|
||||
|
|
@ -75,12 +63,6 @@ export const processMentionsInMarkdown = (content: string): string => {
|
|||
return match;
|
||||
});
|
||||
|
||||
// Verarbeite das Legacy-Format @[Dokumenttitel](dokumentId) für Abwärtskompatibilität
|
||||
processedContent = processedContent.replace(LEGACY_MENTION_REGEX, (match, title, id) => {
|
||||
// Verwende einen speziellen Markdown-Link mit einem data-Attribut
|
||||
return `<mention documentId="${id}" documentTitle="${title}">${title}</mention>`;
|
||||
});
|
||||
|
||||
return processedContent;
|
||||
};
|
||||
|
||||
|
|
@ -110,5 +92,5 @@ export const cleanMentionTags = (content: string): string => {
|
|||
* Check if text contains a potential mention
|
||||
*/
|
||||
export const containsPotentialMention = (text: string): boolean => {
|
||||
return text.includes('[[') || text.includes('@') || (text.includes('[') && text.includes(']('));
|
||||
return text.includes('[[') || (text.includes('[') && text.includes(']('));
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue