jekyll-theme-hydejack 8.2.0 → 8.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/body/footer.html +4 -3
  3. data/_includes/body/nav.html +33 -16
  4. data/_includes/head/links.html +9 -7
  5. data/_includes/head/meta.html +1 -1
  6. data/_includes/head/page-style.html +3 -54
  7. data/_includes/head/styles.html +4 -2
  8. data/_includes/header.txt +1 -1
  9. data/_includes/scripts.html +33 -0
  10. data/_includes/styles/inline.scss +6 -0
  11. data/_includes/styles/page-style.scss +61 -0
  12. data/_includes/styles/style.scss +6 -0
  13. data/_layouts/compress.html +1 -1
  14. data/_sass/hydejack/__link__/_katex.scss +7 -3
  15. data/_sass/hydejack/_katex.pre.scss +7 -3
  16. data/assets/bower_components/katex/.bower.json +11 -10
  17. data/assets/bower_components/katex/LICENSE +21 -0
  18. data/assets/bower_components/katex/bower.json +6 -5
  19. data/assets/bower_components/katex/dist/README.md +90 -0
  20. data/assets/bower_components/katex/dist/contrib/auto-render.js +215 -670
  21. data/assets/bower_components/katex/dist/contrib/auto-render.min.js +1 -1
  22. data/assets/bower_components/katex/dist/contrib/copy-tex.css +3 -1
  23. data/assets/bower_components/katex/dist/contrib/copy-tex.js +118 -84
  24. data/assets/bower_components/katex/dist/contrib/copy-tex.min.css +1 -1
  25. data/assets/bower_components/katex/dist/contrib/copy-tex.min.js +1 -1
  26. data/assets/bower_components/katex/dist/contrib/mathtex-script-type.js +53 -29
  27. data/assets/bower_components/katex/dist/contrib/mathtex-script-type.min.js +1 -1
  28. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  29. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  30. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  31. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  32. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  33. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  34. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  35. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  36. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  37. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  38. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  39. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  40. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  41. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  42. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  43. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  44. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  45. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  46. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  47. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  48. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  49. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  50. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  51. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  52. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  53. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  54. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  55. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  56. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  57. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  58. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  59. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  60. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  61. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  62. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  63. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  64. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  65. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  66. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  67. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  68. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  69. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  70. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  71. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  72. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  73. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  74. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  75. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  76. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  77. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  78. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  79. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  80. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  81. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  82. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  83. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  84. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  85. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  86. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  87. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  88. data/assets/bower_components/katex/dist/katex.css +87 -74
  89. data/assets/bower_components/katex/dist/katex.js +14338 -14023
  90. data/assets/bower_components/katex/dist/katex.min.css +1 -1
  91. data/assets/bower_components/katex/dist/katex.min.js +1 -1
  92. data/assets/bower_components/katex/dist/katex.mjs +16083 -0
  93. data/assets/bower_components/katex/lint_blacklist.txt +5 -0
  94. data/assets/bower_components/katex/yarn.lock +8483 -0
  95. data/assets/css/{hydejack-8.2.0.css → hydejack-7.5.2.css} +0 -0
  96. data/assets/css/hydejack-8.3.0.css +3 -0
  97. data/assets/img/blog/steve-harvey.jpg +0 -0
  98. data/assets/img/blog/wade-lambert.jpg +0 -0
  99. data/assets/js/{hydejack-8.2.0.js → hydejack-8.3.0.js} +3 -3
  100. data/assets/version.json +1 -1
  101. metadata +17 -7
  102. data/assets/bower_components/katex/flow-typed/match-at.js +0 -3
  103. data/assets/bower_components/katex/flow-typed/object-assign.js +0 -6
  104. data/assets/bower_components/katex/package-lock.json +0 -13848
@@ -4,7 +4,7 @@
4
4
  "dist/katex.js",
5
5
  "dist/katex.css"
6
6
  ],
7
- "homepage": "http://khan.github.io/KaTeX/",
7
+ "homepage": "https://katex.org/",
8
8
  "description": "Fast math typesetting for the web.",
9
9
  "moduleType": [
10
10
  "amd",
@@ -18,18 +18,19 @@
18
18
  },
19
19
  "ignore": [
20
20
  "**/.*",
21
- "/*.txt",
22
21
  "/*.js",
22
+ "/*.json",
23
23
  "/*.md",
24
+ "!/README.md",
24
25
  "/*.sh",
25
26
  "/package.json",
26
27
  "/Makefile",
27
- "/build",
28
28
  "/test",
29
29
  "/src",
30
30
  "/contrib",
31
31
  "/dockers",
32
- "/metrics",
33
- "/static"
32
+ "/submodules",
33
+ "/static",
34
+ "/website"
34
35
  ]
35
36
  }
