Remove extra soft break for tasklist (#8142)
Browser will display the extra newline character between checkbox and text as a space, which make tasklist items cannot be aligned. I just remove it.
This commit is contained in:
parent
3876f15b45
commit
2abf56f508
2 changed files with 15 additions and 25 deletions
|
@ -502,7 +502,7 @@ listItemToHtml opts bls
|
||||||
let checkbox = if checked
|
let checkbox = if checked
|
||||||
then checkbox' ! A.checked ""
|
then checkbox' ! A.checked ""
|
||||||
else checkbox'
|
else checkbox'
|
||||||
checkbox' = H.input ! A.type_ "checkbox" ! A.disabled "" >> nl
|
checkbox' = H.input ! A.type_ "checkbox" ! A.disabled ""
|
||||||
isContents <- inlineListToHtml opts is
|
isContents <- inlineListToHtml opts is
|
||||||
bsContents <- blockListToHtml opts bs
|
bsContents <- blockListToHtml opts bs
|
||||||
return $ constr (checkbox >> isContents) >> bsContents
|
return $ constr (checkbox >> isContents) >> bsContents
|
||||||
|
|
|
@ -6,10 +6,8 @@ tests adapted from <https://github.github.com/gfm/#task-list-items-extension->
|
||||||
- [x] bar
|
- [x] bar
|
||||||
^D
|
^D
|
||||||
<ul class="task-list">
|
<ul class="task-list">
|
||||||
<li><input type="checkbox" disabled="" />
|
<li><input type="checkbox" disabled="" />foo</li>
|
||||||
foo</li>
|
<li><input type="checkbox" disabled="" checked="" />bar</li>
|
||||||
<li><input type="checkbox" disabled="" checked="" />
|
|
||||||
bar</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -22,15 +20,12 @@ bar</li>
|
||||||
- [ ] bim
|
- [ ] bim
|
||||||
^D
|
^D
|
||||||
<ul class="task-list">
|
<ul class="task-list">
|
||||||
<li><input type="checkbox" disabled="" checked="" />
|
<li><input type="checkbox" disabled="" checked="" />foo<ul
|
||||||
foo<ul class="task-list">
|
class="task-list">
|
||||||
<li><input type="checkbox" disabled="" />
|
<li><input type="checkbox" disabled="" />bar</li>
|
||||||
bar</li>
|
<li><input type="checkbox" disabled="" checked="" />baz</li>
|
||||||
<li><input type="checkbox" disabled="" checked="" />
|
|
||||||
baz</li>
|
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><input type="checkbox" disabled="" />
|
<li><input type="checkbox" disabled="" />bim</li>
|
||||||
bim</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -58,26 +53,21 @@ paragraph
|
||||||
- [x] checked
|
- [x] checked
|
||||||
^D
|
^D
|
||||||
<ul>
|
<ul>
|
||||||
<li><input type="checkbox" disabled="" />
|
<li><input type="checkbox" disabled="" />unchecked</li>
|
||||||
unchecked</li>
|
|
||||||
<li>plain item</li>
|
<li>plain item</li>
|
||||||
<li><input type="checkbox" disabled="" checked="" />
|
<li><input type="checkbox" disabled="" checked="" />checked</li>
|
||||||
checked</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<p>paragraph</p>
|
<p>paragraph</p>
|
||||||
<ol type="1">
|
<ol type="1">
|
||||||
<li><input type="checkbox" disabled="" />
|
<li><input type="checkbox" disabled="" />ordered unchecked</li>
|
||||||
ordered unchecked</li>
|
|
||||||
<li>[] plain item</li>
|
<li>[] plain item</li>
|
||||||
<li><input type="checkbox" disabled="" checked="" />
|
<li><input type="checkbox" disabled="" checked="" />ordered checked</li>
|
||||||
ordered checked</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
<p>paragraph</p>
|
<p>paragraph</p>
|
||||||
<ul class="task-list">
|
<ul class="task-list">
|
||||||
<li><p><input type="checkbox" disabled="" />
|
<li><p><input type="checkbox" disabled="" />list item with
|
||||||
list item with a</p><p>second paragraph</p></li>
|
a</p><p>second paragraph</p></li>
|
||||||
<li><p><input type="checkbox" disabled="" checked="" />
|
<li><p><input type="checkbox" disabled="" checked="" />checked</p></li>
|
||||||
checked</p></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue