|
@@ -3,6 +3,8 @@ import HumanReadableLogs from '../../../ide/human-readable-logs/HumanReadableLog
|
|
|
import BibLogParser from '../../../ide/log-parser/bib-log-parser'
|
|
import BibLogParser from '../../../ide/log-parser/bib-log-parser'
|
|
|
import { v4 as uuid } from 'uuid'
|
|
import { v4 as uuid } from 'uuid'
|
|
|
|
|
|
|
|
|
|
+// Warnings that may disappear after a second LaTeX pass
|
|
|
|
|
+const TRANSIENT_WARNING_REGEX = /^(Reference|Citation).+undefined on input line/
|
|
|
const searchParams = new URLSearchParams(window.location.search)
|
|
const searchParams = new URLSearchParams(window.location.search)
|
|
|
|
|
|
|
|
export function handleOutputFiles(outputFiles, projectId, data) {
|
|
export function handleOutputFiles(outputFiles, projectId, data) {
|
|
@@ -79,7 +81,7 @@ export const handleLogFiles = async (outputFiles, data, signal) => {
|
|
|
|
|
|
|
|
result.log = await response.text()
|
|
result.log = await response.text()
|
|
|
|
|
|
|
|
- const { errors, warnings, typesetting } = HumanReadableLogs.parse(
|
|
|
|
|
|
|
+ let { errors, warnings, typesetting } = HumanReadableLogs.parse(
|
|
|
result.log,
|
|
result.log,
|
|
|
{
|
|
{
|
|
|
ignoreDuplicates: true,
|
|
ignoreDuplicates: true,
|
|
@@ -88,6 +90,11 @@ export const handleLogFiles = async (outputFiles, data, signal) => {
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+ if (data.status === 'stopped-on-first-error') {
|
|
|
|
|
+ // Hide warnings that could disappear after a second pass
|
|
|
|
|
+ warnings = warnings.filter(warning => !isTransientWarning(warning))
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
accumulateResults({ errors, warnings, typesetting })
|
|
accumulateResults({ errors, warnings, typesetting })
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.warn(e) // ignore failure to fetch/parse the log file, but log a warning
|
|
console.warn(e) // ignore failure to fetch/parse the log file, but log a warning
|
|
@@ -179,3 +186,7 @@ function normalizeFilePath(path, rootDocDirname) {
|
|
|
|
|
|
|
|
return path
|
|
return path
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+function isTransientWarning(warning) {
|
|
|
|
|
+ return TRANSIENT_WARNING_REGEX.test(warning.message)
|
|
|
|
|
+}
|