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
@richvdh richvdh changed the title Inline Olm & Megolm specifications Include Olm & Megolm specifications in main spec Oct 29, 2025
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, other than a few comments

@Johennes Johennes requested a review from richvdh October 29, 2025 14:02
Johennes and others added 4 commits October 30, 2025 15:43
Co-authored-by: Richard van der Hoff <[email protected]>
Co-authored-by: Richard van der Hoff <[email protected]>
Co-authored-by: Richard van der Hoff <[email protected]>
Co-authored-by: Richard van der Hoff <[email protected]>
@Johennes Johennes requested a review from richvdh October 30, 2025 14:50
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Johennes !

@richvdh richvdh merged commit 4cafe7d into matrix-org:main Oct 31, 2025
12 checks passed
richvdh added a commit that referenced this pull request Oct 31, 2025
Followup to #2226, which broke
the build. These links to the static CSS are broken in the case that the spec
is built for a subdirectory (such as `unstable`).
richvdh added a commit that referenced this pull request Oct 31, 2025
Followup to #2226, which broke
the build. These links to the static CSS are broken in the case that the spec
is built for a subdirectory (such as `unstable`).
richvdh added a commit that referenced this pull request Oct 31, 2025
Followup to #2226, which broke
the build. These links to the static CSS are broken in the case that the spec
is built for a subdirectory (such as `unstable`).
@Johennes
Copy link
Contributor Author

Thanks for the review! ❤️

I hadn't expected this to actually go anywhere initially.

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

2 participants