fix(blog): restore live-site tables in migrated articles

- restore semantic table markup across English, Spanish, and Arabic posts
- match live-site table styling and caption formatting
- preserve tables and normalize contained links and assets during extraction
This commit is contained in:
2026-06-08 19:25:00 -07:00
parent e44b95db2e
commit 4b23bff789
25 changed files with 1273 additions and 563 deletions
+8 -1
View File
@@ -97,8 +97,15 @@ function extractRecord(file, html) {
const src = localizeAsset($(element).attr('src'));
if (src) $(element).attr('src', src);
});
const tables = [];
body.find('table').each((_, element) => {
const token = `__TABLE_${tables.length}__`;
tables.push($(element).prop('outerHTML'));
$(element).replaceWith(`\n\n${token}\n\n`);
});
const markdown = contentMarkdown(
turndown.turndown(body.html() || '').replace(/\n{3,}/g, '\n\n').trim(),
tables.reduce((output, table, index) => output.replaceAll(`__TABLE_${index}__`, table),
turndown.turndown(body.html() || '').replace(/\n{3,}/g, '\n\n').trim()),
isBlogFile(file)
);
return { file, lang, url, title, description, h1, image, alt, date, markdown };