Marked: Bullets before checkbox

Created on 7 May 2020  路  4Comments  路  Source: markedjs/marked

Given:

- [ ] Item 1
- [ ] Item 2

The checkboxes are rendered with both a bullet and the checkbox

Most helpful comment

marked just outputs the html. css styling is the responsibility of the user.

All 4 comments

marked just outputs the html. css styling is the responsibility of the user.

I could not find a way to do this with CSS.

@Ionaru you can add a class to a task list item with a renderer:

marked.use({
  renderer: {
    listitem(text, task) {
      if (task) {
        return '<li class="task-list-item">' + text + '</li>\n';
      }
      // use original renderer
      return false;
    }
  }
});

for more info about the renderer see the docs

Was this page helpful?
0 / 5 - 0 ratings

Related issues

james4388 picture james4388  路  3Comments

cusalvi picture cusalvi  路  3Comments

toc
zoe-cjf picture zoe-cjf  路  3Comments

eGavr picture eGavr  路  4Comments

pigtooter picture pigtooter  路  4Comments