/*! * bespoke-math v1.4.0 * * Copyright 2021, Flávio * This content is released under the MIT license * */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g=(g.bespoke||(g.bespoke = {}));g=(g.plugins||(g.plugins = {}));g.math = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 0 ? inlineMathSelector : '.math' return function(deck) { let foundMath = false let mathElements switch (inlineVsDisplayLogic) { case 'separateSelector': mathElements = deck.parent.querySelectorAll(inlineMathSelector) Array.from(mathElements).forEach(el => { el.innerHTML = renderKatexFormula(el.innerHTML, false) foundMath = true }) mathElements = deck.parent.querySelectorAll(displayMathSelector) Array.from(mathElements).forEach(el => { el.innerHTML = renderKatexFormula(el.innerHTML, true) foundMath = true }) break case 'spanIsInline': mathElements = deck.parent.querySelectorAll(inlineMathSelector) Array.from(mathElements).forEach(el => { el.innerHTML = renderKatexFormula( el.textContent, el.tagName.toLowerCase() !== 'span' ) foundMath = true }) break } if (foundMath) { try { require('katex/dist/katex.min.css') } catch (e) { console.log( 'It was not possible to load the CSS from KaTeX. Details: ' + e ) } } } } },{"katex":3,"katex/dist/katex.min.css":4}],2:[function(require,module,exports){ 'use strict'; // For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field. var styleElementsInsertedAtTop = []; var insertStyleElement = function(styleElement, options) { var head = document.head || document.getElementsByTagName('head')[0]; var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1]; options = options || {}; options.insertAt = options.insertAt || 'bottom'; if (options.insertAt === 'top') { if (!lastStyleElementInsertedAtTop) { head.insertBefore(styleElement, head.firstChild); } else if (lastStyleElementInsertedAtTop.nextSibling) { head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling); } else { head.appendChild(styleElement); } styleElementsInsertedAtTop.push(styleElement); } else if (options.insertAt === 'bottom') { head.appendChild(styleElement); } else { throw new Error('Invalid value for parameter \'insertAt\'. Must be \'top\' or \'bottom\'.'); } }; module.exports = { // Create a tag with optional data attributes createLink: function(href, attributes) { var head = document.head || document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.href = href; link.rel = 'stylesheet'; for (var key in attributes) { if ( ! attributes.hasOwnProperty(key)) { continue; } var value = attributes[key]; link.setAttribute('data-' + key, value); } head.appendChild(link); }, // Create a