Skip to content

Conversation

Johennes
Copy link
Contributor

@Johennes Johennes commented Oct 8, 2025

This inlines the Olm and Megolm specs into Matrix spec as suggested in #1543. It does this by:

  • Adding a new top-level section
  • Defining \[ ... \] and \( ... \) as passthrough delimiters for block and inline math expressions
  • Calling transform.ToMath in a passthrough render hook to convert Latex to MathML with additional Katex styling
  • Bundling the https://github.com/KaTeX/KaTeX CSS and fonts with the spec to avoid loading external resources
  • Allowing unsafe-inline as style-src in CSP. This might be a deal breaker but I couldn't find another way around it so far. transform.ToMath will add a myriad of inline styles for vertical positioning without which many formulas are illegible.
  • Adding nohighlight as language on any untyped code block. This is necessary because Docsy itself will otherwise enable its own Katex integration which is not CSS-only.

Things to figure out:

Fixes: #1543

Pull Request Checklist

Preview: https://pr2226--matrix-spec-previews.netlify.app

@Johennes Johennes marked this pull request as ready for review October 13, 2025 11:47
@Johennes Johennes requested a review from a team as a code owner October 13, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Olm and Megolm should be specced in the actual spec

1 participant