mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 18:22:01 +00:00
Merge pull request #477 from sharelatex/ja-encode-project-names
Properly pass project data as JSON and then parse it
This commit is contained in:
commit
7d24fbc225
1 changed files with 3 additions and 7 deletions
|
@ -3,15 +3,11 @@ extends ../layout
|
|||
block content
|
||||
//- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>'
|
||||
//- and doesn't prematurely end the script tag.
|
||||
|
||||
|
||||
script#data(type="application/json").
|
||||
!{JSON.stringify({ projects: projects, tags: tags, notifications: notifications }).replace(/\//g, '\\/')}
|
||||
|
||||
script(type="text/javascript").
|
||||
window.data = {
|
||||
projects: !{JSON.stringify(projects).replace(/\//g, '\\/')},
|
||||
tags: !{JSON.stringify(tags).replace(/\//g, '\\/')},
|
||||
notifications: !{JSON.stringify(notifications).replace(/\//g, '\\/')}
|
||||
};
|
||||
window.data = JSON.parse($("#data").text());
|
||||
window.algolia = {
|
||||
institutions: {
|
||||
app_id: '#{algolia_app_id}',
|
||||
|
|
Loading…
Reference in a new issue