mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01: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:
@@ -3,15 +3,11 @@ extends ../layout
|
|||||||
block content
|
block content
|
||||||
//- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>'
|
//- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>'
|
||||||
//- and doesn't prematurely end the script tag.
|
//- 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").
|
script(type="text/javascript").
|
||||||
window.data = {
|
window.data = JSON.parse($("#data").text());
|
||||||
projects: !{JSON.stringify(projects).replace(/\//g, '\\/')},
|
|
||||||
tags: !{JSON.stringify(tags).replace(/\//g, '\\/')},
|
|
||||||
notifications: !{JSON.stringify(notifications).replace(/\//g, '\\/')}
|
|
||||||
};
|
|
||||||
window.algolia = {
|
window.algolia = {
|
||||||
institutions: {
|
institutions: {
|
||||||
app_id: '#{algolia_app_id}',
|
app_id: '#{algolia_app_id}',
|
||||||
|
|||||||
Reference in New Issue
Block a user