Egregoros

Signal feed

Timeline

Post

Remote status

Context

16

@hj The top bar changes are crimes against frontend design. Settings profiles are interesting though. And MFM is something I would want to do some time, but it requires writing a proper parser like BBCode, the Akkoma one is a hack.

@hj You don't need a permission I think. And it is just HTML with funky span tag classes. The MFM syntax is "$[directive1=value,directive2=value,... Post Content]". Here's a FEP that Akkoma implements.

There are two parts for this, the BE pre-processing parser that takes input when post has MFM enabled and generates a string with the MFM tags replaced with the HTML representation that is then sent to either another parser (like BBCode) or straight through. The second part is FE that provides the styling for the HTML.

For the BE parser, Nimble Parsec used by BBCode is pretty comfy at least to me, Akkoma implements their own lexer and everything.

You could implement it fully in FE, but then other frontends like Nicolium wouldn't be able to make use of it easily.
@hj @lain @mkljczk It is a disaster waiting to happen, yes. When it is done on the backend, it's not as bad as the content is still sanitized on the backend.

The backend could also parse it in stages so "$[jelly.speed=2s idk] [i]italics[/i] the rest", would first be:
<span class="mfm-jelly" data-mfm-jelly="2s">idk</span> [i]italics[/i] the rest
and then:
<span class="mfm-jelly" data-mfm-jelly="2s">idk</span> <i>italics</i> the rest

Replies

3