Просмотр исходного кода

Merge pull request #2550 from overleaf/jpa-strip-tex

[autocomplete] input/include: strip the .tex extension

GitOrigin-RevId: 15ae910e38717382a734848c33cbdb3c66a75ac9
nate stemen 6 лет назад
Родитель
Сommit
1f514ec603

+ 2 - 1
services/web/frontend/js/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.js

@@ -107,9 +107,10 @@ define([
               for (let file of Files.getTeXFiles()) {
                 if (file.id !== this.$scope.docId) {
                   const { path } = file
+                  let cleanPath = path.replace(/(.+)\.tex$/i, '$1')
                   result.push({
                     caption: `\\${commandName}{${path}}`,
-                    value: `\\${commandName}{${path}}`,
+                    value: `\\${commandName}{${cleanPath}}`,
                     meta: 'file',
                     score: 50
                   })