Newer
Older
An MFM parser implementation with PEG.js.
[Try it out!](https://runkit.com/npm/mfm-js)
[](https://github.com/misskey-dev/mfm.js/actions/workflows/test.yml)
[](https://codecov.io/gh/misskey-dev/mfm.js)
[](https://www.npmjs.com/package/mfm-js)
Please see [docs](./docs/index.md) for the detail.
// Generate a MFM tree from the MFM text.
const mfmTree = mfm.parse(inputText);
// Generate a MFM tree from the MFM plain text.
const plainMfmTree = mfm.parsePlain('I like the hot soup :soup:');
// Reverse to a MFM text from the MFM tree.
const text = mfm.toString(mfmTree);
This software is released under the [MIT License](LICENSE).