Closed detj closed 5 years ago
^-- You’re right! I think this is new!
Could you create a PR for this? Should be a change somewhere here:
Something like this pseudocode:
items = all(h, node)
for item in items {
if (item.properties.className && item.properties.className.indexOf('task-list-item') !== -1) {
props.className = ['contains-task-list']
break
}
}
return h(node, name, props, wrap(items, true))
@wooorm here you go https://github.com/syntax-tree/mdast-util-to-hast/pull/29
A
task-list-item
class is added if the list item seems to be a task list, making it easier to style the task list item.https://github.com/syntax-tree/mdast-util-to-hast/blob/51bc203c7f9f4107c97883abb964da7519dd2531/lib/handlers/list-item.js#L60
GitHub adds a
contains-task-list
class to its<ul>
. This would make it easier to style a task list differently, which is what I am trying to do in my gatsby-mdx based blog.Does it make sense to add a class to the
<ul>
if it contains one or more task list?