import archive from '../data/articles.json' with { type: 'json' };
const archiveBySlug = new Map(archive.map((article) => [article.slug, article]));
function p(text) {
return '
' + text + '
';
}
function h2(text) {
return '' + text + '
';
}
function escapeHtml(value) {
return value
.replaceAll('&', '&')
.replaceAll('<', '<')
.replaceAll('>', '>');
}
function codeBlock(lines) {
return '' + escapeHtml(lines.join('\n')) + '
';
}
function table(headers, rows) {
const head = '' + headers.map((item) => '| ' + item + ' | ').join('') + '
';
const body = '' + rows.map((row) => '' + row.map((item) => '| ' + item + ' | ').join('') + '
').join('') + '';
return '' + headers[0] + ': рабочая матрица проверки' + head + body + '
';
}
function orderedList(items) {
return '' + items.map((item) => '- ' + item + '
').join('') + '
';
}
function figure(src, alt, caption) {
return '
' + caption + '';
}
function sources(items) {
return '';
}
function plainText(content) {
return content
.replace(/<[^>]+>/g, ' ')
.replace(/&(?:quot|amp|lt|gt|#039);/g, ' ')
.replace(/\s+/g, ' ')
.trim();
}
function legacyBody(article, limit = 6600, omitPatterns = []) {
const withoutSources = (article.contentHtml || '')
.replace(/