message: Trim logs to avoid duplicate problem messages
diff: @@ -44,8 +44,12 @@ export class CompilerLogParser {
  log = log.replace(/(\r\n)|\r/g, '\n')
  if (log.match(bibtexPattern)) {
  + if (log.match(latexmkPattern)) {
  + this.bibLogParser.parse(this.trimLaTeXmkBibTeX(log), rootFile)
  + } else {
  this.bibLogParser.parse(log, rootFile)
  }
  + }
  if (log.match(latexmkPattern)) {
  log = this.trimLaTeXmk(log)
  } else if (log.match(texifyPattern)) {
  @@ -59,38 +63,34 @@ export class CompilerLogParser {
  }
  private trimLaTeXmk(log: string): string {
  - const lines = log.split('\n')
  - let startLine = -1
  - let finalLine = -1
  - for (let index = 0; index < lines.length; index++) {
  - const line = lines[index]
  - let result = line.match(latexmkLogLatex)
  - if (result) {
  - startLine = index
  - }
  - result = line.match(latexmkLog)
  - if (result) {
  - finalLine = index
  - }
  - }
  - if (finalLine <= startLine) {
  - return lines.slice(startLine).join('\n')
  - } else {
  - return lines.slice(startLine, finalLine).join('\n')
  + return this.trimPattern(log, latexmkLogLatex, latexmkLog)
  }
  +
  + private trimLaTeXmkBibTeX(log: string): string {
  + return this.trimPattern(log, bibtexPattern, latexmkLogLatex)
  }
  private trimTexify(log: string): string {
  + return this.trimPattern(log, texifyLogLatex, texifyLog)
  + }
  +
  +
  + /**
  + * Return the lines between the last occurrences of `beginPattern` and `endPattern`.
  + * If `endPattern` is not found, the lines from the last occurrence of
  + * `beginPattern` up to the end is returned.
  + */
  + private trimPattern(log: string, beginPattern: RegExp, endPattern: RegExp): string {
  const lines = log.split('\n')
  let startLine = -1
  let finalLine = -1
  for (let index = 0; index < lines.length; index++) {
  const line = lines[index]
  - let result = line.match(texifyLogLatex)
  + let result = line.match(beginPattern)
  if (result) {
  startLine = index
  }
  - result = line.match(texifyLog)
  + result = line.match(endPattern)
  if (result) {
  finalLine = index
  }
  @@ -102,6 +102,7 @@ export class CompilerLogParser {
  }
  }
  +
  private latexmkSkipped(log: string): boolean {
  if (log.match(latexmkUpToDate) && !log.match(latexmkPattern)) {
  this.showCompilerDiagnostics(this.latexLogParser.compilerDiagnostics, this.latexLogParser.buildLog, 'LaTeX')
  