Comments (4)
Hi @auxtern , thanks.
I have no idea. Try it and let me know!
from markdown-it-fontawesome.
I've tried it.
the problem arose for importing the Regex plugin, which states "require is not defined". It's a bit confusing to get around this.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.markdownitFontAwesome = factory());
})(this, (function () {
'use strict';
var Plugin = require('markdown-it-regexp');
module.exports = function fontawesome_plugin(md) {
// FA4 style.
md.use(Plugin(
/\:fa-([\w\-]+)\:/,
function (match, utils) {
return '<i class="fa fa-' + utils.escape(match[1]) + '"></i>';
}
));
// FA5 style.
md.use(Plugin(
/\:fa([\w])-([\w\-]+)\:/,
function (match, utils) {
return '<i class="fa' + utils.escape(match[1]) + ' fa-' + utils.escape(match[2]) + '"></i>';
}
));
};
}));
from markdown-it-fontawesome.
For reference I looked at the markdown-it-emoji plugin:
https://github.com/markdown-it/markdown-it-emoji/blob/master/dist/markdown-it-emoji.js
from markdown-it-fontawesome.
Yeah, it wasn't built with this in mind.
This plugin is pretty small. If you can get markdown-it-regexp to work on the browser, it should be easy to just copy the code from this plugin and apply in your project.
Or if you are passing this package through a bundler, maybe there is a way to make it work.
from markdown-it-fontawesome.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdown-it-fontawesome.