Commit 954bfb5d authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Addressed mr observations

parent c833a09d
...@@ -28,13 +28,10 @@ function renderWithKaTeX(elements, katex) { ...@@ -28,13 +28,10 @@ function renderWithKaTeX(elements, katex) {
export default function renderMath($els) { export default function renderMath($els) {
if (!$els.length) return; if (!$els.length) return;
import(/* webpackChunkName: 'katex' */ 'katex').then((katex) => { Promise.all([
import(/* webpackChunkName: 'katex' */ 'katex/dist/katex.css') import(/* webpackChunkName: 'katex' */ 'katex'),
.then(() => { import(/* webpackChunkName: 'katex' */ 'katex/dist/katex.css'),
renderWithKaTeX($els, katex); ]).then(([katex]) => {
}) renderWithKaTeX($els, katex);
.catch((err) => {
flash(`Can't load katex css ${err}`);
});
}).catch(() => flash(__('An error occurred while rendering KaTeX'))); }).catch(() => flash(__('An error occurred while rendering KaTeX')));
} }
...@@ -156,7 +156,6 @@ var config = { ...@@ -156,7 +156,6 @@ var config = {
{ {
test: /katex.css$/, test: /katex.css$/,
include: /node_modules\/katex\/dist/, include: /node_modules\/katex\/dist/,
exclude: /(vendor\/assets)/,
use: [ use: [
{ loader: 'style-loader' }, { loader: 'style-loader' },
{ {
...@@ -170,7 +169,6 @@ var config = { ...@@ -170,7 +169,6 @@ var config = {
{ {
test: /\.(eot|ttf|woff|woff2)$/, test: /\.(eot|ttf|woff|woff2)$/,
include: /node_modules\/katex\/dist\/fonts/, include: /node_modules\/katex\/dist\/fonts/,
exclude: /(vendor\/assets)/,
loader: 'file-loader', loader: 'file-loader',
options: { options: {
name: '[name].[hash].[ext]', name: '[name].[hash].[ext]',
......
...@@ -4401,11 +4401,11 @@ karma@^2.0.0: ...@@ -4401,11 +4401,11 @@ karma@^2.0.0:
tmp "0.0.33" tmp "0.0.33"
useragent "^2.1.12" useragent "^2.1.12"
katex@^0.9.0-alpha2: katex@^0.8.3:
version "0.9.0-alpha2" version "0.8.3"
resolved "https://registry.yarnpkg.com/katex/-/katex-0.9.0-alpha2.tgz#f559e8bb32969082d735d949960b7df133fd5831" resolved "https://registry.yarnpkg.com/katex/-/katex-0.8.3.tgz#909d99864baf964c3ccae39c4a99a8e0fb9a1bd0"
dependencies: dependencies:
match-at "^0.1.1" match-at "^0.1.0"
kind-of@^3.0.2: kind-of@^3.0.2:
version "3.1.0" version "3.1.0"
...@@ -4797,7 +4797,7 @@ marked@^0.3.12: ...@@ -4797,7 +4797,7 @@ marked@^0.3.12:
version "0.3.12" version "0.3.12"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.12.tgz#7cf25ff2252632f3fe2406bde258e94eee927519" 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" version "0.1.1"
resolved "https://registry.yarnpkg.com/match-at/-/match-at-0.1.1.tgz#25d040d291777704d5e6556bbb79230ec2de0540" resolved "https://registry.yarnpkg.com/match-at/-/match-at-0.1.1.tgz#25d040d291777704d5e6556bbb79230ec2de0540"
...@@ -7093,20 +7093,18 @@ strip-json-comments@~2.0.1: ...@@ -7093,20 +7093,18 @@ strip-json-comments@~2.0.1:
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
<<<<<<< HEAD
style-loader@^0.19.1: style-loader@^0.19.1:
version "0.19.1" version "0.19.1"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.19.1.tgz#591ffc80bcefe268b77c5d9ebc0505d772619f85" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.19.1.tgz#591ffc80bcefe268b77c5d9ebc0505d772619f85"
dependencies: dependencies:
loader-utils "^1.0.2" loader-utils "^1.0.2"
schema-utils "^0.3.0" schema-utils "^0.3.0"
=======
subarg@^1.0.0: subarg@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2"
dependencies: dependencies:
minimist "^1.1.0" minimist "^1.1.0"
>>>>>>> master
supports-color@^2.0.0: supports-color@^2.0.0:
version "2.0.0" version "2.0.0"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment