Run Prettier

This commit is contained in:
Penar Musaraj 2019-06-14 13:28:18 -04:00
parent 9810a98d21
commit 024ea27fb9
2 changed files with 13 additions and 5 deletions

View File

@ -3,7 +3,9 @@ import loadScript from "discourse/lib/load-script";
function ensureKaTeX() {
return loadScript("/plugins/discourse-math/katex/katex.min.js").then(() => {
return loadScript("/plugins/discourse-math/katex/katex.min.css", { css: true }).then(() => {
return loadScript("/plugins/discourse-math/katex/katex.min.css", {
css: true
}).then(() => {
return loadScript("/plugins/discourse-math/katex/mhchem.min.js");
});
});
@ -11,7 +13,7 @@ function ensureKaTeX() {
function decorate(elem) {
const $elem = $(elem);
const displayMode = elem.tagName === 'DIV';
const displayMode = elem.tagName === "DIV";
if ($elem.data("applied-katex")) {
return;
@ -20,7 +22,7 @@ function decorate(elem) {
if ($elem.hasClass("math")) {
const text = $elem.text();
$elem.text('');
$elem.text("");
window.katex.render(text, elem, { displayMode });
}
}
@ -49,7 +51,10 @@ export default {
name: "apply-math-katex",
initialize(container) {
const siteSettings = container.lookup("site-settings:main");
if (siteSettings.discourse_math_enabled && siteSettings.discourse_math_provider === 'katex') {
if (
siteSettings.discourse_math_enabled &&
siteSettings.discourse_math_provider === "katex"
) {
withPluginApi("0.5", function(api) {
initializeMath(api);
});

View File

@ -116,7 +116,10 @@ export default {
enable_accessibility: siteSettings.discourse_math_enable_accessibility,
enable_asciimath: siteSettings.discourse_math_enable_asciimath
};
if (siteSettings.discourse_math_enabled && siteSettings.discourse_math_provider === 'mathjax') {
if (
siteSettings.discourse_math_enabled &&
siteSettings.discourse_math_provider === "mathjax"
) {
withPluginApi("0.5", function(api) {
initializeMath(api, discourse_math_opts);
});