Use FEP-c16b: Formatting MFM functions #823
No reviewers
Labels
No labels
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#823
Loading…
Reference in a new issue
No description provided.
Delete branch "ilja/akkoma:use_fep-c16b_formatting_mfm_functions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See https://akkoma.dev/AkkomaGang/akkoma/issues/381
We can't use the HTML content as-is. FEP-c16b was written to have a "scrubber friendly" way of representing MFM functions in HTML. Here we add support in the backend for the functions Foundkey supports.
This currently uses the parser from https://codeberg.org/ilja/mfm_parser/ but can be changed to the one under the Akkoma namespace once AkkomaGang/mfm-parser#2 is merged.
Caveats:
htmlMfm
term, and use thecontent
when that term is provided on incoming federation). This PR is already a strict improvement over the current situation, so it makes sense to me to keep this PR smaller and do the discovery in a separate PR.Broader scope where this PR is part of:
Extra:
I fixed the earmark version to 1.4.46 bc there's apparently a bug in 1.4.47 (which I first pulled in). See my comment #823 (comment)
5fd6771bc6
tof6422cb370
WIP: Use FEP-c16b: Formatting MFM functionsto Use FEP-c16b: Formatting MFM functionsI notice mix.lock also changed a bunch of stuff. I'm not used to changing dependencies, so I'm unsure if that's OK or what I should do with that?
I was even wondering why this is not ignored, since it's rebuild anyhow, but apparently the good practice is to keep it https://elixirforum.com/t/should-mix-lock-be-part-of-the-public-repository-and-package/45203
Use FEP-c16b: Formatting MFM functionsto WIP: Use FEP-c16b: Formatting MFM functionsEDIT: Yes, it worked by downgrading earmark back to 1.4.46. There's an open issue for it https://github.com/pragdave/earmark/issues/361
You can ignore the below text 🤐
I put it in WIP again bc I just realised I forgot to run the test. One is failing bc the MFM markup changed, I already fixed that one locally. But the other one seems a problem with Earmark... Maybe bc I drew in a newer version than what the CI previously had? I'll see if I can figure it out.
Afaict, Earmark removes everything before the comment (
Formatter.markdown_to_html()
). Then the comment (I assume correctly) gets removed later withFormatter.html_escape("text/html")
.This is the failure
Here is the code responsible for this
WIP: Use FEP-c16b: Formatting MFM functionsto Use FEP-c16b: Formatting MFM functionsyeah that's fine that's just mix updating stuff it's fine
this looks very cool, i'll test it out a bit~
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.