Files
xiaomakuaiz 980600235d feat(mobile): render math formulas in AI replies
Tokenize $...$, $$...$$, \(...\) and \[...\] via a markdown-it plugin
(delimiter semantics aligned with desktop), render TeX to SVG with a
lazily-loaded MathJax pipeline (LRU-cached, budget-guarded) and draw it
natively through react-native-svg; inline math flows with text baseline,
block math centers and scrolls horizontally. Falls back to source text
until MathJax is ready or when conversion fails.
2026-08-28 23:36:48 +08:00

18 lines
524 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
// Reanimated 4:worklets 插件已从 reanimated 拆出,需放在插件列表最后
'react-native-worklets/plugin',
],
env: {
// jest 的 node 环境不认原生 import()(math.ts 懒加载 MathJax 用),
// 仅测试时降级成 CJS;Metro 打包不走这个分支。
test: {
plugins: ['@babel/plugin-transform-dynamic-import'],
},
},
};
};