From ce3b304ec850853c9f4ae25975da6b9ccfd5f4e3 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Tue, 12 Oct 2021 09:48:27 +0100 Subject: [PATCH] Remove chktex fetching and parsing from migrated PDF preview (#5409) GitOrigin-RevId: 3c6721a1272d809679ec1e2f2fcd1a7251e1321b --- .../pdf-preview/util/chktex-log-parser.js | 28 ------------------- .../features/pdf-preview/util/output-files.js | 13 --------- 2 files changed, 41 deletions(-) delete mode 100644 services/web/frontend/js/features/pdf-preview/util/chktex-log-parser.js diff --git a/services/web/frontend/js/features/pdf-preview/util/chktex-log-parser.js b/services/web/frontend/js/features/pdf-preview/util/chktex-log-parser.js deleted file mode 100644 index 969776b755..0000000000 --- a/services/web/frontend/js/features/pdf-preview/util/chktex-log-parser.js +++ /dev/null @@ -1,28 +0,0 @@ -export const ChkTeXParser = { - parse(log) { - const errors = [] - const warnings = [] - - for (const line of log.split('\n')) { - const m = line.match(/^(\S+):(\d+):(\d+): (Error|Warning): (.*)/) - - if (m) { - const result = { - file: m[1], - line: m[2], - column: m[3], - level: m[4].toLowerCase(), - message: `${m[4]}: ${m[5]}`, - } - - if (result.level === 'error') { - errors.push(result) - } else { - warnings.push(result) - } - } - } - - return { errors, warnings } - }, -} diff --git a/services/web/frontend/js/features/pdf-preview/util/output-files.js b/services/web/frontend/js/features/pdf-preview/util/output-files.js index 4ecc4d1c5e..136fbdb47c 100644 --- a/services/web/frontend/js/features/pdf-preview/util/output-files.js +++ b/services/web/frontend/js/features/pdf-preview/util/output-files.js @@ -1,7 +1,6 @@ import getMeta from '../../../utils/meta' import HumanReadableLogs from '../../../ide/human-readable-logs/HumanReadableLogs' import BibLogParser from '../../../ide/log-parser/bib-log-parser' -import { ChkTeXParser } from './chktex-log-parser' import { buildFileList } from './file-list' const searchParams = new URLSearchParams(window.location.search) @@ -106,18 +105,6 @@ export const handleOutputFiles = async (projectId, data) => { accumulateResults({ errors, warnings }, 'BibTeX:') } - const chktexFile = outputFiles.get('output.chktex') - - if (chktexFile) { - const response = await fetch(`${chktexFile.url}?${params}`) - - const log = await response.text() - - const { errors, warnings } = ChkTeXParser.parse(log) - - accumulateResults({ errors, warnings }, 'Syntax') - } - result.fileList = buildFileList(outputFiles, data.clsiServerId) return result