Commit graph

7 commits

Author SHA1 Message Date
ilja
418068793f Make parser FEP-c16b compliant
This is basically a rewrite of big parts of the parser, introducing a lot of breaking
changes.

The parser was originally written mostly as an exercise for myself and not really aimed
as-is for practical usage. An adapted version has been used in Akkoma, however, and
this pointed out serious flaws in how MFM was done in general on the fediverse. This
was discussed [on the Foundkey issue
tracker](FoundKeyGang/FoundKey#343) and a better way was
decided. At the time of writing, this is being formalised into
[FEP-c16b](https://codeberg.org/fediverse/fep/src/branch/main/fep/c16b/fep-c16b.md).
This commit rewrites this parser to be FEP-c16b compliant.

Previously, the parser had knowledge of the specific MFM functions. This was useful for
setting default attribute values and adding specific CSS. This is not the case any
more. The parser has no knowledge of specific MFM functions any more. It also had an
understanding of the concept of newlines, this isn't the case any more either. It only
does a "simple" translation from MFM function notation to FEP-c16b compliant HTML.

Because of this, we also don't add CSS any more. It's up to the software who uses this
HTML to decide what functions they want to provide and use the correct CSS. In practice
the CSS from this parser was never used in Akkoma, so it's not really a loss.
2024-08-10 20:13:48 +02:00
ilja
a5faf98ecd Revert "don't append styles"
This reverts commit 5e8723e54b.
2024-08-10 19:55:14 +02:00
5e8723e54b don't append styles 2022-08-18 02:40:10 +01:00
Ilja
1bf36d1f52 Code review part 3
* <https://ilja.space/notice/ALpd6nux5hT2nsfetM>
    * Previous commit: `|> fill_props(token) after the cond` in the parser
    * Previous commit: Don't use intention-specific data in the tokens (e.g. left is reverse, x is mfm-spinX)
* <https://ilja.space/notice/ALpcK6W59UjkIUofU8>
    * This commit: Use less files
* Previous commit: Change nested if-statement in mfm.ex to `cond do`

I also added some more and better info to the README.md and moduledocs.
2022-07-25 14:13:43 +02:00
Ilja
ed970aa77d Move Encoder logic to own module 2022-07-25 00:44:45 +02:00
Ilja
d9ffd99e4d Convert a tree to HTML + formatting + docs 2022-07-24 16:32:57 +02:00
Ilja
cf49876a47 First commit
Initialise repository
2022-07-23 16:51:13 +02:00