A markdown-it plugin to use font awesome icons in a list.
Adds appropriate classes and font awesome icons to bulleted lists as per the font awesome recommended documentation:
- Adds
.fa-ul
to any bulleted list - Prepends necessary html to any list item
<span class="fa-li"><i class="fas fa-check-square"></i></span>
Note: This package does not load the necessary font awesome dependencies for styling or SVG conversion. Learn more about add Font Awesome to you project at https://fontawesome.com/start.
npm install --save-dev markdown-it-fa-bullet-list
Use it the same as a normal markdown-it plugin:
const md = require('markdown-it');
const faBulletedLists = require('markdown-it-fa-bullet-list');
const parser = md().use(faBulletedLists);
let result = parser.render(...); // markdown string containing task list items
The default icon is the solid style check-square: fas fa-check-square
; to change this, pass the desired icon class to the class
option:
const parser = md().use(faBulletedLists, {class: "fas fa-heart"});
npm install
npm test
Built on concepts from markdown-it-task-lists, Copyright (c) 2016, Revin Guillen.
ISC