File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,25 @@ This example will render similarly to this:
221221See the specification for the [ GitHub Tables extension] [ tables ] for more
222222details on the exact syntax supported.
223223
224+ ### Task lists
225+
226+ Task lists can be used as a checklist of items that have been completed.
227+ Example:
228+
229+ ``` md
230+ - [x] Complete task
231+ - [ ] IncComplete task
232+ ```
233+
234+ This will render as
235+
236+ <ul >
237+ <li><input type="checkbox"></li>
238+ <li><input type="checkbox" checked></li>
239+ </ul >
240+
241+ See the specification for the [ task list extension] for more details.
242+
224243[ `backtrace` ] : https://docs.rs/backtrace/0.3.50/backtrace/
225244[ commonmark markdown specification ] : https://commonmark.org/
226245[ commonmark quick reference ] : https://commonmark.org/help/
@@ -234,3 +253,4 @@ details on the exact syntax supported.
234253[ `std::env` ] : https://doc.rust-lang.org/stable/std/env/index.html#functions
235254[ strikethrough ] : https://github.github.com/gfm/#strikethrough-extension-
236255[ tables ] : https://github.github.com/gfm/#tables-extension-
256+ [ task list extension ] : https://github.github.com/gfm/#task-list-items-extension-
Original file line number Diff line number Diff line change @@ -48,7 +48,10 @@ mod tests;
4848
4949/// Options for rendering Markdown in the main body of documentation.
5050pub ( crate ) fn opts ( ) -> Options {
51- Options :: ENABLE_TABLES | Options :: ENABLE_FOOTNOTES | Options :: ENABLE_STRIKETHROUGH
51+ Options :: ENABLE_TABLES
52+ | Options :: ENABLE_FOOTNOTES
53+ | Options :: ENABLE_STRIKETHROUGH
54+ | Options :: ENABLE_TASKLISTS
5255}
5356
5457/// A subset of [`opts()`] used for rendering summaries.
Original file line number Diff line number Diff line change 1+ // ignore-tidy-linelength
2+ // FIXME: this doesn't test as much as I'd like; ideally it would have these query too:
3+ // has task_lists/index.html '//li/input[@type="checkbox" and disabled]/following-sibling::text()' 'a'
4+ // has task_lists/index.html '//li/input[@type="checkbox"]/following-sibling::text()' 'b'
5+ // Unfortunately that requires LXML, because the built-in xml module doesn't support all of xpath.
6+
7+ // @has task_lists/index.html '//ul/li/input[@type="checkbox"]' ''
8+ // @has task_lists/index.html '//ul/li/input[@disabled]' ''
9+ // @has task_lists/index.html '//ul/li' 'a'
10+ // @has task_lists/index.html '//ul/li' 'b'
11+ //! This tests 'task list' support, a common markdown extension.
12+ //! - [ ] a
13+ //! - [x] b
You can’t perform that action at this time.
0 commit comments