WIP: FEP-dc88: Formatting Mathematics #642
No reviewers
Labels
No Label
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#642
Loading…
Reference in New Issue
No description provided.
Delete Branch "pounce/akkoma:formatting-mathematics"
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 #641
This PR does everything it's supposed to for the first half of that issue, but it is ugly and useless
Ugly
This PR changes the default HTML sanitizer to optionally allow MathML core tags. Unfortunately, the
FastSanitize
library is a mess. As it's all comprised of macros around partial function definitions, it's not possible to use very much abstraction (such asfor
comprehensions or variable definitions) to help define a sanitizer, which leads to very ugly code.This isn't the worst of it.
FastHTML
uses atoms to represent 'known tags' (I've done some digging, and it's basically anything in this list: https://github.com/lexbor/lexbor/blob/master/source/lexbor/tag/const.h). About half of the math tags are 'known', and there appears to be no rhyme or reason to which are known and which aren't (annotation
is not known,annotation-xml
is known). So we have to define half the tags using binaries and the other half using atoms.Useless
If you create a post with MathML core tags... it won't show up! This is due to a bug in VueJS which affects the pleroma frontend. Basically, elements are added to the DOM with the wrong namespace, and won't be rendered correctly unless the math DOM nodes are all refreshed. Bad stuff.
Here's a MathML post in pleroma-fe:
and how it is supposed to look, in mastodon-fe:
Good news, the Vue bug appears to have been fixed a few week s ago: vuejs/core@d42b6ba3 and this fix is part of release 3.4.0+
I wonder, is the front-end the only thing blocking this? As I understand, it does work with other front-ends like masto-fe, so I wonder if we should really wait until front-end is fixed. People generally install Akkoma-fe, but as I understand the idea is that Akkoma doesn't force/push one specific front-end.
Btw, re
I’m not too familiar with Elixir’s macro stuff, but some examples I’ve seen seem to suggest using regular
for
is at least sometimes capable of looping over macros and the below at least compiles (with math enabled) fine for me. Is there going something wrong during runtime later? (might want to add some basic tests)Yes agree. I'll rebase this soon to get it ready to merge