Commit c3865bda authored by Douwe Maan's avatar Douwe Maan

Properly set task-list class on single item task lists

parent 09216e8b
...@@ -21,6 +21,7 @@ v 8.4.0 (unreleased) ...@@ -21,6 +21,7 @@ v 8.4.0 (unreleased)
- Update version check images to use SVG - Update version check images to use SVG
- Validate README format before displaying - Validate README format before displaying
- Enable Microsoft Azure OAuth2 support (Janis Meybohm) - Enable Microsoft Azure OAuth2 support (Janis Meybohm)
- Properly set task-list class on single item task lists
v 8.3.3 (unreleased) v 8.3.3 (unreleased)
- Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running - Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running
......
...@@ -12,13 +12,18 @@ module Banzai ...@@ -12,13 +12,18 @@ module Banzai
# #
# See https://github.com/github/task_list/pull/60 # See https://github.com/github/task_list/pull/60
class TaskListFilter < TaskList::Filter class TaskListFilter < TaskList::Filter
def add_css_class(node, *new_class_names) def add_css_class_with_fix(node, *new_class_names)
if new_class_names.include?('task-list') if new_class_names.include?('task-list')
super if node.children.any? { |c| c['class'] == 'task-list-item' } # Don't add class to all lists
else return
super elsif new_class_names.include?('task-list-item')
add_css_class_without_fix(node.parent, 'task-list')
end end
add_css_class_without_fix(node, *new_class_names)
end end
alias_method_chain :add_css_class, :fix
end end
end 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