Move metadata comment to the end (#10421)

Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
Artyom Savchenko
2026-01-20 20:11:54 +07:00
committed by GitHub
parent 3f2a8cf24f
commit f52fa27e63
+1 -6
View File
@@ -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