@@ -0,0 +1,90 @@
1
+ # [<img src="https://cdn.rawgit.com/Khan/KaTeX/84189cd3adae24d92e766d14eb80d6e54f3c7dca/katex-logo.svg" width="130" alt="KaTeX">](https://katex.org/)
2
+ [![npm](https://img.shields.io/npm/v/katex.svg)](https://www.npmjs.com/package/katex)
3
+ [![CircleCI](https://circleci.com/gh/Khan/KaTeX.svg?style=shield)](https://circleci.com/gh/Khan/KaTeX)
4
+ [![codecov](https://codecov.io/gh/Khan/KaTeX/branch/master/graph/badge.svg)](https://codecov.io/gh/Khan/KaTeX)
5
+ [![Join the chat at https://gitter.im/Khan/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Khan/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Greenkeeper badge](https://badges.greenkeeper.io/Khan/KaTeX.svg)](https://greenkeeper.io/)
6
+ [![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex)
7
+ ![](https://img.badgesize.io/Khan/KaTeX/v0.10.0/dist/katex.min.js?compression=gzip)
8
+
9
+ KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
10
+
11
+ * **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://www.intmath.com/cg5/katex-mathjax-comparison.php).
12
+ * **Print quality:** KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting.
13
+ * **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
14
+ * **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.
15
+
16
+ KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 9–11.
17
+
18
+ KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html).
19
+
20
+ Try out KaTeX [on the demo page](https://katex.org/#demo)!
21
+
22
+ ## Getting started
23
+
24
+ ### Starter template
25
+
26
+ ```html
27
+ <!DOCTYPE html>
28
+ <!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
29
+ <html>
30
+ <head>
31
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
32
+
33
+ <!-- The loading of KaTeX is deferred to speed up page rendering -->
34
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
35
+
36
+ <!-- To automatically render math in text elements, include the auto-render extension: -->
37
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"
38
+ onload="renderMathInElement(document.body);"></script>
39
+ </head>
40
+ ...
41
+ </html>
42
+ ```
43
+
44
+ You can also [download KaTeX](https://github.com/khan/katex/releases) and host it yourself.
45
+
46
+ For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html).
47
+
48
+ ### API
49
+
50
+ Call `katex.render` to render a TeX expression directly into a DOM element.
51
+ For example:
52
+
53
+ ```js
54
+ katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, {
55
+ throwOnError: false
56
+ });
57
+ ```
58
+
59
+ Call `katex.renderToString` to generate an HTML string of the rendered math,
60
+ e.g., for server-side rendering. For example:
61
+
62
+ ```js
63
+ var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", {
64
+ throwOnError: false
65
+ });
66
+ // '<span class="katex">...</span>'
67
+ ```
68
+
69
+ Make sure to include the CSS and font files in both cases.
70
+ If you are doing all rendering on the server, there is no need to include the
71
+ JavaScript on the client.
72
+
73
+ The examples above use the `throwOnError: false` option, which renders invalid
74
+ inputs as the TeX source code in red (by default), with the error message as
75
+ hover text. For other available options, see the
76
+ [API documentation](https://katex.org/docs/api.html),
77
+ [options documentation](https://katex.org/docs/options.html), and
78
+ [handling errors documentation](https://katex.org/docs/error.html).
79
+
80
+ ## Demo and Documentation
81
+
82
+ Learn more about using KaTeX [on the website](https://katex.org)!
83
+
84
+ ## Contributing
85
+
86
+ See [CONTRIBUTING.md](CONTRIBUTING.md)
87
+
88
+ ## License
89
+
90
+ KaTeX is licensed under the [MIT License](http://opensource.org/licenses/MIT).
@@ -7,7 +7,7 @@
7
7
  exports["renderMathInElement"] = factory(require("katex"));
8
8
  else
9
9
  root["renderMathInElement"] = factory(root["katex"]);
10
- })(this, function(__WEBPACK_EXTERNAL_MODULE_38__) {
10
+ })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__0__) {
11
11
  return /******/ (function(modules) { // webpackBootstrap
12
12
  /******/ // The module cache
13
13
  /******/ var installedModules = {};
@@ -46,14 +46,34 @@ return /******/ (function(modules) { // webpackBootstrap
46
46
  /******/ // define getter function for harmony exports
47
47
  /******/ __webpack_require__.d = function(exports, name, getter) {
48
48
  /******/ if(!__webpack_require__.o(exports, name)) {
49
- /******/ Object.defineProperty(exports, name, {
50
- /******/ configurable: false,
51
- /******/ enumerable: true,
52
- /******/ get: getter
53
- /******/ });
49
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
54
50
  /******/ }
55
51
  /******/ };
56
52
  /******/
53
+ /******/ // define __esModule on exports
54
+ /******/ __webpack_require__.r = function(exports) {
55
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
+ /******/ }
58
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
+ /******/ };
60
+ /******/
61
+ /******/ // create a fake namespace object
62
+ /******/ // mode & 1: value is a module id, require it
63
+ /******/ // mode & 2: merge all properties of value into the ns
64
+ /******/ // mode & 4: return value when already ns object
65
+ /******/ // mode & 8|1: behave like require
66
+ /******/ __webpack_require__.t = function(value, mode) {
67
+ /******/ if(mode & 1) value = __webpack_require__(value);
68
+ /******/ if(mode & 8) return value;
69
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
+ /******/ var ns = Object.create(null);
71
+ /******/ __webpack_require__.r(ns);
72
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
+ /******/ return ns;
75
+ /******/ };
76
+ /******/
57
77
  /******/ // getDefaultExport function for compatibility with non-harmony modules
58
78
  /******/ __webpack_require__.n = function(module) {
59
79
  /******/ var getter = module && module.__esModule ?
@@ -69,721 +89,246 @@ return /******/ (function(modules) { // webpackBootstrap
69
89
  /******/ // __webpack_public_path__
70
90
  /******/ __webpack_require__.p = "";
71
91
  /******/
92
+ /******/
72
93
  /******/ // Load entry module and return exports
73
- /******/ return __webpack_require__(__webpack_require__.s = 9);
94
+ /******/ return __webpack_require__(__webpack_require__.s = 1);
74
95
  /******/ })
75
96
  /************************************************************************/
76
97
  /******/ ([
77
98
  /* 0 */
78
99
  /***/ (function(module, exports) {
79
100
 
80
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
81
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
82
- ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
83
- if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
101
+ module.exports = __WEBPACK_EXTERNAL_MODULE__0__;
84
102
 
85
103
  /***/ }),
86
104
  /* 1 */
87
- /***/ (function(module, exports) {
88
-
89
- module.exports = function(it){
90
- return typeof it === 'object' ? it !== null : typeof it === 'function';
91
- };
92
-
93
- /***/ }),
94
- /* 2 */
95
- /***/ (function(module, exports, __webpack_require__) {
96
-
97
- // Thank's IE8 for his funny defineProperty
98
- module.exports = !__webpack_require__(3)(function(){
99
- return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
100
- });
101
-
102
- /***/ }),
103
- /* 3 */
104
- /***/ (function(module, exports) {
105
-
106
- module.exports = function(exec){
107
- try {
108
- return !!exec();
109
- } catch(e){
110
- return true;
111
- }
112
- };
113
-
114
- /***/ }),
115
- /* 4 */
116
- /***/ (function(module, exports) {
117
-
118
- var core = module.exports = {version: '2.4.0'};
119
- if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
120
-
121
- /***/ }),
122
- /* 5 */
123
- /***/ (function(module, exports, __webpack_require__) {
124
-
125
- // to indexed object, toObject with fallback for non-array-like ES3 strings
126
- var IObject = __webpack_require__(6)
127
- , defined = __webpack_require__(7);
128
- module.exports = function(it){
129
- return IObject(defined(it));
130
- };
131
-
132
- /***/ }),
133
- /* 6 */
134
- /***/ (function(module, exports, __webpack_require__) {
135
-
136
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
137
- var cof = __webpack_require__(27);
138
- module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
139
- return cof(it) == 'String' ? it.split('') : Object(it);
140
- };
141
-
142
- /***/ }),
143
- /* 7 */
144
- /***/ (function(module, exports) {
145
-
146
- // 7.2.1 RequireObjectCoercible(argument)
147
- module.exports = function(it){
148
- if(it == undefined)throw TypeError("Can't call method on " + it);
149
- return it;
150
- };
151
-
152
- /***/ }),
153
- /* 8 */
154
- /***/ (function(module, exports) {
155
-
156
- // 7.1.4 ToInteger
157
- var ceil = Math.ceil
158
- , floor = Math.floor;
159
- module.exports = function(it){
160
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
161
- };
162
-
163
- /***/ }),
164
- /* 9 */
165
105
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
166
106
 
167
107
  "use strict";
168
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
169
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign__ = __webpack_require__(10);
170
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign__);
171
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_katex__ = __webpack_require__(38);
172
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_katex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_katex__);
173
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__splitAtDelimiters__ = __webpack_require__(39);
108
+ __webpack_require__.r(__webpack_exports__);
174
109
 
175
- /* eslint no-console:0 */
110
+ // EXTERNAL MODULE: external "katex"
111
+ var external_katex_ = __webpack_require__(0);
112
+ var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_);
176
113
 
177
-
178
-
179
-
180
- var splitWithDelimiters = function splitWithDelimiters(text, delimiters) {
181
- var data = [{ type: "text", data: text }];
182
- for (var i = 0; i < delimiters.length; i++) {
183
- var delimiter = delimiters[i];
184
- data = Object(__WEBPACK_IMPORTED_MODULE_2__splitAtDelimiters__["a" /* default */])(data, delimiter.left, delimiter.right, delimiter.display || false);
114
+ // CONCATENATED MODULE: ./contrib/auto-render/splitAtDelimiters.js
115
+ /* eslint no-constant-condition:0 */
116
+ var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
117
+ // Adapted from
118
+ // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
119
+ var index = startIndex;
120
+ var braceLevel = 0;
121
+ var delimLength = delimiter.length;
122
+
123
+ while (index < text.length) {
124
+ var character = text[index];
125
+
126
+ if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
127
+ return index;
128
+ } else if (character === "\\") {
129
+ index++;
130
+ } else if (character === "{") {
131
+ braceLevel++;
132
+ } else if (character === "}") {
133
+ braceLevel--;
185
134
  }
186
- return data;
187
- };
188
-
189
- /* Note: optionsCopy is mutated by this method. If it is ever exposed in the
190
- * API, we should copy it before mutating.
191
- */
192
- var renderMathInText = function renderMathInText(text, optionsCopy) {
193
- var data = splitWithDelimiters(text, optionsCopy.delimiters);
194
- var fragment = document.createDocumentFragment();
195
135
 
196
- for (var i = 0; i < data.length; i++) {
197
- if (data[i].type === "text") {
198
- fragment.appendChild(document.createTextNode(data[i].data));
199
- } else {
200
- var span = document.createElement("span");
201
- var math = data[i].data;
202
- // Override any display mode defined in the settings with that
203
- // defined by the text itself
204
- optionsCopy.displayMode = data[i].display;
205
- try {
206
- __WEBPACK_IMPORTED_MODULE_1_katex___default.a.render(math, span, optionsCopy);
207
- } catch (e) {
208
- if (!(e instanceof __WEBPACK_IMPORTED_MODULE_1_katex___default.a.ParseError)) {
209
- throw e;
210
- }
211
- optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
212
- fragment.appendChild(document.createTextNode(data[i].rawData));
213
- continue;
214
- }
215
- fragment.appendChild(span);
216
- }
217
- }
136
+ index++;
137
+ }
218
138
 
219
- return fragment;
139
+ return -1;
220
140
  };
221
141
 
222
- var renderElem = function renderElem(elem, optionsCopy) {
223
- for (var i = 0; i < elem.childNodes.length; i++) {
224
- var childNode = elem.childNodes[i];
225
- if (childNode.nodeType === 3) {
226
- // Text node
227
- var frag = renderMathInText(childNode.textContent, optionsCopy);
228
- i += frag.childNodes.length - 1;
229
- elem.replaceChild(frag, childNode);
230
- } else if (childNode.nodeType === 1) {
231
- // Element node
232
- var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1;
233
-
234
- if (shouldRender) {
235
- renderElem(childNode, optionsCopy);
236
- }
142
+ var splitAtDelimiters = function splitAtDelimiters(startData, leftDelim, rightDelim, display) {
143
+ var finalData = [];
144
+
145
+ for (var i = 0; i < startData.length; i++) {
146
+ if (startData[i].type === "text") {
147
+ var text = startData[i].data;
148
+ var lookingForLeft = true;
149
+ var currIndex = 0;
150
+ var nextIndex = void 0;
151
+ nextIndex = text.indexOf(leftDelim);
152
+
153
+ if (nextIndex !== -1) {
154
+ currIndex = nextIndex;
155
+ finalData.push({
156
+ type: "text",
157
+ data: text.slice(0, currIndex)
158
+ });
159
+ lookingForLeft = false;
160
+ }
161
+
162
+ while (true) {
163
+ if (lookingForLeft) {
164
+ nextIndex = text.indexOf(leftDelim, currIndex);
165
+
166
+ if (nextIndex === -1) {
167
+ break;
168
+ }
169
+
170
+ finalData.push({
171
+ type: "text",
172
+ data: text.slice(currIndex, nextIndex)
173
+ });
174
+ currIndex = nextIndex;
175
+ } else {
176
+ nextIndex = findEndOfMath(rightDelim, text, currIndex + leftDelim.length);
177
+
178
+ if (nextIndex === -1) {
179
+ break;
180
+ }
181
+
182
+ finalData.push({
183
+ type: "math",
184
+ data: text.slice(currIndex + leftDelim.length, nextIndex),
185
+ rawData: text.slice(currIndex, nextIndex + rightDelim.length),
186
+ display: display
187
+ });
188
+ currIndex = nextIndex + rightDelim.length;
237
189
  }
238
- // Otherwise, it's something else, and ignore it.
239
- }
240
- };
241
-
242
- var defaultAutoRenderOptions = {
243
- delimiters: [{ left: "$$", right: "$$", display: true }, { left: "\\[", right: "\\]", display: true }, { left: "\\(", right: "\\)", display: false }],
244
190
 
245
- ignoredTags: ["script", "noscript", "style", "textarea", "pre", "code"],
246
-
247
- errorCallback: function errorCallback(msg, err) {
248
- console.error(msg, err);
249
- }
250
- };
191
+ lookingForLeft = !lookingForLeft;
192
+ }
251
193
 
252
- var renderMathInElement = function renderMathInElement(elem, options) {
253
- if (!elem) {
254
- throw new Error("No element provided to render");
255
- }
256
-
257
- var optionsCopy = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign___default()({}, defaultAutoRenderOptions, options);
258
- renderElem(elem, optionsCopy);
259
- };
260
-
261
- /* harmony default export */ __webpack_exports__["default"] = (renderMathInElement);
262
-
263
- /***/ }),
264
- /* 10 */
265
- /***/ (function(module, exports, __webpack_require__) {
266
-
267
- module.exports = { "default": __webpack_require__(11), __esModule: true };
268
-
269
- /***/ }),
270
- /* 11 */
271
- /***/ (function(module, exports, __webpack_require__) {
272
-
273
- __webpack_require__(12);
274
- module.exports = __webpack_require__(4).Object.assign;
275
-
276
- /***/ }),
277
- /* 12 */
278
- /***/ (function(module, exports, __webpack_require__) {
279
-
280
- // 19.1.3.1 Object.assign(target, source)
281
- var $export = __webpack_require__(13);
282
-
283
- $export($export.S + $export.F, 'Object', {assign: __webpack_require__(23)});
284
-
285
- /***/ }),
286
- /* 13 */
287
- /***/ (function(module, exports, __webpack_require__) {
288
-
289
- var global = __webpack_require__(0)
290
- , core = __webpack_require__(4)
291
- , ctx = __webpack_require__(14)
292
- , hide = __webpack_require__(16)
293
- , PROTOTYPE = 'prototype';
294
-
295
- var $export = function(type, name, source){
296
- var IS_FORCED = type & $export.F
297
- , IS_GLOBAL = type & $export.G
298
- , IS_STATIC = type & $export.S
299
- , IS_PROTO = type & $export.P
300
- , IS_BIND = type & $export.B
301
- , IS_WRAP = type & $export.W
302
- , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
303
- , expProto = exports[PROTOTYPE]
304
- , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
305
- , key, own, out;
306
- if(IS_GLOBAL)source = name;
307
- for(key in source){
308
- // contains in native
309
- own = !IS_FORCED && target && target[key] !== undefined;
310
- if(own && key in exports)continue;
311
- // export native or passed
312
- out = own ? target[key] : source[key];
313
- // prevent global pollution for namespaces
314
- exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
315
- // bind timers to global for call from export context
316
- : IS_BIND && own ? ctx(out, global)
317
- // wrap global constructors for prevent change them in library
318
- : IS_WRAP && target[key] == out ? (function(C){
319
- var F = function(a, b, c){
320
- if(this instanceof C){
321
- switch(arguments.length){
322
- case 0: return new C;
323
- case 1: return new C(a);
324
- case 2: return new C(a, b);
325
- } return new C(a, b, c);
326
- } return C.apply(this, arguments);
327
- };
328
- F[PROTOTYPE] = C[PROTOTYPE];
329
- return F;
330
- // make static versions for prototype methods
331
- })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
332
- // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
333
- if(IS_PROTO){
334
- (exports.virtual || (exports.virtual = {}))[key] = out;
335
- // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
336
- if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
194
+ finalData.push({
195
+ type: "text",
196
+ data: text.slice(currIndex)
197
+ });
198
+ } else {
199
+ finalData.push(startData[i]);
337
200
  }
338
201
  }
339
- };
340
- // type bitmap
341
- $export.F = 1; // forced
342
- $export.G = 2; // global
343
- $export.S = 4; // static
344
- $export.P = 8; // proto
345
- $export.B = 16; // bind
346
- $export.W = 32; // wrap
347
- $export.U = 64; // safe
348
- $export.R = 128; // real proto method for `library`
349
- module.exports = $export;
350
-
351
- /***/ }),
352
- /* 14 */
353
- /***/ (function(module, exports, __webpack_require__) {
354
-
355
- // optional / simple context binding
356
- var aFunction = __webpack_require__(15);
357
- module.exports = function(fn, that, length){
358
- aFunction(fn);
359
- if(that === undefined)return fn;
360
- switch(length){
361
- case 1: return function(a){
362
- return fn.call(that, a);
363
- };
364
- case 2: return function(a, b){
365
- return fn.call(that, a, b);
366
- };
367
- case 3: return function(a, b, c){
368
- return fn.call(that, a, b, c);
369
- };
370
- }
371
- return function(/* ...args */){
372
- return fn.apply(that, arguments);
373
- };
374
- };
375
-
376
- /***/ }),
377
- /* 15 */
378
- /***/ (function(module, exports) {
379
-
380
- module.exports = function(it){
381
- if(typeof it != 'function')throw TypeError(it + ' is not a function!');
382
- return it;
383
- };
384
-
385
- /***/ }),
386
- /* 16 */
387
- /***/ (function(module, exports, __webpack_require__) {
388
-
389
- var dP = __webpack_require__(17)
390
- , createDesc = __webpack_require__(22);
391
- module.exports = __webpack_require__(2) ? function(object, key, value){
392
- return dP.f(object, key, createDesc(1, value));
393
- } : function(object, key, value){
394
- object[key] = value;
395
- return object;
396
- };
397
-
398
- /***/ }),
399
- /* 17 */
400
- /***/ (function(module, exports, __webpack_require__) {
401
-
402
- var anObject = __webpack_require__(18)
403
- , IE8_DOM_DEFINE = __webpack_require__(19)
404
- , toPrimitive = __webpack_require__(21)
405
- , dP = Object.defineProperty;
406
-
407
- exports.f = __webpack_require__(2) ? Object.defineProperty : function defineProperty(O, P, Attributes){
408
- anObject(O);
409
- P = toPrimitive(P, true);
410
- anObject(Attributes);
411
- if(IE8_DOM_DEFINE)try {
412
- return dP(O, P, Attributes);
413
- } catch(e){ /* empty */ }
414
- if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
415
- if('value' in Attributes)O[P] = Attributes.value;
416
- return O;
417
- };
418
-
419
- /***/ }),
420
- /* 18 */
421
- /***/ (function(module, exports, __webpack_require__) {
422
-
423
- var isObject = __webpack_require__(1);
424
- module.exports = function(it){
425
- if(!isObject(it))throw TypeError(it + ' is not an object!');
426
- return it;
427
- };
428
-
429
- /***/ }),
430
- /* 19 */
431
- /***/ (function(module, exports, __webpack_require__) {
432
-
433
- module.exports = !__webpack_require__(2) && !__webpack_require__(3)(function(){
434
- return Object.defineProperty(__webpack_require__(20)('div'), 'a', {get: function(){ return 7; }}).a != 7;
435
- });
436
-
437
- /***/ }),
438
- /* 20 */
439
- /***/ (function(module, exports, __webpack_require__) {
440
-
441
- var isObject = __webpack_require__(1)
442
- , document = __webpack_require__(0).document
443
- // in old IE typeof document.createElement is 'object'
444
- , is = isObject(document) && isObject(document.createElement);
445
- module.exports = function(it){
446
- return is ? document.createElement(it) : {};
447
- };
448
-
449
- /***/ }),
450
- /* 21 */
451
- /***/ (function(module, exports, __webpack_require__) {
452
-
453
- // 7.1.1 ToPrimitive(input [, PreferredType])
454
- var isObject = __webpack_require__(1);
455
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
456
- // and the second argument - flag - preferred type is a string
457
- module.exports = function(it, S){
458
- if(!isObject(it))return it;
459
- var fn, val;
460
- if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
461
- if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
462
- if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
463
- throw TypeError("Can't convert object to primitive value");
464
- };
465
-
466
- /***/ }),
467
- /* 22 */
468
- /***/ (function(module, exports) {
469
202
 
470
- module.exports = function(bitmap, value){
471
- return {
472
- enumerable : !(bitmap & 1),
473
- configurable: !(bitmap & 2),
474
- writable : !(bitmap & 4),
475
- value : value
476
- };
203
+ return finalData;
477
204
  };
478
205
 
479
- /***/ }),
480
- /* 23 */
481
- /***/ (function(module, exports, __webpack_require__) {
482
-
483
- "use strict";
484
-
485
- // 19.1.2.1 Object.assign(target, source, ...)
486
- var getKeys = __webpack_require__(24)
487
- , gOPS = __webpack_require__(35)
488
- , pIE = __webpack_require__(36)
489
- , toObject = __webpack_require__(37)
490
- , IObject = __webpack_require__(6)
491
- , $assign = Object.assign;
492
-
493
- // should work with symbols and should have deterministic property order (V8 bug)
494
- module.exports = !$assign || __webpack_require__(3)(function(){
495
- var A = {}
496
- , B = {}
497
- , S = Symbol()
498
- , K = 'abcdefghijklmnopqrst';
499
- A[S] = 7;
500
- K.split('').forEach(function(k){ B[k] = k; });
501
- return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
502
- }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
503
- var T = toObject(target)
504
- , aLen = arguments.length
505
- , index = 1
506
- , getSymbols = gOPS.f
507
- , isEnum = pIE.f;
508
- while(aLen > index){
509
- var S = IObject(arguments[index++])
510
- , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
511
- , length = keys.length
512
- , j = 0
513
- , key;
514
- while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
515
- } return T;
516
- } : $assign;
206
+ /* harmony default export */ var auto_render_splitAtDelimiters = (splitAtDelimiters);
207
+ // CONCATENATED MODULE: ./contrib/auto-render/auto-render.js
208
+ /* eslint no-console:0 */
517
209
 
518
- /***/ }),
519
- /* 24 */
520
- /***/ (function(module, exports, __webpack_require__) {
521
210
 
522
- // 19.1.2.14 / 15.2.3.14 Object.keys(O)
523
- var $keys = __webpack_require__(25)
524
- , enumBugKeys = __webpack_require__(34);
525
211
 
526
- module.exports = Object.keys || function keys(O){
527
- return $keys(O, enumBugKeys);
528
- };
212
+ var auto_render_splitWithDelimiters = function splitWithDelimiters(text, delimiters) {
213
+ var data = [{
214
+ type: "text",
215
+ data: text
216
+ }];
529
217
 
530
- /***/ }),
531
- /* 25 */
532
- /***/ (function(module, exports, __webpack_require__) {
533
-
534
- var has = __webpack_require__(26)
535
- , toIObject = __webpack_require__(5)
536
- , arrayIndexOf = __webpack_require__(28)(false)
537
- , IE_PROTO = __webpack_require__(31)('IE_PROTO');
538
-
539
- module.exports = function(object, names){
540
- var O = toIObject(object)
541
- , i = 0
542
- , result = []
543
- , key;
544
- for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
545
- // Don't enum bug & hidden keys
546
- while(names.length > i)if(has(O, key = names[i++])){
547
- ~arrayIndexOf(result, key) || result.push(key);
218
+ for (var i = 0; i < delimiters.length; i++) {
219
+ var delimiter = delimiters[i];
220
+ data = auto_render_splitAtDelimiters(data, delimiter.left, delimiter.right, delimiter.display || false);
548
221
  }
549
- return result;
550
- };
551
-
552
- /***/ }),
553
- /* 26 */
554
- /***/ (function(module, exports) {
555
-
556
- var hasOwnProperty = {}.hasOwnProperty;
557
- module.exports = function(it, key){
558
- return hasOwnProperty.call(it, key);
559
- };
560
-
561
- /***/ }),
562
- /* 27 */
563
- /***/ (function(module, exports) {
564
-
565
- var toString = {}.toString;
566
-
567
- module.exports = function(it){
568
- return toString.call(it).slice(8, -1);
569
- };
570
-
571
- /***/ }),
572
- /* 28 */
573
- /***/ (function(module, exports, __webpack_require__) {
574
-
575
- // false -> Array#indexOf
576
- // true -> Array#includes
577
- var toIObject = __webpack_require__(5)
578
- , toLength = __webpack_require__(29)
579
- , toIndex = __webpack_require__(30);
580
- module.exports = function(IS_INCLUDES){
581
- return function($this, el, fromIndex){
582
- var O = toIObject($this)
583
- , length = toLength(O.length)
584
- , index = toIndex(fromIndex, length)
585
- , value;
586
- // Array#includes uses SameValueZero equality algorithm
587
- if(IS_INCLUDES && el != el)while(length > index){
588
- value = O[index++];
589
- if(value != value)return true;
590
- // Array#toIndex ignores holes, Array#includes - not
591
- } else for(;length > index; index++)if(IS_INCLUDES || index in O){
592
- if(O[index] === el)return IS_INCLUDES || index || 0;
593
- } return !IS_INCLUDES && -1;
594
- };
595
- };
596
-
597
- /***/ }),
598
- /* 29 */
599
- /***/ (function(module, exports, __webpack_require__) {
600
-
601
- // 7.1.15 ToLength
602
- var toInteger = __webpack_require__(8)
603
- , min = Math.min;
604
- module.exports = function(it){
605
- return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
606
- };
607
-
608
- /***/ }),
609
- /* 30 */
610
- /***/ (function(module, exports, __webpack_require__) {
611
-
612
- var toInteger = __webpack_require__(8)
613
- , max = Math.max
614
- , min = Math.min;
615
- module.exports = function(index, length){
616
- index = toInteger(index);
617
- return index < 0 ? max(index + length, 0) : min(index, length);
618
- };
619
-
620
- /***/ }),
621
- /* 31 */
622
- /***/ (function(module, exports, __webpack_require__) {
623
-
624
- var shared = __webpack_require__(32)('keys')
625
- , uid = __webpack_require__(33);
626
- module.exports = function(key){
627
- return shared[key] || (shared[key] = uid(key));
628
- };
629
-
630
- /***/ }),
631
- /* 32 */
632
- /***/ (function(module, exports, __webpack_require__) {
633
-
634
- var global = __webpack_require__(0)
635
- , SHARED = '__core-js_shared__'
636
- , store = global[SHARED] || (global[SHARED] = {});
637
- module.exports = function(key){
638
- return store[key] || (store[key] = {});
639
- };
640
-
641
- /***/ }),
642
- /* 33 */
643
- /***/ (function(module, exports) {
644
222
 
645
- var id = 0
646
- , px = Math.random();
647
- module.exports = function(key){
648
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
223
+ return data;
649
224
  };
225
+ /* Note: optionsCopy is mutated by this method. If it is ever exposed in the
226
+ * API, we should copy it before mutating.
227
+ */
650
228
 
651
- /***/ }),
652
- /* 34 */
653
- /***/ (function(module, exports) {
654
229
 
655
- // IE 8- don't enum bug keys
656
- module.exports = (
657
- 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
658
- ).split(',');
230
+ var auto_render_renderMathInText = function renderMathInText(text, optionsCopy) {
231
+ var data = auto_render_splitWithDelimiters(text, optionsCopy.delimiters);
232
+ var fragment = document.createDocumentFragment();
659
233
 
660
- /***/ }),
661
- /* 35 */
662
- /***/ (function(module, exports) {
234
+ for (var i = 0; i < data.length; i++) {
235
+ if (data[i].type === "text") {
236
+ fragment.appendChild(document.createTextNode(data[i].data));
237
+ } else {
238
+ var span = document.createElement("span");
239
+ var math = data[i].data; // Override any display mode defined in the settings with that
240
+ // defined by the text itself
663
241
 
664
- exports.f = Object.getOwnPropertySymbols;
242
+ optionsCopy.displayMode = data[i].display;
665
243
 
666
- /***/ }),
667
- /* 36 */
668
- /***/ (function(module, exports) {
244
+ try {
245
+ external_katex_default.a.render(math, span, optionsCopy);
246
+ } catch (e) {
247
+ if (!(e instanceof external_katex_default.a.ParseError)) {
248
+ throw e;
249
+ }
669
250
 
670
- exports.f = {}.propertyIsEnumerable;
251
+ optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
252
+ fragment.appendChild(document.createTextNode(data[i].rawData));
253
+ continue;
254
+ }
671
255
 
672
- /***/ }),
673
- /* 37 */
674
- /***/ (function(module, exports, __webpack_require__) {
256
+ fragment.appendChild(span);
257
+ }
258
+ }
675
259
 
676
- // 7.1.13 ToObject(argument)
677
- var defined = __webpack_require__(7);
678
- module.exports = function(it){
679
- return Object(defined(it));
260
+ return fragment;
680
261
  };
681
262
 
682
- /***/ }),
683
- /* 38 */
684
- /***/ (function(module, exports) {
685
-
686
- module.exports = __WEBPACK_EXTERNAL_MODULE_38__;
687
-
688
- /***/ }),
689
- /* 39 */
690
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
691
-
692
- "use strict";
693
- /* eslint no-constant-condition:0 */
694
- var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
695
- // Adapted from
696
- // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
697
- var index = startIndex;
698
- var braceLevel = 0;
699
-
700
- var delimLength = delimiter.length;
701
-
702
- while (index < text.length) {
703
- var character = text[index];
704
-
705
- if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
706
- return index;
707
- } else if (character === "\\") {
708
- index++;
709
- } else if (character === "{") {
710
- braceLevel++;
711
- } else if (character === "}") {
712
- braceLevel--;
263
+ var renderElem = function renderElem(elem, optionsCopy) {
264
+ for (var i = 0; i < elem.childNodes.length; i++) {
265
+ var childNode = elem.childNodes[i];
266
+
267
+ if (childNode.nodeType === 3) {
268
+ // Text node
269
+ var frag = auto_render_renderMathInText(childNode.textContent, optionsCopy);
270
+ i += frag.childNodes.length - 1;
271
+ elem.replaceChild(frag, childNode);
272
+ } else if (childNode.nodeType === 1) {
273
+ (function () {
274
+ // Element node
275
+ var className = ' ' + childNode.className + ' ';
276
+ var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(function (x) {
277
+ return className.indexOf(' ' + x + ' ') === -1;
278
+ });
279
+
280
+ if (shouldRender) {
281
+ renderElem(childNode, optionsCopy);
713
282
  }
283
+ })();
284
+ } // Otherwise, it's something else, and ignore it.
714
285
 
715
- index++;
716
- }
717
-
718
- return -1;
286
+ }
719
287
  };
720
288
 
721
- var splitAtDelimiters = function splitAtDelimiters(startData, leftDelim, rightDelim, display) {
722
- var finalData = [];
723
-
724
- for (var i = 0; i < startData.length; i++) {
725
- if (startData[i].type === "text") {
726
- var text = startData[i].data;
727
-
728
- var lookingForLeft = true;
729
- var currIndex = 0;
730
- var nextIndex = void 0;
731
-
732
- nextIndex = text.indexOf(leftDelim);
733
- if (nextIndex !== -1) {
734
- currIndex = nextIndex;
735
- finalData.push({
736
- type: "text",
737
- data: text.slice(0, currIndex)
738
- });
739
- lookingForLeft = false;
740
- }
741
-
742
- while (true) {
743
- if (lookingForLeft) {
744
- nextIndex = text.indexOf(leftDelim, currIndex);
745
- if (nextIndex === -1) {
746
- break;
747
- }
748
-
749
- finalData.push({
750
- type: "text",
751
- data: text.slice(currIndex, nextIndex)
752
- });
753
-
754
- currIndex = nextIndex;
755
- } else {
756
- nextIndex = findEndOfMath(rightDelim, text, currIndex + leftDelim.length);
757
- if (nextIndex === -1) {
758
- break;
759
- }
760
-
761
- finalData.push({
762
- type: "math",
763
- data: text.slice(currIndex + leftDelim.length, nextIndex),
764
- rawData: text.slice(currIndex, nextIndex + rightDelim.length),
765
- display: display
766
- });
767
-
768
- currIndex = nextIndex + rightDelim.length;
769
- }
770
-
771
- lookingForLeft = !lookingForLeft;
772
- }
773
-
774
- finalData.push({
775
- type: "text",
776
- data: text.slice(currIndex)
777
- });
778
- } else {
779
- finalData.push(startData[i]);
780
- }
781
- }
289
+ var renderMathInElement = function renderMathInElement(elem, options) {
290
+ if (!elem) {
291
+ throw new Error("No element provided to render");
292
+ }
782
293
 
783
- return finalData;
784
- };
294
+ var optionsCopy = {}; // Object.assign(optionsCopy, option)
785
295
 
786
- /* harmony default export */ __webpack_exports__["a"] = (splitAtDelimiters);
296
+ for (var option in options) {
297
+ if (options.hasOwnProperty(option)) {
298
+ optionsCopy[option] = options[option];
299
+ }
300
+ } // default options
301
+
302
+
303
+ optionsCopy.delimiters = optionsCopy.delimiters || [{
304
+ left: "$$",
305
+ right: "$$",
306
+ display: true
307
+ }, {
308
+ left: "\\(",
309
+ right: "\\)",
310
+ display: false
311
+ }, // LaTeX uses $…$, but it ruins the display of normal `$` in text:
312
+ // {left: "$", right: "$", display: false},
313
+ // \[…\] must come last in this array. Otherwise, renderMathInElement
314
+ // will search for \[ before it searches for $$ or \(
315
+ // That makes it susceptible to finding a \\[0.3em] row delimiter and
316
+ // treating it as if it were the start of a KaTeX math zone.
317
+ {
318
+ left: "\\[",
319
+ right: "\\]",
320
+ display: true
321
+ }];
322
+ optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code"];
323
+ optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
324
+ optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different
325
+ // math elements within a single call to `renderMathInElement`.
326
+
327
+ optionsCopy.macros = optionsCopy.macros || {};
328
+ renderElem(elem, optionsCopy);
329
+ };
330
+
331
+ /* harmony default export */ var auto_render = __webpack_exports__["default"] = (renderMathInElement);
787
332
 
788
333
  /***/ })
789
334
  /******/ ])["default"];