defmodule MfmParser do @moduledoc """ `MfmParser` is a parser for [Misskey Flavoured Markdown](https://mk.nixnet.social/mfm-cheat-sheet). It can parse MFM and return a tree. It can also turn a tree into HTML. It only works for the MFM specific tags of the form $[name.opts content]. Other parts of MFM (html, Markdown and [KaTeX](https://katex.org/)) are out of scope here. ## Examples iex> MfmParser.Parser.parse("$[twitch.speed=5s 🍮]") {:ok, [ %{ content: [%{content: "🍮", type: "text"}], name: "twitch.speed=5s", type: "mfm" } ] } iex> MfmParser.Parser.parse("$[twitch.speed=5s 🍮]") |> MfmParser.Converter.to_html() "🍮" """ end