Addressed mr observations
This commit is contained in:
parent
c833a09d91
commit
954bfb5db5
4 changed files with 12 additions and 19 deletions
|
@ -28,13 +28,10 @@ function renderWithKaTeX(elements, katex) {
|
|||
|
||||
export default function renderMath($els) {
|
||||
if (!$els.length) return;
|
||||
import(/* webpackChunkName: 'katex' */ 'katex').then((katex) => {
|
||||
import(/* webpackChunkName: 'katex' */ 'katex/dist/katex.css')
|
||||
.then(() => {
|
||||
renderWithKaTeX($els, katex);
|
||||
})
|
||||
.catch((err) => {
|
||||
flash(`Can't load katex css ${err}`);
|
||||
});
|
||||
Promise.all([
|
||||
import(/* webpackChunkName: 'katex' */ 'katex'),
|
||||
import(/* webpackChunkName: 'katex' */ 'katex/dist/katex.css'),
|
||||
]).then(([katex]) => {
|
||||
renderWithKaTeX($els, katex);
|
||||
}).catch(() => flash(__('An error occurred while rendering KaTeX')));
|
||||
}
|
||||
|
|
|
@ -156,7 +156,6 @@ var config = {
|
|||
{
|
||||
test: /katex.css$/,
|
||||
include: /node_modules\/katex\/dist/,
|
||||
exclude: /(vendor\/assets)/,
|
||||
use: [
|
||||
{ loader: 'style-loader' },
|
||||
{
|
||||
|
@ -170,7 +169,6 @@ var config = {
|
|||
{
|
||||
test: /\.(eot|ttf|woff|woff2)$/,
|
||||
include: /node_modules\/katex\/dist\/fonts/,
|
||||
exclude: /(vendor\/assets)/,
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[hash].[ext]',
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"js-cookie": "^2.1.3",
|
||||
"jszip": "^3.1.3",
|
||||
"jszip-utils": "^0.0.2",
|
||||
"katex": "^0.9.0-alpha2",
|
||||
"katex": "^0.8.3",
|
||||
"marked": "^0.3.12",
|
||||
"monaco-editor": "0.10.0",
|
||||
"mousetrap": "^1.4.6",
|
||||
|
|
14
yarn.lock
14
yarn.lock
|
@ -4401,11 +4401,11 @@ karma@^2.0.0:
|
|||
tmp "0.0.33"
|
||||
useragent "^2.1.12"
|
||||
|
||||
katex@^0.9.0-alpha2:
|
||||
version "0.9.0-alpha2"
|
||||
resolved "https://registry.yarnpkg.com/katex/-/katex-0.9.0-alpha2.tgz#f559e8bb32969082d735d949960b7df133fd5831"
|
||||
katex@^0.8.3:
|
||||
version "0.8.3"
|
||||
resolved "https://registry.yarnpkg.com/katex/-/katex-0.8.3.tgz#909d99864baf964c3ccae39c4a99a8e0fb9a1bd0"
|
||||
dependencies:
|
||||
match-at "^0.1.1"
|
||||
match-at "^0.1.0"
|
||||
|
||||
kind-of@^3.0.2:
|
||||
version "3.1.0"
|
||||
|
@ -4797,7 +4797,7 @@ marked@^0.3.12:
|
|||
version "0.3.12"
|
||||
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.12.tgz#7cf25ff2252632f3fe2406bde258e94eee927519"
|
||||
|
||||
match-at@^0.1.1:
|
||||
match-at@^0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/match-at/-/match-at-0.1.1.tgz#25d040d291777704d5e6556bbb79230ec2de0540"
|
||||
|
||||
|
@ -7093,20 +7093,18 @@ strip-json-comments@~2.0.1:
|
|||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
|
||||
|
||||
<<<<<<< HEAD
|
||||
style-loader@^0.19.1:
|
||||
version "0.19.1"
|
||||
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.19.1.tgz#591ffc80bcefe268b77c5d9ebc0505d772619f85"
|
||||
dependencies:
|
||||
loader-utils "^1.0.2"
|
||||
schema-utils "^0.3.0"
|
||||
=======
|
||||
|
||||
subarg@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2"
|
||||
dependencies:
|
||||
minimist "^1.1.0"
|
||||
>>>>>>> master
|
||||
|
||||
supports-color@^2.0.0:
|
||||
version "2.0.0"
|
||||
|
|
Loading…
Reference in a new issue