diff --git a/lib/banzai/filter/task_list_filter.rb b/lib/banzai/filter/task_list_filter.rb index 0ec613889ba63833f8fed133146b0dd35cf346f8..63149b84d135a3669b1ee228e086f95c8b902d2e 100644 --- a/lib/banzai/filter/task_list_filter.rb +++ b/lib/banzai/filter/task_list_filter.rb @@ -2,8 +2,8 @@ module Banzai module Filter - # TaskListFilter annotates task list items with aria-labels, creates preceding - # elements, and adds strikethroughs to the text body of inapplicable items (created with `[~]`). + # TaskListFilter annotates task list items with aria-labels, adds strikethroughs + # to the text body of inapplicable items (created with `[~]`). # # This should be run on the HTML generated by the Markdown filter, which handles the actual # parsing, after the SanitizationFilter. @@ -22,8 +22,6 @@ def call truncated_text_content = text_content.strip.truncate(100, separator: ' ', omission: '…') node['aria-label'] = format(_('Check option: %{option}'), option: truncated_text_content) - node.add_previous_sibling(node.document.create_element('task-button')) - next unless node.has_attribute?('data-inapplicable') # We manually apply a to strikethrough text in inapplicable task items, diff --git a/spec/frontend/work_items/components/notes/work_item_note_body_spec.js b/spec/frontend/work_items/components/notes/work_item_note_body_spec.js index f86e91ce4a73311c1cd0d43f08fe9f5b7cf87770..e4d7eb10eef6baad3281b89c0b9c8b68afdee5c4 100644 --- a/spec/frontend/work_items/components/notes/work_item_note_body_spec.js +++ b/spec/frontend/work_items/components/notes/work_item_note_body_spec.js @@ -50,7 +50,7 @@ end`; ...mockWorkItemCommentNote, body: markdownBefore, bodyHtml: - '

beginning

end

', + '

beginning

end

', }; createComponent({ note, hasAdminNotePermission: true }); const checkbox = wrapper.find('.task-list-item-checkbox').element; @@ -75,7 +75,7 @@ end`; ...mockWorkItemCommentNote, body: markdownBefore, bodyHtml: - '

beginning

end

', + '

beginning

end

', }; createComponent({ note, hasAdminNotePermission: true }); await nextTick(); @@ -101,7 +101,7 @@ end`; ...mockWorkItemCommentNote, body: markdownBefore, bodyHtml: - '

beginning

end

', + '

beginning

end

', }; createComponent({ note }); await nextTick(); diff --git a/spec/lib/banzai/filter/task_list_filter_spec.rb b/spec/lib/banzai/filter/task_list_filter_spec.rb index 2850324dbcc75e8a6ecd9c96ea0ed46f119199e1..d793c680efb7cb59dd799d7524d95b4ab68c4b50 100644 --- a/spec/lib/banzai/filter/task_list_filter_spec.rb +++ b/spec/lib/banzai/filter/task_list_filter_spec.rb @@ -5,15 +5,6 @@ RSpec.describe Banzai::Filter::TaskListFilter, feature_category: :markdown do include FilterSpecHelper - it 'adds `` to every list item' do - doc = reference_filter(<<~MARKDOWN) - * [ ] testing item 1 - * [x] testing item 2 - MARKDOWN - - expect(doc.xpath('.//li//task-button').count).to eq(2) - end - it 'adds `aria-label` to every checkbox in the list' do # Some of these test cases are not possible to encounter in practice: # they imply these tags or attributes made it past SanitizationFilter.