mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-13 13:17:45 +02:00
Move metadata comment to the end (#10421)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -128,12 +128,7 @@ export async function copyMarkdown (markdown: string, metadata?: Record<string,
|
||||
if (metadata !== undefined) {
|
||||
try {
|
||||
const metadataComment = `<!-- huly-table-metadata:${JSON.stringify(metadata)} -->`
|
||||
// Insert comment before first table (or at start if no table)
|
||||
const tableIndex = markdown.indexOf('|')
|
||||
markdownToCopy =
|
||||
tableIndex !== -1
|
||||
? markdown.slice(0, tableIndex) + metadataComment + '\n' + markdown.slice(tableIndex)
|
||||
: metadataComment + '\n' + markdown
|
||||
markdownToCopy = markdown + '\n' + metadataComment
|
||||
} catch (e) {
|
||||
console.error('Failed to embed metadata in markdown:', e)
|
||||
// Continue with original markdown if embedding fails
|
||||
|
||||
Reference in New Issue
Block a user