zulip / zulip-flutter

Upcoming Zulip mobile apps for Android and iOS, using Flutter
Apache License 2.0
200 stars 193 forks source link

Handle old forms of HTML for math/TeX #1004

Open gnprice opened 1 month ago

gnprice commented 1 month ago

When a Zulip message's content contains math expressed in TeX / LaTeX, we parse that far enough to show something useful; that was #359.

It looks like our parsing doesn't currently handle the way that Zulip arranged these HTML elements a few years ago, though. The #917 / #190 survey of content features not yet implemented in this app found several kinds of KaTeX-related elements that we don't currently parse; the latest example was this message from 2022-03-30, just after the server-5 release.

The relevant summary output from the #917 script looks like:

(That <p> description doesn't look so specific; but all 10 of its most recent examples begin with <p><span class="katex-display">.)

The full list of affected message IDs in the public history of chat.zulip.org is:

To resolve this issue, we'll want to look at those messages and identify how they differ from what we currently parse, and then adjust the parsing to cover them.

The main part of the work in fixing this will be verifying that the fix is correct. That means

This is a low-priority issue because I believe current versions of the Zulip server don't generate these elements for new messages, and haven't done so for a couple of years.

Related issues

When we eventually handle #46, we'll want it to cover these old-style messages too. But in the meantime we just want them to be covered by the UI we added in #359.