summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-10-03 14:18:02 +0000
committerRémy Coutable <remy@rymai.me>2016-10-03 14:18:02 +0000
commitc4a061a23e6a379fde8b2d8ecda6d124b22164c6 (patch)
treed432f0553e7f8a4cd1f58cbcafdb3c1afc04081a
parentdfb9cab828a11cf00522734d11c2472e8b540b5c (diff)
parent4a23d7f49150c9292f643b6f1c4fdb3494868de7 (diff)
downloadgitlab-ce-c4a061a23e6a379fde8b2d8ecda6d124b22164c6.tar.gz
Merge branch '22466-task-list-fork' into 'master'
Resolve "Task List Checkbox Alignment" ## What does this MR do? Replace the unmaintained `task_list` gem with the `deckar01-task_list` fork ## Are there points in the code the reviewer needs to double check? - I had to pin some dependencies in the fork to support `ruby < 2.2`, which added new version restrictions for 2 existing modules. - I triggered a build after I removed the patch to show the test passed with the new gem, then I removed the test, because this behavior is tested in the gem's repo now. ## Why was this MR needed? - The `task_list` patch was added with a comment that said it should be removed when merged upstream, but the repo got archived, so an upstream patch requires a fork. - #22470 can't be patched without warnings due to the way `task_list` uses Ruby constants. - There are additional outstanding `task_list` bugs that can be fixed once we switch to a fork. ## What are the relevant issue numbers? - #22466 - #22470 - !6487 See merge request !6625
-rw-r--r--Gemfile22
-rw-r--r--Gemfile.lock8
-rw-r--r--lib/banzai/filter/task_list_filter.rb22
-rw-r--r--spec/lib/banzai/filter/task_list_filter_spec.rb16
4 files changed, 16 insertions, 52 deletions
diff --git a/Gemfile b/Gemfile
index 76ca6427feb..d7de92bdcec 100644
--- a/Gemfile
+++ b/Gemfile
@@ -99,17 +99,17 @@ gem 'unf', '~> 0.1.4'
gem 'seed-fu', '~> 2.3.5'
# Markdown and HTML processing
-gem 'html-pipeline', '~> 1.11.0'
-gem 'task_list', '~> 1.0.2', require: 'task_list/railtie'
-gem 'github-markup', '~> 1.4'
-gem 'redcarpet', '~> 3.3.3'
-gem 'RedCloth', '~> 4.3.2'
-gem 'rdoc', '~>3.6'
-gem 'org-ruby', '~> 0.9.12'
-gem 'creole', '~> 0.5.0'
-gem 'wikicloth', '0.8.1'
-gem 'asciidoctor', '~> 1.5.2'
-gem 'rouge', '~> 2.0'
+gem 'html-pipeline', '~> 1.11.0'
+gem 'deckar01-task_list', '1.0.5', require: 'task_list/railtie'
+gem 'github-markup', '~> 1.4'
+gem 'redcarpet', '~> 3.3.3'
+gem 'RedCloth', '~> 4.3.2'
+gem 'rdoc', '~>3.6'
+gem 'org-ruby', '~> 0.9.12'
+gem 'creole', '~> 0.5.0'
+gem 'wikicloth', '0.8.1'
+gem 'asciidoctor', '~> 1.5.2'
+gem 'rouge', '~> 2.0'
# See https://groups.google.com/forum/#!topic/ruby-security-ann/aSbgDiwb24s
# and https://groups.google.com/forum/#!topic/ruby-security-ann/Dy7YiKb_pMM
diff --git a/Gemfile.lock b/Gemfile.lock
index f15715a20ff..ca06b21ae65 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -157,6 +157,10 @@ GEM
database_cleaner (1.5.3)
debug_inspector (0.0.2)
debugger-ruby_core_source (1.3.8)
+ deckar01-task_list (1.0.5)
+ activesupport (~> 4.0)
+ html-pipeline
+ rack (~> 1.0)
default_value_for (3.0.2)
activerecord (>= 3.2.0, < 5.1)
descendants_tracker (0.0.4)
@@ -725,8 +729,6 @@ GEM
ffi
sysexits (1.2.0)
systemu (2.6.5)
- task_list (1.0.2)
- html-pipeline
teaspoon (1.1.5)
railties (>= 3.2.5, < 6)
teaspoon-jasmine (2.2.0)
@@ -831,6 +833,7 @@ DEPENDENCIES
creole (~> 0.5.0)
d3_rails (~> 3.5.0)
database_cleaner (~> 1.5.0)
+ deckar01-task_list (= 1.0.5)
default_value_for (~> 3.0.0)
devise (~> 4.2)
devise-two-factor (~> 3.0.0)
@@ -963,7 +966,6 @@ DEPENDENCIES
sprockets-es6 (~> 0.9.2)
state_machines-activerecord (~> 0.4.0)
sys-filesystem (~> 1.1.6)
- task_list (~> 1.0.2)
teaspoon (~> 1.1.0)
teaspoon-jasmine (~> 2.2.0)
test_after_commit (~> 0.4.2)
diff --git a/lib/banzai/filter/task_list_filter.rb b/lib/banzai/filter/task_list_filter.rb
index 4efbcaf5c7f..9fa5f589f3e 100644
--- a/lib/banzai/filter/task_list_filter.rb
+++ b/lib/banzai/filter/task_list_filter.rb
@@ -2,29 +2,7 @@ require 'task_list/filter'
module Banzai
module Filter
- # 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
- module ClassNamesFilter
- def add_css_class(node, *new_class_names)
- if new_class_names.include?('task-list')
- # Don't add class to all lists
- return
- elsif new_class_names.include?('task-list-item')
- super(node.parent, 'task-list')
- end
-
- super(node, *new_class_names)
- end
- end
-
class TaskListFilter < TaskList::Filter
- prepend ClassNamesFilter
end
end
end
diff --git a/spec/lib/banzai/filter/task_list_filter_spec.rb b/spec/lib/banzai/filter/task_list_filter_spec.rb
deleted file mode 100644
index 569cbc885c7..00000000000
--- a/spec/lib/banzai/filter/task_list_filter_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'spec_helper'
-
-describe Banzai::Filter::TaskListFilter, lib: true do
- include FilterSpecHelper
-
- 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
-
- it 'applies `task-list` to single-item task lists' do
- act = filter('<ul><li>[ ] Task 1</li></ul>')
-
- expect(act.to_html).to start_with '<ul class="task-list">'
- end
-end