message: Fix Add Beamer frames to the outline
diff: @@ -87,7 +87,7 @@ export class SectionNodeProvider implements vscode.TreeDataProvider<Section> {
  // const inputReg = /^((?:\\(?:input|include|subfile)(?:\[[^\[\]\{\}]*\])?){([^}]*)})|^((?:\\((sub)?section)(?:\[[^\[\]\{\}]*\])?){([^}]*)})/gm
  const inputReg = RegExp(pattern, 'm')
  - const envReg = /(?:\\(begin|end)(?:\[[^\[\]]*\])?){(?:(figure|table)\*?)}/m
  + const envReg = /(?:\\(begin|end)(?:\[[^\[\]]*\])?){(?:(figure|frame|table)\*?)}/m
  const lines = content.split('\n')
  for (let lineNumber = 0; lineNumber < lines.length; lineNumber++) {
  @@ -104,7 +104,7 @@ export class SectionNodeProvider implements vscode.TreeDataProvider<Section> {
  continue
  }
  env.end = lineNumber
  - const caption = this.getCaption(lines, env)
  + const caption = this.getCaptionOrTitle(lines, env)
  if (!caption) {
  continue
  }
  @@ -242,9 +242,15 @@ export class SectionNodeProvider implements vscode.TreeDataProvider<Section> {
  return Promise.resolve(element.parent)
  }
  - getCaption(lines: string[], env: {name: string, start: number, end: number}) {
  + getCaptionOrTitle(lines: string[], env: {name: string, start: number, end: number}) {
  const content = lines.slice(env.start, env.end).join('\n')
  - const result = /(?:\\caption(?:\[[^\[\]]*\])?){((?:(?:[^\{\}])|(?:\{[^\{\}]*\}))+)}/gsm.exec(content)
  + let regex
  + if (env.name === 'frame') {
  + regex = /\\frametitle(?:<[^<>]*>)?(?:\[[^\[\]]*\])?{((?:(?:[^\{\}])|(?:\{[^\{\}]*\}))+)}/gsm
  + } else {
  + regex = /(?:\\caption(?:\[[^\[\]]*\])?){((?:(?:[^\{\}])|(?:\{[^\{\}]*\}))+)}/gsm
  + }
  + const result = regex.exec(content)
  if (result) {
  // Remove indentation, newlines and the final '.'
  return result[1].replace(/^ */gm, ' ').replace(/\r|\n/g, '').replace(/\.$/, '')
  