All Projects → misskey-dev → mfm.js

misskey-dev / mfm.js

Licence: MIT license
An MFM parser implementation

Programming Languages

typescript
32286 projects
PEG.js
56 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to mfm.js

Citrine
Kawaii Chatbot Plugin for BotBone
Stars: ✭ 17 (-29.17%)
Mutual labels:  misskey
Disboard
Collection of fediverse client libraries
Stars: ✭ 13 (-45.83%)
Mutual labels:  misskey
misskey
🌎 An interplanetary microblogging platform 🚀
Stars: ✭ 2,895 (+11962.5%)
Mutual labels:  misskey
MisskeyAndroidClient
MisskeyのAndroidクライアント「Milktea」のソースコード
Stars: ✭ 94 (+291.67%)
Mutual labels:  misskey
mulukhiya-toot-proxy
各種ActivityPub対応インスタンスへの投稿に対して、内容の更新等を行うプロキシ。通称「モロヘイヤ」。
Stars: ✭ 24 (+0%)
Mutual labels:  misskey
rpgdice
A generic RPG dice roller syntax and library.
Stars: ✭ 24 (+0%)
Mutual labels:  pegjs
MissCat
An Optimized Misskey Client App for iOS.
Stars: ✭ 44 (+83.33%)
Mutual labels:  misskey
Misskey.py
The Misskey API library for Python. Misskey is made by syuilo. 🐡( '-' 🐡 )hug punch!!!!
Stars: ✭ 49 (+104.17%)
Mutual labels:  misskey
peggy
Peggy: Parser generator for JavaScript
Stars: ✭ 444 (+1750%)
Mutual labels:  pegjs
latex-utensils
A LaTeX parser and utilities.
Stars: ✭ 33 (+37.5%)
Mutual labels:  pegjs
cherrypick
🌎 A interplanetary communication platform 🚀
Stars: ✭ 40 (+66.67%)
Mutual labels:  misskey
Misskey
🌎 An interplanetary microblogging platform 🚀
Stars: ✭ 2,244 (+9250%)
Mutual labels:  misskey
misskey-hub
Website for Misskey
Stars: ✭ 21 (-12.5%)
Mutual labels:  misskey
misskey-rs
✌️ Client library for Misskey 🥰
Stars: ✭ 24 (+0%)
Mutual labels:  misskey
MisskeyTools
Useful Tools for Professional Misskist
Stars: ✭ 16 (-33.33%)
Mutual labels:  misskey
WhatYouarePlaying
An extension delivering what you're watching and listening to, to Mastodon and other services
Stars: ✭ 15 (-37.5%)
Mutual labels:  misskey
TenCha
2009年のMisskeyクライアント
Stars: ✭ 15 (-37.5%)
Mutual labels:  misskey
Pegjs
PEG.js: Parser generator for JavaScript
Stars: ✭ 4,176 (+17300%)
Mutual labels:  pegjs
gpkeditor
markdown editor with peg.js
Stars: ✭ 15 (-37.5%)
Mutual labels:  pegjs
feel
Expression Language for creating and executing business rules in decision table based on DMN 1.1 specification for conformance level 3
Stars: ✭ 76 (+216.67%)
Mutual labels:  pegjs

mfm.js

An MFM parser implementation with PEG.js. Try it out!

Test codecov

NPM

Installation

npm i mfm-js

Usage

Please see docs for the detail.

TypeScript:

import * as mfm from 'mfm-js';

const inputText =
`<center>
Hello $[tada everynyan! 🎉]

I'm @ai, A bot of misskey!

https://github.com/syuilo/ai
</center>`;

// Generate a MFM tree from the full MFM text.
const mfmTree = mfm.parse(inputText);

// Generate a MFM tree from the simple MFM text.
const simpleMfmTree = mfm.parseSimple('I like the hot soup :soup:​');

// Reverse to a MFM text from the MFM tree.
const text = mfm.toString(mfmTree);

Develop

1. Clone

git clone https://github.com/misskey-dev/mfm.js.git

2. Install packages

cd mfm.js
npm i

3. Build

npm run build

Use the interactive CLI parser

full parser:

npm run parse

simple parser:

npm run parse-simple

License

This software is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].