summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/static_site_editor/services/renderers/render_image.js
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
committerRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
commit6438df3a1e0fb944485cebf07976160184697d72 (patch)
tree00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/assets/javascripts/static_site_editor/services/renderers/render_image.js
parent42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff)
downloadgitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/static_site_editor/services/renderers/render_image.js')
-rw-r--r--app/assets/javascripts/static_site_editor/services/renderers/render_image.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/static_site_editor/services/renderers/render_image.js b/app/assets/javascripts/static_site_editor/services/renderers/render_image.js
index b0d863bdb5a..b5651e7163e 100644
--- a/app/assets/javascripts/static_site_editor/services/renderers/render_image.js
+++ b/app/assets/javascripts/static_site_editor/services/renderers/render_image.js
@@ -4,16 +4,16 @@ const canRender = ({ type }) => type === 'image';
let metadata;
-const getCachedContent = basePath => metadata.imageRepository.get(basePath);
+const getCachedContent = (basePath) => metadata.imageRepository.get(basePath);
-const isRelativeToCurrentDirectory = basePath => !basePath.startsWith('/');
+const isRelativeToCurrentDirectory = (basePath) => !basePath.startsWith('/');
-const extractSourceDirectory = url => {
+const extractSourceDirectory = (url) => {
const sourceDir = /^(.+)\/([^/]+)$/.exec(url); // Extracts the base path and fileName from an image path
return sourceDir || [null, null, url]; // If no source directory was extracted it means only a fileName was specified (e.g. url='file.png')
};
-const parseCurrentDirectory = basePath => {
+const parseCurrentDirectory = (basePath) => {
const baseUrl = decodeURIComponent(metadata.baseUrl);
const sourceDirectory = extractSourceDirectory(baseUrl)[1];
const currentDirectory = sourceDirectory.split(`/-/sse/${metadata.branch}`)[1];
@@ -23,7 +23,7 @@ const parseCurrentDirectory = basePath => {
// For more context around this logic, please see the following comment:
// https://gitlab.com/gitlab-org/gitlab/-/issues/241166#note_409413500
-const generateSourceDirectory = basePath => {
+const generateSourceDirectory = (basePath) => {
let sourceDir = '';
let defaultSourceDir = '';