Skip to content

Commit

Permalink
webview: remove KaTeX js file
Browse files Browse the repository at this point in the history
Although the installation directions just say to include
katex.[min.]js unconditionally, the KaTeX JavaScript isn't actually
needed just to display existing KaTeX blocks -- only to render new
ones.

Which is good, because that's ~242K of (uncompressed) JS code that we
can do without.
  • Loading branch information
rk-for-zulip committed Nov 15, 2019
1 parent 6487e68 commit 522ece8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion src/webview/css/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const katexFraclineHackStyle = `<style id="katex-frac-line-hack">
export default (theme: ThemeName) => `
<link rel='stylesheet' type='text/css' href='./base.css'>
<link rel='stylesheet' type='text/css' href='./katex/katex.min.css'>
<script defer src="./katex/katex.min.js"></script>
<style>
${theme === 'night' ? cssNight : ''}
${cssPygments(theme === 'night')}
Expand Down
3 changes: 1 addition & 2 deletions tools/build-webview.d/katex.all.pre
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ readonly _dest="${STAGING}/katex"
readonly _katex_font_type=woff2

z_rsync "${_src}/" "${_dest}" <<EOF
# Include these two files.
# Include the KaTeX CSS.
+/ katex.min.css
+/ katex.min.js
# Include the fonts/ directory, and specifically those files within it
# with the right extension.
Expand Down

0 comments on commit 522ece8

Please sign in to comment.