@gerhobbelt/markdown-it-fontawesome

0.3.0-3 • Public • Published

markdown-it-fontawesome

Build Status NPM version Coverage Status

Markdown-it plugin that adds Font Awesome icons support.

Turn this:

Hello World! :fa-flag:

Into this:

<p>Hello World! <i class="fa fa-flag"></i></p>

Install

$ npm install @gerhobbelt/markdown-it-fontawesome --save

Usage

Enable plugin

var md = require('@gerhobbelt/markdown-it');
var fa = require('@gerhobbelt/markdown-it-fontawesome');

md().use(fa);

Font Awesome version 4 example

Hello World! :fa-flag:

- [:fa-google: Google](https://www.google.com/)
- [:fa-github: GitHub](https://github.com/)

Gets converted to:

<p>Hello World! <i class="fa fa-flag"></i></p>
<ul>
<li><a href="https://www.google.com/"><i class="fa fa-google"></i> Google</a></li>
<li><a href="https://github.com/"><i class="fa fa-github"></i> GitHub</a></li>
</ul>

Font Awesome 5+ example

Hello World! :fal-flag:

- [:fab-google: Google](https://www.google.com/)
- [:fab-github: GitHub](https://github.com/)

gets converted to:

<p>Hello World! <i class="fal fa-flag"></i></p>
<ul>
<li><a href="https://www.google.com/"><i class="fab fa-google"></i> Google</a></li>
<li><a href="https://github.com/"><i class="fab fa-github"></i> GitHub</a></li>
</ul>

Credits

Original: https://github.com/nunof07

Font awesome 5 support and tests: https://github.com/rjjakes

License

MIT

Package Sidebar

Install

npm i @gerhobbelt/markdown-it-fontawesome

Weekly Downloads

2

Version

0.3.0-3

License

MIT

Unpacked Size

15.1 kB

Total Files

13

Last publish

Collaborators

  • gerhobbelt