markdown-it-color-inline
v1.9.5
Published
Allows for you to change your markdown text color within inline styles.
Downloads
120
Maintainers
Readme
markdown-it-color-inline
After a lot of working, starting with a fork, then making my own package, I got my first npm package running. I made this to work on my SvelteKit project because the ones I tried just errored out in production, so here we are. Shout out to nkjmsss and yusu79 as those package/creators are what I used to peace together this. I did a little copy & paste from both, so please do go view their amazing work.
Install
npm i markdown-it-color-inline --save
Usage
var md = require('markdown-it')().use(require('markdown-it-color-inline'));
or
import markdownItColorInline from 'markdown-it-color-inline';
const md = new MarkdownIt().use(markdownItColor);
Render
md.render('{red}(sample)'); // => '<span id="md-convert" style="color: red;">sample</span>'
If I learn how npm packages work better, I will add a config for the id.