From 33a13982446cf2f0dba8f3132f31e1b448417d00 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Fri, 30 Oct 2015 14:20:20 -0700 Subject: [PATCH] Fix leave trailing slash when entering urls --- common/app/routes/Jobs/components/NewJob.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/app/routes/Jobs/components/NewJob.jsx b/common/app/routes/Jobs/components/NewJob.jsx index 7a2c61f7a5..cd5cbb237a 100644 --- a/common/app/routes/Jobs/components/NewJob.jsx +++ b/common/app/routes/Jobs/components/NewJob.jsx @@ -94,7 +94,12 @@ function formatUrl(url) { url.length > 4 && url.indexOf('.') !== -1 ) { - return normalizeUrl(url, normalizeOptions); + // prevent trailing / from being stripped during typing + let lastChar = ''; + if (url.substring(url.length - 1) === '/') { + lastChar = '/'; + } + return normalizeUrl(url, normalizeOptions) + lastChar; } return url; }