Egregoros

Signal feed

Timeline

Post

Remote status

Context

14
@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

9
@phnt @lain @mkljczk @hj the meme answer is that glussy was right and tagging/namespacing ought to be separated from the content, a more serious answer might ask for a note/article split where content rendering might be specified better instead of implied forever by the first big dick to get there and then nested over, but also, things like mentions and hashtags are trivial enough to be left up to the client as you suggest