feat: properly preserve table width (#2143)

This commit is contained in:
Philip Okugbe
2026-05-01 00:49:31 +01:00
committed by GitHub
parent 9943e104a5
commit 09c69d7a0f
4 changed files with 225 additions and 5 deletions
@@ -29,6 +29,8 @@ import { InjectQueue } from '@nestjs/bullmq';
import { Queue } from 'bullmq';
import { QueueJob, QueueName } from '../../queue/constants';
import { ModuleRef } from '@nestjs/core';
import { load } from 'cheerio';
import { normalizeImportHtml } from '../utils/import-formatter';
@Injectable()
export class ImportService {
@@ -136,7 +138,9 @@ export class ImportService {
async processHTML(htmlInput: string): Promise<any> {
try {
return htmlToJson(htmlInput);
const $ = load(htmlInput);
normalizeImportHtml($, $.root());
return htmlToJson($.html() || '');
} catch (err) {
throw err;
}