Marked.js extension for Misskey-flavored Markdown
Find a file
2022-08-01 12:40:07 +03:00
docs Add syntax document 2022-07-15 14:59:00 +03:00
lib Add backslash escaping 2022-08-01 09:08:18 +03:00
src Add backslash escaping 2022-08-01 09:08:18 +03:00
test Add backslash escaping 2022-08-01 09:08:18 +03:00
.editorconfig Initial commit 2022-07-08 11:32:20 +03:00
.eslintignore Add bundler 2022-07-08 23:51:13 +03:00
.eslintrc.cjs Initial commit 2022-07-08 11:32:20 +03:00
.gitignore Initial commit 2022-07-08 11:32:20 +03:00
.woodpecker.yml Add bundler 2022-07-08 23:51:13 +03:00
babel.config.json Initial commit 2022-07-08 11:32:20 +03:00
jest.config.js Initial commit 2022-07-08 11:32:20 +03:00
LICENSE Initial commit 2022-07-08 11:32:20 +03:00
package-lock.json Change search regex to use <br> instead of \n 2022-07-10 18:58:50 +03:00
package.json Add backslash escaping 2022-08-01 09:08:18 +03:00
README.md Mention dingus in README 2022-08-01 12:40:07 +03:00
rollup.config.umd.js Add bundler 2022-07-08 23:51:13 +03:00

marked-mfm

a Marked.js custom extension for Misskey-flavored Markdown.

this is a reimplementation of the original MFM parser, which was written from the ground up using PEG.js instead of as an extension of CommonMark, and therefore was not up to spec. this extension is mostly compatible with the original, except it only implements $[tags]. mentions, hashtags and the search markup are out of scope.

usage

const marked = require('marked')
const markedMfm = require('marked-mfm')

marked.use(markedMfm)
marked.parse('$[x2 beeg text]')
// <p><span class="mfm _mfm_x2_" >beeg text</span></p>

there is also an interactive CLI:

$ npm run dingus
marked-mfm interactive parser
version 0.0.0
> $[x2 beeg text]
<p><span class="mfm _mfm_x2_" >beeg text</span></p>

you should use it to figure out whether a bug is with marked-mfm or with the frontend it's used on.

contributing

development discussion takes place on #mfm. contribute by sending pull requests, or patches to my public inbox.