egoist / md Goto Github PK
View Code? Open in Web Editor NEWA markdown parser and compiler. Built for speed.
License: MIT License
A markdown parser and compiler. Built for speed.
License: MIT License
Take an emoji plugin as example:
module.exports = function (md) {
md.renderer.emoji = theFunctionToRenderEmojiToHtml
md.inlineLexer.rules.add('emoji', replaceEmoji)
}
const md = require('md')
const emoji = require('md-emoji')
md.use(emoji)
This would be similar to what MDX does but for custom elements, and it's pretty simple.
The idea would be to modify only the Lexer class, and reuse the Parser and Rendere for html. I've already made it for a personal component, but I had to copy and paste the whole lex function.
Api would be something like
const md = require('md')
const html = md(`## hello world
<custom-button>Fancy button!</custom-button>
- [ ] todo
- [x] done
`, { customElements: ['custom-button'] })
If you agree I could send a PR
yarn test v0.27.5
$ npm run lint && BABEL_ENV=test ava
> [email protected] lint E:\Documents\marked3
> xo src/*.js
'BABEL_ENV' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
Hi ,
I following this package from
QingWei-Li/npmarket#3
https://github.com/QingWei-Li/npmarket/blob/master/src/utils/markdown.js#L1
seems this package don't support render table .
should this package need include table render ? ( just ask tone )
While the linksInNewTab
option is awesome, I'd like it to only affect non-id hrefs. Opening a new tab with the same page but in a different scroll position doesn't make for a great experience imho. I created a PR to fix this by checking the leading character of a link's href attribute. Please let me know if this is something you are into @egoist or if there are changes you'd like me to make ๐
marked(text, {
slug(raw) {
return slugify(raw)
}
})
By default we use slugo:
https://github.com/egoist/marked3/blob/1fd2b19a8001fb164d2129f5686bb9ef19cbffe9/src/renderer.js#L38
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.