Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit 96c4799

Browse files
committed
🔥 the label
1 parent 16541d7 commit 96c4799

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

app/assets/javascripts/task_lists.coffee

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
# <div class="js-task-list-container">
1616
# <ul class="task-list">
1717
# <li class="task-list-item">
18-
# <label>
19-
# <input type="checkbox" class="js-task-list-item-checkbox" disabled />
20-
# text
21-
# </label>
18+
# <input type="checkbox" class="js-task-list-item-checkbox" disabled />
19+
# text
2220
# </li>
2321
# </ul>
2422
# <form>
@@ -33,7 +31,7 @@
3331
# TaskList Items SHOULD be an a list (`UL`/`OL`) element.
3432
#
3533
# Task list items MUST match `(input).task-list-item-checkbox` and MUST be
36-
# `disabled` by default. The Item's contents SHOULD be wrapped in a `LABEL`.
34+
# `disabled` by default.
3735
#
3836
# TaskLists MUST have a `(textarea).js-task-list-field` form element whose
3937
# `value` attribute is the source (Markdown) to be udpated. The source MUST

lib/task_list/filter.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,8 @@ def render_item_checkbox(item)
9292
#
9393
# Returns the marked up task list item Nokogiri::XML::NodeSet object.
9494
def render_task_list_item(item)
95-
Nokogiri::HTML.fragment <<-html, 'utf-8'
96-
<label>#{
97-
item.source.sub(ItemPattern, render_item_checkbox(item))
98-
}</label>
99-
html
95+
Nokogiri::HTML.fragment \
96+
item.source.sub(ItemPattern, render_item_checkbox(item)), 'utf-8'
10097
end
10198

10299
# Public: Select all task lists from the `doc`.

test/functional/test_task_lists_behavior.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@
7171
<div class="markdown">
7272
<ul class="task-list">
7373
<li class="task-list-item">
74-
<label>
75-
<input type="checkbox" class="task-list-item-checkbox" disabled />
76-
I'm a task list item
77-
</label>
74+
<input type="checkbox" class="task-list-item-checkbox" disabled />
75+
I'm a task list item
7876
</li>
7977
</ul>
8078
</div>

0 commit comments

Comments
 (0)