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
7b35e68f
Commit
7b35e68f
authored
Oct 22, 2021
by
Dheeraj Joshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to v-safe-html for commit messages
parent
025ec8c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
app/assets/javascripts/diffs/components/commit_item.vue
app/assets/javascripts/diffs/components/commit_item.vue
+8
-4
app/assets/javascripts/repository/components/last_commit.vue
app/assets/javascripts/repository/components/last_commit.vue
+15
-4
No files found.
app/assets/javascripts/diffs/components/commit_item.vue
View file @
7b35e68f
<
script
>
import
{
GlButtonGroup
,
GlButton
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
GlButtonGroup
,
GlButton
,
GlTooltipDirective
,
GlSafeHtmlDirective
}
from
'
@gitlab/ui
'
;
import
CommitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
ModalCopyButton
from
'
~/vue_shared/components/modal_copy_button.vue
'
;
...
...
@@ -34,6 +34,7 @@ export default {
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
SafeHtml
:
GlSafeHtmlDirective
,
},
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
...
...
@@ -88,6 +89,9 @@ export default {
initUserPopovers
(
this
.
$el
.
querySelectorAll
(
'
.js-user-link
'
));
});
},
safeHtmlConfig
:
{
ADD_TAGS
:
[
'
gl-emoji
'
],
},
};
</
script
>
...
...
@@ -101,7 +105,7 @@ export default {
>
<div
v-if=
"commit.signature_html"
v-
html=
"commit.signature_html /* eslint-disable-line vue/no-v-html */
"
v-
safe-html:
[$
options.safeHtmlConfig]=
"commit.signature_html
"
></div>
<commit-pipeline-status
v-if=
"commit.pipeline_status_path"
...
...
@@ -142,9 +146,9 @@ export default {
<div
class=
"commit-detail flex-list"
>
<div
class=
"commit-content"
data-qa-selector=
"commit_content"
>
<a
v-safe-html:
[$
options.safeHtmlConfig]=
"commit.title_html"
:href=
"commit.commit_url"
class=
"commit-row-message item-title"
v-html=
"commit.title_html /* eslint-disable-line vue/no-v-html */"
></a>
<span
class=
"commit-row-message d-block d-sm-none"
>
·
{{
commit
.
short_id
}}
</span>
...
...
@@ -174,9 +178,9 @@ export default {
<div>
<pre
v-if=
"commit.description_html"
v-safe-html:
[$
options.safeHtmlConfig]=
"commitDescription"
:class=
"
{ 'js-toggle-content': collapsible, 'd-block': !collapsible }"
class="commit-row-description gl-mb-3 gl-text-body"
v-html="commitDescription /* eslint-disable-line vue/no-v-html */"
>
</pre>
</div>
</li>
...
...
app/assets/javascripts/repository/components/last_commit.vue
View file @
7b35e68f
<
script
>
import
{
GlTooltipDirective
,
GlLink
,
GlButton
,
GlButtonGroup
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlTooltipDirective
,
GlLink
,
GlButton
,
GlButtonGroup
,
GlLoadingIcon
,
GlSafeHtmlDirective
,
}
from
'
@gitlab/ui
'
;
import
defaultAvatarUrl
from
'
images/no_avatar.png
'
;
import
pathLastCommitQuery
from
'
shared_queries/repository/path_last_commit.query.graphql
'
;
import
{
sprintf
,
s__
}
from
'
~/locale
'
;
...
...
@@ -23,6 +30,7 @@ export default {
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
SafeHtml
:
GlSafeHtmlDirective
,
},
mixins
:
[
getRefMixin
],
apollo
:
{
...
...
@@ -96,6 +104,9 @@ export default {
},
},
defaultAvatarUrl
,
safeHtmlConfig
:
{
ADD_TAGS
:
[
'
gl-emoji
'
],
},
};
</
script
>
...
...
@@ -121,10 +132,10 @@ export default {
<div
class=
"commit-detail flex-list"
>
<div
class=
"commit-content qa-commit-content"
>
<gl-link
v-safe-html:
[$
options.safeHtmlConfig]=
"commit.titleHtml"
:href=
"commit.webPath"
:class=
"
{ 'font-italic': !commit.message }"
class="commit-row-message item-title"
v-html="commit.titleHtml /* eslint-disable-line vue/no-v-html */"
/>
<gl-button
v-if=
"commit.descriptionHtml"
...
...
@@ -150,15 +161,15 @@ export default {
</div>
<pre
v-if=
"commitDescription"
v-safe-html:
[$
options.safeHtmlConfig]=
"commitDescription"
:class=
"{ 'd-block': showDescription }"
class=
"commit-row-description gl-mb-3"
v-html=
"commitDescription /* eslint-disable-line vue/no-v-html */"
></pre>
</div>
<div
class=
"commit-actions flex-row"
>
<div
v-if=
"commit.signatureHtml"
v-
html=
"commit.signatureHtml /* eslint-disable-line vue/no-v-html */
"
v-
safe-html:
[$
options.safeHtmlConfig]=
"commit.signatureHtml
"
></div>
<div
v-if=
"commit.pipeline"
class=
"ci-status-link"
>
<gl-link
...
...
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