An TFM parser implementation with TypeScript.
npm i tfm-js
Please see docs for the detail.
TypeScript:
import * as tfm from 'tfm-js';
const inputText =
`<center>
Hello $[tada everynyan! 🎉]
</center>`;
// Generate a MFM tree from the full MFM text.
const tfmTree = tfm.parse(inputText);
// Generate a MFM tree from the simple MFM text.
const simpleTfmTree = tfm.parseSimple('I like the hot soup :soup:');
// Reverse to a MFM text from the MFM tree.
const text = tfm.toString(tfmTree);
git clone https://github.com/tanukey-dev/tfm.js
cd tfm.js
npm i
npm run build
full parser:
npm run parse
simple parser:
npm run parse-simple
This software is released under the MIT License.