From 1c771a89c4f9dc0f0e58b0a11558e12a74853aa6 Mon Sep 17 00:00:00 2001 From: Ray Kraesig Date: Thu, 14 Nov 2019 14:27:02 -0800 Subject: [PATCH] webview: Add LaTeX math support! This incorporates the same KaTeX library we use in the Zulip webapp. We add the dependency, add a build-webview step to copy the needed files, and apply the stylesheet in our WebView HTML. There are a couple of cases where the resulting HTML and CSS doesn't quite look right. We'll go on to take care of those in upcoming commits. [greg: adapted to this build-webview structure] Fixes: #2660 --- package.json | 1 + src/webview/css/css.js | 1 + tools/build-webview | 21 ++++++++++++++++++++- yarn.lock | 7 +++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e6b427dbf88..d02124d35f1 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "blueimp-md5": "^2.10.0", "color": "^3.0.0", "date-fns": "^1.29.0", + "katex": "^0.11.1", "lodash.escape": "^4.0.1", "lodash.isequal": "^4.4.0", "lodash.omit": "^4.5.0", diff --git a/src/webview/css/css.js b/src/webview/css/css.js index 2bed42de1f2..0440b418140 100644 --- a/src/webview/css/css.js +++ b/src/webview/css/css.js @@ -6,6 +6,7 @@ import cssNight from './cssNight'; export default (theme: ThemeName) => ` +