Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5994265f
Commit
5994265f
authored
Mar 01, 2022
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Escape characters in diff view function definitions
parent
0578cc5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
app/assets/javascripts/diffs/components/diff_view.vue
app/assets/javascripts/diffs/components/diff_view.vue
+12
-6
spec/frontend/diffs/components/diff_view_spec.js
spec/frontend/diffs/components/diff_view_spec.js
+10
-2
No files found.
app/assets/javascripts/diffs/components/diff_view.vue
View file @
5994265f
<
script
>
<
script
>
import
{
GlSafeHtmlDirective
as
SafeHtml
}
from
'
@gitlab/ui
'
;
import
{
mapGetters
,
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
mapGetters
,
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
IdState
}
from
'
vendor/vue-virtual-scroller
'
;
import
{
IdState
}
from
'
vendor/vue-virtual-scroller
'
;
import
DraftNote
from
'
~/batch_comments/components/draft_note.vue
'
;
import
DraftNote
from
'
~/batch_comments/components/draft_note.vue
'
;
...
@@ -19,6 +20,9 @@ export default {
...
@@ -19,6 +20,9 @@ export default {
DiffCommentCell
,
DiffCommentCell
,
DraftNote
,
DraftNote
,
},
},
directives
:
{
SafeHtml
,
},
mixins
:
[
mixins
:
[
draftCommentsMixin
,
draftCommentsMixin
,
glFeatureFlagsMixin
(),
glFeatureFlagsMixin
(),
...
@@ -173,15 +177,17 @@ export default {
...
@@ -173,15 +177,17 @@ export default {
<div
class=
"diff-grid-left diff-grid-3-col left-side"
>
<div
class=
"diff-grid-left diff-grid-3-col left-side"
>
<div
class=
"diff-td diff-line-num"
></div>
<div
class=
"diff-td diff-line-num"
></div>
<div
v-if=
"inline"
class=
"diff-td diff-line-num"
></div>
<div
v-if=
"inline"
class=
"diff-td diff-line-num"
></div>
<div
class=
"diff-td line_content left-side gl-white-space-normal!"
>
<div
{{
line
.
left
.
rich_text
}}
v-safe-html=
"line.left.rich_text"
</div>
class=
"diff-td line_content left-side gl-white-space-normal!"
></div>
</div>
</div>
<div
v-if=
"!inline"
class=
"diff-grid-right diff-grid-3-col right-side"
>
<div
v-if=
"!inline"
class=
"diff-grid-right diff-grid-3-col right-side"
>
<div
class=
"diff-td diff-line-num"
></div>
<div
class=
"diff-td diff-line-num"
></div>
<div
class=
"diff-td line_content right-side gl-white-space-normal!"
>
<div
{{
line
.
left
.
rich_text
}}
v-safe-html=
"line.left.rich_text"
</div>
class=
"diff-td line_content right-side gl-white-space-normal!"
></div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
...
spec/frontend/diffs/components/diff_view_spec.js
View file @
5994265f
...
@@ -51,10 +51,18 @@ describe('DiffView', () => {
...
@@ -51,10 +51,18 @@ describe('DiffView', () => {
it
(
'
renders a match line
'
,
()
=>
{
it
(
'
renders a match line
'
,
()
=>
{
const
wrapper
=
createWrapper
({
const
wrapper
=
createWrapper
({
diffLines
:
[{
isMatchLineLeft
:
true
,
left
:
{
rich_text
:
'
matched text
'
,
lineDraft
:
{}
}
}],
diffLines
:
[
{
isMatchLineLeft
:
true
,
left
:
{
rich_text
:
'
@@ -4,12 +4,12 @@ import createFlash from '~/flash';
'
,
lineDraft
:
{},
},
},
],
});
});
expect
(
wrapper
.
find
(
DiffExpansionCell
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
DiffExpansionCell
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
text
()).
toContain
(
'
matched text
'
);
expect
(
wrapper
.
text
()).
toContain
(
"
@@ -4,12 +4,12 @@ import createFlash from '~/flash';
"
);
});
});
it
.
each
`
it
.
each
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment