diff options
author | Phil Hughes <me@iamphill.com> | 2019-01-10 12:54:39 +0300 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-01-16 21:12:56 +0300 |
commit | 25af96e46c2ae67a1dac37e399246792050b9223 (patch) | |
tree | 62c791c4a5302a31b220f43492f122e698d1abee | |
parent | fc2432592b33c70d21a4e7f91c359da4b668a706 (diff) |
Merge branch '55945-suggested-change-highlight' into 'master'
Add syntax highlighting to suggestion diff
Closes #55945
See merge request gitlab-org/gitlab-ce!24156
(cherry picked from commit da3b20f7a4cbcbf1698b995f6dc69fa388bc5b2f)
2635f2c6 Add syntax highlighting to suggestion diff
e3919efd Add unit test for syntax highlighting
95f2d284 Add changelog entry
3 files changed, 8 insertions, 3 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff.vue b/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff.vue index f98560f7336..b9f884074d0 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff.vue @@ -50,7 +50,7 @@ export default { :help-page-path="helpPagePath" @apply="applySuggestion" /> - <table class="mb-3 md-suggestion-diff"> + <table class="mb-3 md-suggestion-diff js-syntax-highlight code"> <tbody> <!-- Old Line --> <tr class="line_holder old"> diff --git a/changelogs/unreleased/55945-suggested-change-highlight.yml b/changelogs/unreleased/55945-suggested-change-highlight.yml new file mode 100644 index 00000000000..611854d36ab --- /dev/null +++ b/changelogs/unreleased/55945-suggested-change-highlight.yml @@ -0,0 +1,5 @@ +--- +title: Add syntax highlighting to suggestion diff +merge_request: 24156 +author: +type: fixed diff --git a/spec/javascripts/vue_shared/components/markdown/suggestion_diff_spec.js b/spec/javascripts/vue_shared/components/markdown/suggestion_diff_spec.js index d4ed8f2f7a4..f87c2a92f47 100644 --- a/spec/javascripts/vue_shared/components/markdown/suggestion_diff_spec.js +++ b/spec/javascripts/vue_shared/components/markdown/suggestion_diff_spec.js @@ -34,8 +34,8 @@ describe('Suggestion Diff component', () => { expect(vm.$el.querySelector('.qa-suggestion-diff-header')).not.toBeNull(); }); - it('renders a diff table', () => { - expect(vm.$el.querySelector('table.md-suggestion-diff')).not.toBeNull(); + it('renders a diff table with syntax highlighting', () => { + expect(vm.$el.querySelector('.md-suggestion-diff.js-syntax-highlight.code')).not.toBeNull(); }); it('renders the oldLineNumber', () => { |