An TFM parser implementation with TypeScript
npm install tfm-js
npm i tfm-js
`
Usage
Please see docs for the detail.
TypeScript:
`ts
import * as tfm from 'tfm-js';
const inputText =
;
// 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);
`
Develop
$3
`
git clone https://github.com/tanukey-dev/tfm.js
`
$3
`
cd tfm.js
npm i
`
$3
`
npm run build
`
$3
full parser:
`
npm run parse
`
simple parser:
`
npm run parse-simple
``