Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-web
Commits
5aa94430
Commit
5aa94430
authored
6 years ago
by
Antoine Lambert
Browse files
Options
Downloads
Patches
Plain Diff
browse/revision: Escape json metadata for HTML display
parent
d56ab289
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/web/browse/views/revision.py
+4
-3
4 additions, 3 deletions
swh/web/browse/views/revision.py
with
4 additions
and
3 deletions
swh/web/browse/views/revision.py
+
4
−
3
View file @
5aa94430
...
...
@@ -10,6 +10,7 @@ import textwrap
from
django.http
import
HttpResponse
from
django.shortcuts
import
render
,
redirect
from
django.template.defaultfilters
import
filesizeformat
from
django.utils.html
import
escape
from
django.utils.safestring
import
mark_safe
from
swh.model.identifiers
import
persistent_identifier
...
...
@@ -359,9 +360,9 @@ def revision_browse(request, sha1_git, extra_path=None):
'
role
'
:
'
button
'
})
revision_data
[
'
id
'
]
=
sha1_git
revision_data
[
'
merge
'
]
=
revision
[
'
merge
'
]
revision_data
[
'
metadata
'
]
=
json
.
dumps
(
revision
[
'
metadata
'
],
sort_keys
=
True
,
indent
=
4
,
separators
=
(
'
,
'
,
'
:
'
))
revision_data
[
'
metadata
'
]
=
escape
(
json
.
dumps
(
revision
[
'
metadata
'
],
sort_keys
=
True
,
indent
=
4
,
separators
=
(
'
,
'
,
'
:
'
))
)
if
origin_info
:
revision_data
[
'
context-independent revision
'
]
=
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment