mathpix-markdown-it 2.0.7 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/doc/icons/color-icons-render.html +272 -0
  2. package/doc/icons/color-icons.html +54554 -0
  3. package/doc/icons/icons.md +5 -1
  4. package/es5/bundle.js +1 -1
  5. package/es5/index.js +1 -1
  6. package/lib/helpers/icons/css-colors.d.ts +1 -0
  7. package/lib/helpers/icons/css-colors.js +36 -0
  8. package/lib/helpers/icons/css-colors.js.map +1 -0
  9. package/lib/helpers/icons/fa-icons.js +44 -44
  10. package/lib/helpers/icons/fa-icons.js.map +1 -1
  11. package/lib/helpers/icons/index.d.ts +12 -2
  12. package/lib/helpers/icons/index.js +94 -15
  13. package/lib/helpers/icons/index.js.map +1 -1
  14. package/lib/helpers/icons/squared-icons.js +10 -10
  15. package/lib/helpers/icons/squared-icons.js.map +1 -1
  16. package/lib/helpers/icons/unicode-icons.js +197 -184
  17. package/lib/helpers/icons/unicode-icons.js.map +1 -1
  18. package/lib/markdown/common/consts.d.ts +3 -0
  19. package/lib/markdown/common/consts.js +13 -1
  20. package/lib/markdown/common/consts.js.map +1 -1
  21. package/lib/markdown/md-block-rule/begin-tabular/common.js +0 -1
  22. package/lib/markdown/md-block-rule/begin-tabular/common.js.map +1 -1
  23. package/lib/markdown/md-inline-rule/core-inline.js +12 -6
  24. package/lib/markdown/md-inline-rule/core-inline.js.map +1 -1
  25. package/lib/markdown/md-inline-rule/mmd-icon.js +26 -16
  26. package/lib/markdown/md-inline-rule/mmd-icon.js.map +1 -1
  27. package/lib/markdown/md-latex-footnotes/index.js +1 -1
  28. package/lib/markdown/md-latex-footnotes/index.js.map +1 -1
  29. package/lib/markdown/md-renderer-rules/render-lists.js +4 -0
  30. package/lib/markdown/md-renderer-rules/render-lists.js.map +1 -1
  31. package/lib/markdown/md-renderer-rules/underline.js +7 -0
  32. package/lib/markdown/md-renderer-rules/underline.js.map +1 -1
  33. package/lib/markdown/md-theorem/block-rule.js +10 -0
  34. package/lib/markdown/md-theorem/block-rule.js.map +1 -1
  35. package/lib/markdown/mdPluginRaw.js +13 -7
  36. package/lib/markdown/mdPluginRaw.js.map +1 -1
  37. package/lib/markdown/mdPluginText.js +5 -2
  38. package/lib/markdown/mdPluginText.js.map +1 -1
  39. package/lib/markdown/utils.d.ts +4 -0
  40. package/lib/markdown/utils.js +58 -1
  41. package/lib/markdown/utils.js.map +1 -1
  42. package/lib/mathjax/helpers/icon/IconConfiguration.js +29 -19
  43. package/lib/mathjax/helpers/icon/IconConfiguration.js.map +1 -1
  44. package/lib/mathjax/index.d.ts +10 -0
  45. package/lib/mathjax/index.js +29 -55
  46. package/lib/mathjax/index.js.map +1 -1
  47. package/lib/mathjax/mathJaxConfig.js +1 -0
  48. package/lib/mathjax/mathJaxConfig.js.map +1 -1
  49. package/lib/mathjax/utils.d.ts +18 -0
  50. package/lib/mathjax/utils.js +91 -0
  51. package/lib/mathjax/utils.js.map +1 -0
  52. package/lib/styles/index.js +1 -1
  53. package/lib/styles/index.js.map +1 -1
  54. package/package.json +1 -1
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMathDimensions = exports.getNodeAttributes = void 0;
4
+ var Element_1 = require("mathjax-full/js/adaptors/lite/Element");
5
+ var getAttribute = function (element, attribute) {
6
+ var _a;
7
+ if (element instanceof Element_1.LiteElement) {
8
+ return ((_a = element.attributes) === null || _a === void 0 ? void 0 : _a[attribute]) || '';
9
+ }
10
+ else if (element instanceof HTMLElement || element instanceof SVGSVGElement) {
11
+ return element.getAttribute(attribute) || '';
12
+ }
13
+ return '';
14
+ };
15
+ var getStyle = function (element, style) {
16
+ var _a, _b;
17
+ if (element instanceof Element_1.LiteElement) {
18
+ return ((_a = element.styles) === null || _a === void 0 ? void 0 : _a.get(style)) || '';
19
+ }
20
+ else if (element instanceof HTMLElement || element instanceof SVGSVGElement) {
21
+ return ((_b = element.style) === null || _b === void 0 ? void 0 : _b[style]) || '';
22
+ }
23
+ return '';
24
+ };
25
+ var getNodeAttributes = function (node) {
26
+ var _a;
27
+ var attributes = {
28
+ containerWidth: '',
29
+ svgViewBox: '',
30
+ svgWidth: '',
31
+ svgMinWidth: '',
32
+ svgHeight: ''
33
+ };
34
+ try {
35
+ if (node instanceof Element_1.LiteElement) {
36
+ attributes.containerWidth = getAttribute(node, 'width');
37
+ var svgElement = ((_a = node.children) === null || _a === void 0 ? void 0 : _a.length)
38
+ ? node.children.find(function (item) { return item.kind === 'svg'; })
39
+ : null;
40
+ if (svgElement) {
41
+ attributes.svgWidth = getAttribute(svgElement, 'width');
42
+ attributes.svgMinWidth = getStyle(svgElement, 'min-width');
43
+ attributes.svgHeight = getAttribute(svgElement, 'height');
44
+ attributes.svgViewBox = getAttribute(svgElement, 'viewBox');
45
+ }
46
+ }
47
+ else {
48
+ if (node instanceof HTMLElement) {
49
+ attributes.containerWidth = getAttribute(node, 'width');
50
+ var svgElements = node.getElementsByTagName('svg');
51
+ var svgElement = svgElements.length ? svgElements[0] : null;
52
+ if (svgElement) {
53
+ attributes.svgWidth = getAttribute(svgElement, 'width');
54
+ attributes.svgMinWidth = getStyle(svgElement, 'min-width');
55
+ attributes.svgHeight = getAttribute(svgElement, 'height');
56
+ attributes.svgViewBox = getAttribute(svgElement, 'viewBox');
57
+ }
58
+ }
59
+ }
60
+ return attributes;
61
+ }
62
+ catch (err) {
63
+ console.log("[ERROR]=>[getNodeAttributes]=>", err);
64
+ return attributes;
65
+ }
66
+ };
67
+ exports.getNodeAttributes = getNodeAttributes;
68
+ var getMathDimensions = function (node) {
69
+ var _a = (0, exports.getNodeAttributes)(node), containerWidth = _a.containerWidth, svgViewBox = _a.svgViewBox, svgWidth = _a.svgWidth, svgMinWidth = _a.svgMinWidth, svgHeight = _a.svgHeight;
70
+ var normalizeExValue = function (value) {
71
+ var normalizedValue = value ? Number(value.replace(/ex/g, '')) : 0;
72
+ return isNaN(normalizedValue) ? 0 : normalizedValue;
73
+ };
74
+ if (svgWidth === '100%') {
75
+ svgWidth = svgMinWidth;
76
+ }
77
+ var widthEx = normalizeExValue(svgWidth);
78
+ var heightEx = normalizeExValue(svgHeight);
79
+ var viewBoxValues = svgViewBox ? svgViewBox.split(' ') : [];
80
+ var viewBoxHeight = (viewBoxValues === null || viewBoxValues === void 0 ? void 0 : viewBoxValues.length) > 3 ? Math.abs(Number(viewBoxValues[1])) / 1000 : 0;
81
+ var viewBoxHeightAndDepth = (viewBoxValues === null || viewBoxValues === void 0 ? void 0 : viewBoxValues.length) > 3 ? Math.abs(Number(viewBoxValues[3])) / 1000 : 0;
82
+ return {
83
+ containerWidth: containerWidth,
84
+ widthEx: widthEx,
85
+ heightEx: heightEx,
86
+ viewBoxHeight: viewBoxHeight,
87
+ viewBoxHeightAndDepth: viewBoxHeightAndDepth
88
+ };
89
+ };
90
+ exports.getMathDimensions = getMathDimensions;
91
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/mathjax/utils.ts"],"names":[],"mappings":";;;AAAA,iEAAoE;AAkBpE,IAAM,YAAY,GAAG,UAAC,OAAkD,EAAE,SAAiB;;IACzF,IAAI,OAAO,YAAY,qBAAW,EAAE;QAClC,OAAO,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAG,SAAS,CAAC,KAAI,EAAE,CAAC;KAC9C;SAAM,IAAI,OAAO,YAAY,WAAW,IAAK,OAAO,YAAY,aAAa,EAAE;QAC9E,OAAO,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KAC9C;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,IAAM,QAAQ,GAAG,UAAC,OAAkD,EAAE,KAAa;;IACjF,IAAI,OAAO,YAAY,qBAAW,EAAE;QAClC,OAAO,CAAA,MAAA,OAAO,CAAC,MAAM,0CAAE,GAAG,CAAC,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AAM,EAAE;QACvB,QAAQ,GAAG,WAAW,CAAC;KACxB;IACD,IAAI,OAAO,GAAW,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,QAAQ,GAAW,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACnD,IAAI,aAAa,GAAa,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,IAAI,aAAa,GAAW,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,IAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,GAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACpG,IAAI,qBAAqB,GAAW,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,IAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,GAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5G,OAAO;QACL,cAAc,EAAE,cAAc;QAC9B,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,QAAQ;QAClB,aAAa,EAAE,aAAa;QAC5B,qBAAqB,EAAE,qBAAqB;KAC7C,CAAA;AACH,CAAC,CAAA;AArBY,QAAA,iBAAiB,qBAqB7B"}
@@ -7,7 +7,7 @@ var MathpixStyle = function (setTextAlignJustify, useColors, maxWidth, scaleEqua
7
7
  if (useColors === void 0) { useColors = true; }
8
8
  if (maxWidth === void 0) { maxWidth = ''; }
9
9
  if (scaleEquation === void 0) { scaleEquation = true; }
10
- return "\n #setText > div {\n justify-content: inherit;\n margin-top: 0;\n margin-bottom: 1em;\n ".concat(setTextAlignJustify ? 'text-align: justify;' : '', "\n ").concat(maxWidth ? 'overflow-x: auto;' : '', "\n }\n \n ").concat(maxWidth ? '#setText > blockquote, h1, h2, h3, h4, h5, h6 { overflow-x: auto; }' : '', "\n \n #setText div:last-child {\n margin-bottom: 0 !important;\n }\n\n #setText > br, #preview-content br {\n line-height: 1.2;\n }\n\n #preview-content > div {\n margin-top: 0;\n margin-bottom: 1em;\n ").concat(setTextAlignJustify ? 'text-align: justify;' : '', "\n } \n \n .proof > div, .theorem > div {\n margin-top: 1rem;\n }\n\n #preview-content table {\n margin-bottom: 1em;\n }\n\n #setText table {\n margin-bottom: 1em;\n }\n \n #preview-content .sub-table table, #setText .sub-table table {\n margin-bottom: 0;\n }\n\n mjx-container {\n text-indent: 0;\n overflow-y: hidden;\n overflow-x: auto;\n padding-top: 1px;\n padding-bottom: 1px;\n ").concat(maxWidth ? 'max-width:' + maxWidth + ';' : '', "\n ").concat(maxWidth ? 'overflow-x: auto;' : '', "\n }\n \n ").concat(maxWidth ? 'mjx-container[jax="SVG"] > svg { overflow-x: auto; }' : '', "\n \n .math-inline mjx-container {\n display: inline-block !important;\n page-break-inside: avoid;\n max-width: 100%;\n padding: 0;\n line-height: 0;\n }\n .math-inline mjx-container mjx-assistive-mml {\n max-width: 100%;\n }\n .math-block {\n align-items: center;\n page-break-after: auto;\n page-break-inside: avoid;\n margin: 0;\n display: block; /* mjx-container has block */\n }\n \n .math-inline {\n display: inline-flex; /* mjx-container has inline-block. To prevent displacement during use overflow-x: auto;*/\n max-width: 100%;\n }\n \n .math-block[data-width=\"full\"] {\n overflow-x: auto;\n display: flex; /* mjx-container has flex */\n }\n \n svg .math-inline {\n display: initial;\n max-width: initial;\n }\n \n svg .math-inline mjx-container {\n max-width: initial;\n }\n \n svg mjx-container {\n overflow: visible;\n padding: 0;\n }\n \n svg math-block[data-width=\"full\"] {\n overflow: visible;\n }\n \n .math-block[data-highlight-color] mjx-container[jax=\"SVG\"] > svg {\n background-color: var(--mmd-highlight-color);\n } \n \n .math-block[data-highlight-text-color] mjx-container[jax=\"SVG\"] > svg {\n color: var(--mmd-highlight-text-color);\n } \n .math-inline[data-highlight-color] mjx-container[jax=\"SVG\"] {\n background-color: var(--mmd-highlight-color);\n } \n \n .math-inline[data-highlight-text-color] mjx-container[jax=\"SVG\"] {\n color: var(--mmd-highlight-text-color);\n }\n \n .math-block p {\n flex-shrink: 1;\n }\n .math-block mjx-container {\n margin: 0 !important;\n }\n .math-error {\n background-color: yellow;\n color: red;\n }\n\n #preview-content img, #setText img {\n max-width: 100%;\n }\n \n #preview-content blockquote, #setText blockquote {\n page-break-inside: avoid;\n ").concat(useColors ? 'color: #666;' : '', "\n margin: 0 0 1em 0;\n padding-left: 3em;\n border-left: .5em solid #eee;\n }\n\n #preview-content pre, #setText pre {\n border: none;\n padding: 0;\n overflow: auto;\n font-size: 85%;\n line-height: 1.45;\n border-radius: 6px;\n box-sizing: border-box;\n ").concat(useColors ? 'background: #f8f8fa;' : '', "\n }\n #preview-content pre code, #setText pre code{\n padding: 1rem;\n display: block;\n overflow-x: auto;\n line-height: 24px;\n }\n .empty {\n text-align: center;\n font-size: 18px;\n padding: 50px 0 !important;\n }\n\n #setText table, #preview-content table {\n display: table; \n overflow: auto;\n max-width: 100%;\n border-collapse: collapse;\n page-break-inside: avoid;\n }\n \n #setText table th, #preview-content table th {\n text-align: center;\n font-weight: bold;\n }\n \n #setText table td, #preview-content table td,\n #setText table th, #preview-content table th {\n border: 1px solid #dfe2e5;\n padding: 6px 13px;\n }\n \n #setText table tr, #preview-content table tr {\n ").concat(useColors ? 'background-color: #fff;' : '', "\n border-top: 1px solid ").concat(useColors ? '#c6cbd1' : 'currentColor', ";\n }\n \n #setText table tr:nth-child(2n), #preview-content table tr:nth-child(2n) {\n ").concat(useColors ? 'background-color: #f6f8fa;' : '', "\n }\n\n \n #setText .main-title, #setText .author, #preview-content .main-title, #preview-content .author {\n text-align: center;\n margin: 0 auto;\n }\n \n #preview-content .main-title, #setText .main-title {\n line-height: 1.2;\n margin-bottom: 1em;\n }\n\n #preview-content .author, #setText .author {\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n }\n\n #preview-content .author p, #setText .author p {\n min-width: 30%;\n max-width: 50%;\n padding: 0 7px;\n }\n\n #preview-content .author > p > span, #setText .author > p > span {\n display: block;\n text-align: center;\n }\n\n #preview-content .section-title, #setText .section-title {\n margin-top: 1.5em;\n }\n\n #preview-content .abstract, #setText .abstract {\n text-align: justify;\n margin-bottom: 1em;\n }\n\n #preview-content .abstract p, #setText .abstract p {\n margin-bottom: 0;\n }\n\n @media print {\n\n #preview {\n font-size: 10pt!important;\n }\n\n svg {\n shape-rendering: crispEdges;\n }\n\n .math-block svg, math-inline svg {\n margin-top: 1px;\n }\n\n #preview-content img, #setText img {\n display: block;\n }\n \n #preview-content .figure_img img, #setText .figure_img img {\n display: inline;\n }\n\n .preview-right {\n word-break: break-word;\n }\n\n #preview-content h1, #setText h1 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h1::after, #setText h1::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h2, #setText h2 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h2::after, #setText h2::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h3, #setText h3 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h3::after, #setText h3::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h4, #setText h4 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h4::after, #setText h4::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h5, #setText h5 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h5::after, #setText h5::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h6, #setText h6 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h6::after, #setText h6::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n }\n #preview-content sup, #setText sup {\n top: -.5em;\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n }\n \n #preview-content .text-url, #setText .text-url {\n ").concat(useColors ? 'color: #0B93ff;' : '', "\n cursor: text;\n pointer-events: none;\n }\n \n #preview-content .text-url a:hover, #setText .text-url a:hover {\n ").concat(useColors ? 'color: #0B93ff;' : '', "\n }\n \n mark {\n background-color: #feffe6;\n }\n \n span[data-underline-type] mark {\n background: inherit;\n background-color: #feffe6;\n padding-top: 0;\n padding-bottom: 0;\n }\n \n *[data-has-dotfill] {\n position: relative;\n overflow: hidden;\n }\n \n *[data-has-dotfill] .dotfill::after {\n position: absolute;\n padding-left: .25ch;\n content: \" . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \";\n text-align: right;\n }\n \n .smiles {\n text-align: center;\n }\n\n div.svg-container, #setText > div.svg-container {\n display: flex;\n justify-content: center;\n }\n");
10
+ return "\n #setText > div {\n justify-content: inherit;\n margin-top: 0;\n margin-bottom: 1em;\n ".concat(setTextAlignJustify ? 'text-align: justify;' : '', "\n ").concat(maxWidth ? 'overflow-x: auto;' : '', "\n }\n \n ").concat(maxWidth ? '#setText > blockquote, h1, h2, h3, h4, h5, h6 { overflow-x: auto; }' : '', "\n \n #setText div:last-child {\n margin-bottom: 0 !important;\n }\n\n #setText > br, #preview-content br {\n line-height: 1.2;\n }\n\n #preview-content > div {\n margin-top: 0;\n margin-bottom: 1em;\n ").concat(setTextAlignJustify ? 'text-align: justify;' : '', "\n } \n \n .proof > div, .theorem > div {\n margin-top: 1rem;\n }\n\n #preview-content table {\n margin-bottom: 1em;\n }\n\n #setText table {\n margin-bottom: 1em;\n }\n \n #preview-content .sub-table table, #setText .sub-table table {\n margin-bottom: 0;\n }\n\n mjx-container {\n text-indent: 0;\n overflow-y: hidden;\n overflow-x: auto;\n padding-top: 1px;\n padding-bottom: 1px;\n ").concat(maxWidth ? 'max-width:' + maxWidth + ';' : '', "\n ").concat(maxWidth ? 'overflow-x: auto;' : '', "\n }\n \n ").concat(maxWidth ? 'mjx-container[jax="SVG"] > svg { overflow-x: auto; }' : '', "\n \n .math-inline mjx-container {\n display: inline-block !important;\n page-break-inside: avoid;\n max-width: 100%;\n padding: 0;\n line-height: 0;\n }\n .math-inline[data-overflow=\"visible\"] mjx-container {\n overflow: visible;\n }\n .math-inline mjx-container mjx-assistive-mml {\n max-width: 100%;\n }\n .math-block {\n align-items: center;\n page-break-after: auto;\n page-break-inside: avoid;\n margin: 0;\n display: block; /* mjx-container has block */\n }\n \n .math-inline {\n display: inline-flex; /* mjx-container has inline-block. To prevent displacement during use overflow-x: auto;*/\n max-width: 100%;\n }\n \n .math-block[data-width=\"full\"] {\n overflow-x: auto;\n display: flex; /* mjx-container has flex */\n }\n \n svg .math-inline {\n display: initial;\n max-width: initial;\n }\n \n svg .math-inline mjx-container {\n max-width: initial;\n }\n \n svg mjx-container {\n overflow: visible;\n padding: 0;\n }\n \n svg math-block[data-width=\"full\"] {\n overflow: visible;\n }\n \n .math-block[data-highlight-color] mjx-container[jax=\"SVG\"] > svg {\n background-color: var(--mmd-highlight-color);\n } \n \n .math-block[data-highlight-text-color] mjx-container[jax=\"SVG\"] > svg {\n color: var(--mmd-highlight-text-color);\n } \n .math-inline[data-highlight-color] mjx-container[jax=\"SVG\"] {\n background-color: var(--mmd-highlight-color);\n } \n \n .math-inline[data-highlight-text-color] mjx-container[jax=\"SVG\"] {\n color: var(--mmd-highlight-text-color);\n }\n \n .math-block p {\n flex-shrink: 1;\n }\n .math-block mjx-container {\n margin: 0 !important;\n }\n .math-error {\n background-color: yellow;\n color: red;\n }\n\n #preview-content img, #setText img {\n max-width: 100%;\n }\n \n #preview-content blockquote, #setText blockquote {\n page-break-inside: avoid;\n ").concat(useColors ? 'color: #666;' : '', "\n margin: 0 0 1em 0;\n padding-left: 3em;\n border-left: .5em solid #eee;\n }\n\n #preview-content pre, #setText pre {\n border: none;\n padding: 0;\n overflow: auto;\n font-size: 85%;\n line-height: 1.45;\n border-radius: 6px;\n box-sizing: border-box;\n ").concat(useColors ? 'background: #f8f8fa;' : '', "\n }\n #preview-content pre code, #setText pre code{\n padding: 1rem;\n display: block;\n overflow-x: auto;\n line-height: 24px;\n }\n .empty {\n text-align: center;\n font-size: 18px;\n padding: 50px 0 !important;\n }\n\n #setText table, #preview-content table {\n display: table; \n overflow: auto;\n max-width: 100%;\n border-collapse: collapse;\n page-break-inside: avoid;\n }\n \n #setText table th, #preview-content table th {\n text-align: center;\n font-weight: bold;\n }\n \n #setText table td, #preview-content table td,\n #setText table th, #preview-content table th {\n border: 1px solid #dfe2e5;\n padding: 6px 13px;\n }\n \n #setText table tr, #preview-content table tr {\n ").concat(useColors ? 'background-color: #fff;' : '', "\n border-top: 1px solid ").concat(useColors ? '#c6cbd1' : 'currentColor', ";\n }\n \n #setText table tr:nth-child(2n), #preview-content table tr:nth-child(2n) {\n ").concat(useColors ? 'background-color: #f6f8fa;' : '', "\n }\n\n \n #setText .main-title, #setText .author, #preview-content .main-title, #preview-content .author {\n text-align: center;\n margin: 0 auto;\n }\n \n #preview-content .main-title, #setText .main-title {\n line-height: 1.2;\n margin-bottom: 1em;\n }\n\n #preview-content .author, #setText .author {\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n }\n\n #preview-content .author p, #setText .author p {\n min-width: 30%;\n max-width: 50%;\n padding: 0 7px;\n }\n\n #preview-content .author > p > span, #setText .author > p > span {\n display: block;\n text-align: center;\n }\n\n #preview-content .section-title, #setText .section-title {\n margin-top: 1.5em;\n }\n\n #preview-content .abstract, #setText .abstract {\n text-align: justify;\n margin-bottom: 1em;\n }\n\n #preview-content .abstract p, #setText .abstract p {\n margin-bottom: 0;\n }\n\n @media print {\n\n #preview {\n font-size: 10pt!important;\n }\n\n svg {\n shape-rendering: crispEdges;\n }\n\n .math-block svg, math-inline svg {\n margin-top: 1px;\n }\n\n #preview-content img, #setText img {\n display: block;\n }\n \n #preview-content .figure_img img, #setText .figure_img img {\n display: inline;\n }\n\n .preview-right {\n word-break: break-word;\n }\n\n #preview-content h1, #setText h1 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h1::after, #setText h1::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h2, #setText h2 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h2::after, #setText h2::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h3, #setText h3 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h3::after, #setText h3::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h4, #setText h4 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h4::after, #setText h4::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h5, #setText h5 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h5::after, #setText h5::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n \n #preview-content h6, #setText h6 {\n page-break-inside: avoid;\n position: relative;\n border: 2px solid transparent;\n }\n \n #preview-content h6::after, #setText h6::after {\n content: \"\";\n display: block;\n height: 100px;\n margin-bottom: -100px;\n position: relative;\n }\n }\n #preview-content sup, #setText sup {\n top: -.5em;\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n }\n \n #preview-content .text-url, #setText .text-url {\n ").concat(useColors ? 'color: #0B93ff;' : '', "\n cursor: text;\n pointer-events: none;\n }\n \n #preview-content .text-url a:hover, #setText .text-url a:hover {\n ").concat(useColors ? 'color: #0B93ff;' : '', "\n }\n \n mark {\n background-color: #feffe6;\n }\n \n span[data-underline-type] mark {\n background: inherit;\n background-color: #feffe6;\n padding-top: 0;\n padding-bottom: 0;\n }\n \n *[data-has-dotfill] {\n position: relative;\n overflow: hidden;\n }\n \n *[data-has-dotfill] .dotfill::after {\n position: absolute;\n padding-left: .25ch;\n content: \" . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \"\n \". . . . . . . . . . . . . . . . . . . . . . . \";\n text-align: right;\n }\n \n .smiles {\n text-align: center;\n }\n\n div.svg-container, #setText > div.svg-container {\n display: flex;\n justify-content: center;\n }\n");
11
11
  };
12
12
  exports.MathpixStyle = MathpixStyle;
13
13
  exports.PreviewStyle = "\n #preview {\n font-family: 'CMU Serif', 'Georgia', Helvetica, Arial, sans-serif;\n font-size: 17px;\n visibility: visible;\n word-break: break-word;\n padding: 2.5em;\n max-width: 800px;\n margin: auto;\n box-sizing: content-box;\n }\n\n #preview h1, #preview h2, #preview h3, #preview h4, #preview h5, #preview strong {\n font-family: 'CMU Serif Bold', 'Georgia', Helvetica, Arial, sans-serif;\n }\n\n #preview i, #preview em {\n font-family: 'CMU Serif Italic', 'Georgia', Helvetica, Arial, sans-serif;\n }\n";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":";;;AAA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AC,CAAC,CAAC,cAAc,qHAI5D,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,u3HAmK/C,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,0JAMlC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,yiCAwCzC,CAAA;AAAA,CAAC,CAAC;AA7YU,QAAA,YAAY,gBA6YtB;AAEU,QAAA,YAAY,GAAG,wiBAmB3B,CAAC;AAEK,IAAM,QAAQ,GAAG,UAAC,aAA6B;IAA7B,8BAAA,EAAA,qBAA6B;IAAK,OAAA,eACtD,aAAa,qsCAoDjB;AArD0D,CAqD1D,CAAC;AArDW,QAAA,QAAQ,YAqDnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mathpix-markdown-it",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Mathpix-markdown-it is an open source implementation of the mathpix-markdown spec written in Typescript. It relies on the following open source libraries: MathJax v3 (to render math with SVGs), markdown-it (for standard Markdown parsing)",
5
5
  "keywords": [
6
6
  "MathJax",