Giter Site home page Giter Site logo

md's Issues

Plugin API

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)

Support custom elements

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

cannot run tests on windows

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.

Keeping anchors with ID hrefs in the same tab

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 ๐Ÿ‘

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.