Skip to content

Commit 16348dd

Browse files
authored
feat(android): render LaTeX display math in chat via bundled KaTeX (#101435)
* feat(android): render LaTeX display math in chat via bundled KaTeX * fix(android): preserve fallback for invalid math * docs(changelog): note Android display math * Revert "docs(changelog): note Android display math" This reverts commit 4035628.
1 parent 454fccd commit 16348dd

34 files changed

Lines changed: 1406 additions & 10 deletions

β€Žapps/.i18n/native-source.jsonβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5851,15 +5851,15 @@
58515851
},
58525852
{
58535853
"kind": "ui-named-argument",
5854-
"line": 315,
5854+
"line": 326,
58555855
"path": "apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMarkdown.kt",
58565856
"source": "$index.",
58575857
"surface": "android",
58585858
"id": "native.android.cd2033b0a82a72dd"
58595859
},
58605860
{
58615861
"kind": "ui-named-argument",
5862-
"line": 718,
5862+
"line": 729,
58635863
"path": "apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMarkdown.kt",
58645864
"source": "Image unavailable",
58655865
"surface": "android",
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
KaTeX is licensed under the MIT License. KaTeX bundles fonts under the SIL Open Font License.
2+
3+
The MIT License (MIT)
4+
5+
Copyright (c) 2013-2020 Khan Academy and other contributors
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
25+
-----------------------------------------------------------
26+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
27+
-----------------------------------------------------------
28+
29+
PREAMBLE
30+
The goals of the Open Font License (OFL) are to stimulate worldwide
31+
development of collaborative font projects, to support the font creation
32+
efforts of academic and linguistic communities, and to provide a free and
33+
open framework in which fonts may be shared and improved in partnership
34+
with others.
35+
36+
The OFL allows the licensed fonts to be used, studied, modified and
37+
redistributed freely as long as they are not sold by themselves. The
38+
fonts, including any derivative works, can be bundled, embedded,
39+
redistributed and/or sold with any software provided that any reserved
40+
names are not used by derivative works. The fonts and derivatives,
41+
however, cannot be released under any other type of license. The
42+
requirement for fonts to remain under this license does not apply
43+
to any document created using the fonts or their derivatives.
44+
45+
DEFINITIONS
46+
"Font Software" refers to the set of files released by the Copyright
47+
Holder(s) under this license and clearly marked as such. This may
48+
include source files, build scripts and documentation.
49+
50+
"Reserved Font Name" refers to any names specified as such after the
51+
copyright statement(s).
52+
53+
"Original Version" refers to the collection of Font Software components as
54+
distributed by the Copyright Holder(s).
55+
56+
"Modified Version" refers to any derivative made by adding to, deleting,
57+
or substituting -- in part or in whole -- any of the components of the
58+
Original Version, by changing formats or by porting the Font Software to a
59+
new environment.
60+
61+
"Author" refers to any designer, engineer, programmer, technical
62+
writer or other person who contributed to the Font Software.
63+
64+
PERMISSION & CONDITIONS
65+
Permission is hereby granted, free of charge, to any person obtaining
66+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
67+
redistribute, and sell modified and unmodified copies of the Font
68+
Software, subject to the following conditions:
69+
70+
1) Neither the Font Software nor any of its individual components,
71+
in Original or Modified Versions, may be sold by itself.
72+
73+
2) Original or Modified Versions of the Font Software may be bundled,
74+
redistributed and/or sold with any software, provided that each copy
75+
contains the above copyright notice and this license. These can be
76+
included either as stand-alone text files, human-readable headers or
77+
in the appropriate machine-readable metadata fields within text or
78+
binary files as long as those fields can be easily viewed by the user.
79+
80+
3) No Modified Version of the Font Software may use the Reserved Font
81+
Name(s) unless explicit written permission is granted by the corresponding
82+
Copyright Holder. This restriction only applies to the primary font name as
83+
presented to the users.
84+
85+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
86+
Software shall not be used to promote, endorse or advertise any
87+
Modified Version, except to acknowledge the contribution(s) of the
88+
Copyright Holder(s) and the Author(s) or with their explicit written
89+
permission.
90+
91+
5) The Font Software, modified or unmodified, in part or in whole,
92+
must be distributed entirely under this license, and must not be
93+
distributed under any other license. The requirement for fonts to
94+
remain under this license does not apply to any document created using
95+
the Font Software.
96+
97+
TERMINATION
98+
This license becomes null and void if any of the above conditions are
99+
not met.
100+
101+
DISCLAIMER
102+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
103+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
104+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
105+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
106+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
107+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
108+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
109+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
110+
OTHER DEALINGS IN THE FONT SOFTWARE.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# KaTeX Android assets
2+
3+
- Version: KaTeX 0.17.0 (`v0.17.0`, released 2026-05-22)
4+
- Source: https://github.com/KaTeX/KaTeX/releases/tag/v0.17.0
5+
- Release archive: https://github.com/KaTeX/KaTeX/releases/download/v0.17.0/katex.tar.gz
6+
- Published and verified archive SHA-256: `f77cf2555a40e879a4784e43e229d41867f106125bc05b15161de3e761b64b88`
7+
8+
Only the minified runtime, its stylesheet, and the WOFF2 fonts referenced by that stylesheet are copied from the release archive. `index.html` and `renderer.js` are OpenClaw's local rendering shell. No auto-render extension, mhchem extension, source map, WOFF, or TTF file is bundled.
9+
10+
## SHA-256
11+
12+
```text
13+
0cdd387c9590a1a9f9794560022dbb59654a7d86f187aa0c81495ad42d3a7308 fonts/KaTeX_AMS-Regular.woff2
14+
de7701e42cf1f4cf0b766c03fb27977207eee2f4fd5d76fa82188406da43ea4c fonts/KaTeX_Caligraphic-Bold.woff2
15+
5d53e70ad607c2352162dec9e0923fb54ecdafaccbf604cd8dcf7d00facb989b fonts/KaTeX_Caligraphic-Regular.woff2
16+
74444efd593c005e3f4573b44524704c0af0a937fe911cca9e94068d0d140d3f fonts/KaTeX_Fraktur-Bold.woff2
17+
51814d270d06ff0255dba0799994fa4d8c84d11f09951d47595f4abb1f3602dc fonts/KaTeX_Fraktur-Regular.woff2
18+
0f60d1b897938ec918c8ce073092411baf9438f6739465693ff18b0f9d20b021 fonts/KaTeX_Main-Bold.woff2
19+
99cd42a3c072d918f2f44984a807cf7aa16e13545fd0875fc07c6c65f99e715b fonts/KaTeX_Main-BoldItalic.woff2
20+
97479ca6cce906abc961ecac96faa5f9ca2e61b8e7670d475826bcdee9a7c267 fonts/KaTeX_Main-Italic.woff2
21+
c2342cd8b869e01752a9321dc17213fc40d4d04c79688c1d43f2cf316abd7866 fonts/KaTeX_Main-Regular.woff2
22+
dc47344dbb6cb5b655c8460d561f4df5f501b90c804ad3c6cec65fe322351ab1 fonts/KaTeX_Math-BoldItalic.woff2
23+
7af58c5ec8f132a2ddde9027c6d7814decce4d3b822a11192a42a20e2e973264 fonts/KaTeX_Math-Italic.woff2
24+
e99ae51144bf1232efcc1bfe5add36262c6866b0faab24fa75740e1b98577a62 fonts/KaTeX_SansSerif-Bold.woff2
25+
00b26ac825e2095056396e0553b8ac26d3f8ad158c3826e28b4c45b385c4714a fonts/KaTeX_SansSerif-Italic.woff2
26+
68e8c73ef42afd3ccec58bf0fba302cce448938e7fc020a5e31f8a952eee1342 fonts/KaTeX_SansSerif-Regular.woff2
27+
036d4e95149b69ff9bcc0cd55771efeb25ffa3947293e69acd78d5ac328c684b fonts/KaTeX_Script-Regular.woff2
28+
6b47c40166b6dbe21a5dfca7718413f2147fd2399be1ba605d8ad39cedf25dfe fonts/KaTeX_Size1-Regular.woff2
29+
d04c54219f9eaec6d4d4fd42dfb28785975a4794d6b2fc71e566b9cd6db842dd fonts/KaTeX_Size2-Regular.woff2
30+
73d591271b1604960cb10bb90fee021670af7297017e0e98480b332d11f51995 fonts/KaTeX_Size3-Regular.woff2
31+
a4af7d414440a1c1790825cfb700cf9cf43b0f2c4b04f0ebc523011ad9853ec0 fonts/KaTeX_Size4-Regular.woff2
32+
71d517d67827787cfabdf186914cc3358eda539e37931941f2b2fd4a21f68c0b fonts/KaTeX_Typewriter-Regular.woff2
33+
e73bea6d899a3f89595d37f5713cb5ddabc4084fc428a5931782628ee14799e2 index.html
34+
a34ad8fc188e8f5a3af7ceaa2a58d7210c6c9171335a15bff2b48ebcd6a6f5b0 katex.min.css
35+
45fbe318fea878fdc0a111913dc1f87894b2c439360d0228c086ef313f213efc katex.min.js
36+
3cefe6fba565e189311b29265eb842484a637e1a80b0b5e766ab05bfc9ad452f renderer.js
37+
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
Β (0)