diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index 9e038dbcfe..0cd7ef3c3b 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -77,13 +77,13 @@ block content script(src='/socket.io/socket.io.js') - //- We need to do .replace(/\//, '\\/') do that '' -> '<\/script>' + //- We need to do .replace(/\//g, '\\/') do that '' -> '<\/script>' //- and doesn't prematurely end the script tag. script(type='text/javascript'). window.project_id = "!{project_id}" - window.sharelatex = !{JSON.stringify(sharelatex).replace(/\//, '\\/')}; - window.userSettings = !{JSON.stringify(userSettings).replace(/\//, '\\/')}; - window.user = !{JSON.stringify(user).replace(/\//, '\\/')}; + window.sharelatex = !{JSON.stringify(sharelatex).replace(/\//g, '\\/')}; + window.userSettings = !{JSON.stringify(userSettings).replace(/\//g, '\\/')}; + window.user = !{JSON.stringify(user).replace(/\//g, '\\/')}; window.csrfToken = "!{csrfToken}"; window.requirejs = { "paths" : { diff --git a/services/web/app/views/project/list.jade b/services/web/app/views/project/list.jade index cd6afa8a10..224b428013 100644 --- a/services/web/app/views/project/list.jade +++ b/services/web/app/views/project/list.jade @@ -1,12 +1,12 @@ extends ../layout block content - //- We need to do .replace(/\//, '\\/') do that '' -> '<\/script>' + //- We need to do .replace(/\//g, '\\/') do that '' -> '<\/script>' //- and doesn't prematurely end the script tag. script(type="text/javascript"). window.data = { - projects: !{JSON.stringify(projects).replace(/\//, '\\/')}, - tags: !{JSON.stringify(tags).replace(/\//, '\\/')} + projects: !{JSON.stringify(projects).replace(/\//g, '\\/')}, + tags: !{JSON.stringify(tags).replace(/\//g, '\\/')} }; window.algolia = { institutions: {