Commit 3a3f4b41 authored by Job van der Voort's avatar Job van der Voort

Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce

parents 90b1019a 10620c59
...@@ -7,6 +7,7 @@ v 7.12.0 (unreleased) ...@@ -7,6 +7,7 @@ v 7.12.0 (unreleased)
- Fix resolving of relative links to repository files in AsciiDoc documents. (Jakub Jirutka) - Fix resolving of relative links to repository files in AsciiDoc documents. (Jakub Jirutka)
v 7.11.0 (unreleased) v 7.11.0 (unreleased)
- Fall back to Plaintext when Syntaxhighlighting doesn't work. Fixes some buggy lexers (Hannes Rosenögger)
- Fix broken view when viewing history of a file that includes a path that used to be another file (Stan Hu) - Fix broken view when viewing history of a file that includes a path that used to be another file (Stan Hu)
- Don't show duplicate deploy keys - Don't show duplicate deploy keys
- Fix commit time being displayed in the wrong timezone in some cases (Hannes Rosenögger) - Fix commit time being displayed in the wrong timezone in some cases (Hannes Rosenögger)
...@@ -17,8 +18,6 @@ v 7.11.0 (unreleased) ...@@ -17,8 +18,6 @@ v 7.11.0 (unreleased)
- Don't allow a merge request to be merged when its title starts with "WIP". - Don't allow a merge request to be merged when its title starts with "WIP".
- Add a page title to every page. - Add a page title to every page.
- Allow primary email to be set to an email that you've already added. - Allow primary email to be set to an email that you've already added.
- Fix Error 500 when searching Wiki pages (Stan Hu)
- Get Gitorious importer to work again.
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky) - Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)
- Ignore invalid lines in .gitmodules - Ignore invalid lines in .gitmodules
- Fix "Cannot move project" error message from popping up after a successful transfer (Stan Hu) - Fix "Cannot move project" error message from popping up after a successful transfer (Stan Hu)
...@@ -27,7 +26,6 @@ v 7.11.0 (unreleased) ...@@ -27,7 +26,6 @@ v 7.11.0 (unreleased)
- Fix "Revspec not found" errors when viewing diffs in a forked project with submodules (Stan Hu) - Fix "Revspec not found" errors when viewing diffs in a forked project with submodules (Stan Hu)
- Improve project page UI - Improve project page UI
- Fix broken file browsing with relative submodule in personal projects (Stan Hu) - Fix broken file browsing with relative submodule in personal projects (Stan Hu)
- Fix DB error when trying to tag a repository (Stan Hu)
- Add "Reply quoting selected text" shortcut key (`r`) - Add "Reply quoting selected text" shortcut key (`r`)
- Fix bug causing `@whatever` inside an issue's first code block to be picked up as a user mention. - Fix bug causing `@whatever` inside an issue's first code block to be picked up as a user mention.
- Fix bug causing `@whatever` inside an inline code snippet (backtick-style) to be picked up as a user mention. - Fix bug causing `@whatever` inside an inline code snippet (backtick-style) to be picked up as a user mention.
...@@ -46,7 +44,6 @@ v 7.11.0 (unreleased) ...@@ -46,7 +44,6 @@ v 7.11.0 (unreleased)
- Add default project and snippet visibility settings to the admin web UI. - Add default project and snippet visibility settings to the admin web UI.
- Show incompatible projects in Google Code import status (Stan Hu) - Show incompatible projects in Google Code import status (Stan Hu)
- Fix bug where commit data would not appear in some subdirectories (Stan Hu) - Fix bug where commit data would not appear in some subdirectories (Stan Hu)
- Unescape branch names in compare commit (Stan Hu)
- Task lists are now usable in comments, and will show up in Markdown previews. - Task lists are now usable in comments, and will show up in Markdown previews.
- Fix bug where avatar filenames were not actually deleted from the database during removal (Stan Hu) - Fix bug where avatar filenames were not actually deleted from the database during removal (Stan Hu)
- Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu) - Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu)
...@@ -75,6 +72,15 @@ v 7.11.0 (unreleased) ...@@ -75,6 +72,15 @@ v 7.11.0 (unreleased)
- Fix reference links in dashboard activity and ATOM feeds. - Fix reference links in dashboard activity and ATOM feeds.
- Ensure that the first added admin performs repository imports - Ensure that the first added admin performs repository imports
v 7.10.4
- Fix migrations broken in 7.10.2
- Make tags for GitLab installations running on MySQL case sensitive
- Get Gitorious importer to work again.
- Fix adding new group members from admin area
- Fix DB error when trying to tag a repository (Stan Hu)
- Fix Error 500 when searching Wiki pages (Stan Hu)
- Unescape branch names in compare commit (Stan Hu)
v 7.10.2 v 7.10.2
- Fix CI links on MR page - Fix CI links on MR page
......
...@@ -94,7 +94,7 @@ gem "seed-fu" ...@@ -94,7 +94,7 @@ gem "seed-fu"
# Markdown and HTML processing # Markdown and HTML processing
gem 'html-pipeline', '~> 1.11.0' gem 'html-pipeline', '~> 1.11.0'
gem 'task_list', '~> 1.0.0', require: 'task_list/railtie' gem 'task_list', '1.0.2', require: 'task_list/railtie'
gem 'github-markup' gem 'github-markup'
gem 'redcarpet', '~> 3.2.3' gem 'redcarpet', '~> 3.2.3'
gem 'RedCloth' gem 'RedCloth'
......
...@@ -338,7 +338,7 @@ GEM ...@@ -338,7 +338,7 @@ GEM
method_source (0.8.2) method_source (0.8.2)
mime-types (1.25.1) mime-types (1.25.1)
mimemagic (0.3.0) mimemagic (0.3.0)
mini_portile (0.6.1) mini_portile (0.6.2)
minitest (5.3.5) minitest (5.3.5)
mousetrap-rails (1.4.6) mousetrap-rails (1.4.6)
multi_json (1.10.1) multi_json (1.10.1)
...@@ -350,7 +350,7 @@ GEM ...@@ -350,7 +350,7 @@ GEM
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
net-ssh (2.8.0) net-ssh (2.8.0)
newrelic_rpm (3.9.4.245) newrelic_rpm (3.9.4.245)
nokogiri (1.6.5) nokogiri (1.6.6.2)
mini_portile (~> 0.6.0) mini_portile (~> 0.6.0)
nprogress-rails (0.1.2.3) nprogress-rails (0.1.2.3)
oauth (0.4.7) oauth (0.4.7)
...@@ -802,7 +802,7 @@ DEPENDENCIES ...@@ -802,7 +802,7 @@ DEPENDENCIES
spring-commands-spinach (= 1.0.0) spring-commands-spinach (= 1.0.0)
stamp stamp
state_machine state_machine
task_list (~> 1.0.0) task_list (= 1.0.2)
test_after_commit test_after_commit
thin thin
tinder (~> 1.9.2) tinder (~> 1.9.2)
......
...@@ -89,7 +89,6 @@ label { ...@@ -89,7 +89,6 @@ label {
@include box-shadow(none); @include box-shadow(none);
} }
.issuable-description,
.wiki-content { .wiki-content {
margin-top: 35px; margin-top: 35px;
} }
...@@ -79,11 +79,11 @@ ul.notes { ...@@ -79,11 +79,11 @@ ul.notes {
word-wrap: break-word; word-wrap: break-word;
@include md-typography; @include md-typography;
// Reduce left padding of first ul element // Reduce left padding of first task list ul element
ul.task-list:first-child { ul.task-list:first-child {
padding-left: 10px; padding-left: 10px;
// sub-lists should be padded normally // sub-tasks should be padded normally
ul { ul {
padding-left: 20px; padding-left: 20px;
} }
......
...@@ -9,11 +9,13 @@ module BlobHelper ...@@ -9,11 +9,13 @@ module BlobHelper
begin begin
lexer = Rugments::Lexer.guess(filename: blob_name, source: blob_content) lexer = Rugments::Lexer.guess(filename: blob_name, source: blob_content)
rescue Rugments::Lexer::AmbiguousGuess result = formatter.format(lexer.lex(blob_content)).html_safe
rescue
lexer = Rugments::Lexers::PlainText lexer = Rugments::Lexers::PlainText
result = formatter.format(lexer.lex(blob_content)).html_safe
end end
formatter.format(lexer.lex(blob_content)).html_safe result
end end
def no_highlight_files def no_highlight_files
......
...@@ -11,6 +11,15 @@ ...@@ -11,6 +11,15 @@
.col-sm-10 .col-sm-10
= f.text_field :title, maxlength: 255, autofocus: true, = f.text_field :title, maxlength: 255, autofocus: true,
class: 'form-control pad js-gfm-input', required: true class: 'form-control pad js-gfm-input', required: true
- if issuable.is_a?(MergeRequest)
%p.help-block
- if issuable.work_in_progress?
This merge request is marked a <strong>Work In Progress</strong>.
When it's ready, remove the <code>WIP</code> prefix from the title to allow it to be accepted.
- else
To prevent this merge request from being accepted before it's ready,
mark it a <strong>Work In Progress</strong> by starting the title with <code>[WIP]</code> or <code>WIP:</code>.
.form-group.issuable-description .form-group.issuable-description
= f.label :description, 'Description', class: 'control-label' = f.label :description, 'Description', class: 'control-label'
.col-sm-10 .col-sm-10
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
.automerge_widget.cannot_be_merged.hide .automerge_widget.cannot_be_merged.hide
%strong This request can't be merged automatically. Even if it could be merged, you don't have permission to do so. %strong This request can't be merged automatically. Even if it could be merged, you don't have permission to do so.
.automerge_widget.work_in_progress.hide .automerge_widget.work_in_progress.hide
%strong This request can't be merged automatically because it is marked a Work In Progress. Even if it could be merged, you don't have permission to do so. %strong This request can't be accepted because it is marked a Work In Progress. Even if it could be accepted, you don't have permission to do so.
.automerge_widget.can_be_merged.hide .automerge_widget.can_be_merged.hide
%strong This request can be merged automatically, but you don't have permission to do so. %strong This request can be merged automatically, but you don't have permission to do so.
...@@ -57,11 +57,11 @@ ...@@ -57,11 +57,11 @@
%i.fa.fa-warning %i.fa.fa-warning
Accept Merge Request Accept Merge Request
&nbsp; &nbsp;
This usually happens when git can not resolve conflicts between branches automatically. This usually happens when Git can not resolve conflicts between branches automatically.
.automerge_widget.work_in_progress.hide .automerge_widget.work_in_progress.hide
%h4 %h4
This request can't be merged because it is marked a <strong>Work In Progress</strong>. This request can't be accepted because it is marked a <strong>Work In Progress</strong>.
%p %p
%button.btn.disabled{:type => 'button'} %button.btn.disabled{:type => 'button'}
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
Accept Merge Request Accept Merge Request
&nbsp; &nbsp;
When the merge request is ready, remove the "WIP" prefix from the title to allow it to be merged. When the merge request is ready, remove the "WIP" prefix from the title to allow it to be accepted.
.automerge_widget.unchecked .automerge_widget.unchecked
%p %p
......
require 'html/pipeline' require 'html/pipeline'
require 'task_list/filter'
module Gitlab module Gitlab
# Custom parser for GitLab-flavored Markdown # Custom parser for GitLab-flavored Markdown
...@@ -19,6 +18,7 @@ module Gitlab ...@@ -19,6 +18,7 @@ module Gitlab
autoload :SanitizationFilter, 'gitlab/markdown/sanitization_filter' autoload :SanitizationFilter, 'gitlab/markdown/sanitization_filter'
autoload :SnippetReferenceFilter, 'gitlab/markdown/snippet_reference_filter' autoload :SnippetReferenceFilter, 'gitlab/markdown/snippet_reference_filter'
autoload :TableOfContentsFilter, 'gitlab/markdown/table_of_contents_filter' autoload :TableOfContentsFilter, 'gitlab/markdown/table_of_contents_filter'
autoload :TaskListFilter, 'gitlab/markdown/task_list_filter'
autoload :UserReferenceFilter, 'gitlab/markdown/user_reference_filter' autoload :UserReferenceFilter, 'gitlab/markdown/user_reference_filter'
# Public: Parse the provided text with GitLab-Flavored Markdown # Public: Parse the provided text with GitLab-Flavored Markdown
...@@ -113,7 +113,7 @@ module Gitlab ...@@ -113,7 +113,7 @@ module Gitlab
Gitlab::Markdown::CommitReferenceFilter, Gitlab::Markdown::CommitReferenceFilter,
Gitlab::Markdown::LabelReferenceFilter, Gitlab::Markdown::LabelReferenceFilter,
TaskList::Filter Gitlab::Markdown::TaskListFilter
] ]
end end
end end
......
...@@ -8,8 +8,10 @@ module Gitlab ...@@ -8,8 +8,10 @@ module Gitlab
# Extends HTML::Pipeline::SanitizationFilter with a custom whitelist. # Extends HTML::Pipeline::SanitizationFilter with a custom whitelist.
class SanitizationFilter < HTML::Pipeline::SanitizationFilter class SanitizationFilter < HTML::Pipeline::SanitizationFilter
def whitelist def whitelist
whitelist = HTML::Pipeline::SanitizationFilter::WHITELIST whitelist = super
# Only push these customizations once
unless customized?(whitelist[:transformers])
# Allow code highlighting # Allow code highlighting
whitelist[:attributes]['pre'] = %w(class) whitelist[:attributes]['pre'] = %w(class)
whitelist[:attributes]['span'] = %w(class) whitelist[:attributes]['span'] = %w(class)
...@@ -26,10 +28,13 @@ module Gitlab ...@@ -26,10 +28,13 @@ module Gitlab
# Remove `class` attribute from non-highlight spans # Remove `class` attribute from non-highlight spans
whitelist[:transformers].push(clean_spans) whitelist[:transformers].push(clean_spans)
end
whitelist whitelist
end end
private
def remove_rel def remove_rel
lambda do |env| lambda do |env|
if env[:node_name] == 'a' if env[:node_name] == 'a'
...@@ -48,6 +53,10 @@ module Gitlab ...@@ -48,6 +53,10 @@ module Gitlab
end end
end end
end end
def customized?(transformers)
transformers.last.source_location[0] == __FILE__
end
end end
end end
end end
require 'task_list/filter'
module Gitlab
module Markdown
# Work around a bug in the default TaskList::Filter that adds a `task-list`
# class to every list element, regardless of whether or not it contains a
# task list.
#
# This is a (hopefully) temporary fix, pending a new release of the
# task_list gem.
#
# See https://github.com/github/task_list/pull/60
class TaskListFilter < TaskList::Filter
def add_css_class(node, *new_class_names)
if new_class_names.include?('task-list')
super if node.children.any? { |c| c['class'] == 'task-list-item' }
else
super
end
end
end
end
end
require 'spec_helper'
module Gitlab::Markdown
describe TaskListFilter do
def filter(html, options = {})
described_class.call(html, options)
end
it 'does not apply `task-list` class to non-task lists' do
exp = act = %(<ul><li>Item</li></ul>)
expect(filter(act).to_html).to eq exp
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment