acsi-core 0.9.6 → 0.9.7
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.
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +8 -6
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -9,9 +9,7 @@ import { FormGroup, Input, Label, Modal, ModalHeader, ModalBody, ModalFooter, To
|
|
|
9
9
|
import ReactSelect, { components } from 'react-select';
|
|
10
10
|
import ReactMarkdown from 'react-markdown';
|
|
11
11
|
import remarkMath from 'remark-math';
|
|
12
|
-
import remarkGfm from 'remark-gfm';
|
|
13
12
|
import rehypeKatex from 'rehype-katex';
|
|
14
|
-
import remarkRehype from 'remark-rehype';
|
|
15
13
|
import rehypeRaw from 'rehype-raw';
|
|
16
14
|
import 'katex/dist/katex.min.css';
|
|
17
15
|
import Cookies from 'js-cookie';
|
|
@@ -1712,7 +1710,7 @@ var MarkdownLatexRender = function MarkdownLatexRender(_ref) {
|
|
|
1712
1710
|
var content = _ref.content;
|
|
1713
1711
|
var updatedMarkdown = formatContent(content);
|
|
1714
1712
|
return React.createElement("span", null, React.createElement(ReactMarkdown, {
|
|
1715
|
-
remarkPlugins: [remarkMath
|
|
1713
|
+
remarkPlugins: [remarkMath],
|
|
1716
1714
|
rehypePlugins: [rehypeKatex, rehypeRaw],
|
|
1717
1715
|
components: {
|
|
1718
1716
|
p: function p(_ref2) {
|
|
@@ -1723,14 +1721,18 @@ var MarkdownLatexRender = function MarkdownLatexRender(_ref) {
|
|
|
1723
1721
|
}, updatedMarkdown));
|
|
1724
1722
|
};
|
|
1725
1723
|
function formatContent(content) {
|
|
1724
|
+
if (!content || content.trim() === "") {
|
|
1725
|
+
return content;
|
|
1726
|
+
}
|
|
1726
1727
|
var lines = content.split("\n");
|
|
1727
1728
|
var result = [];
|
|
1728
1729
|
var i = 0;
|
|
1729
1730
|
while (i < lines.length) {
|
|
1730
1731
|
var line = lines[i];
|
|
1731
|
-
var
|
|
1732
|
-
|
|
1733
|
-
|
|
1732
|
+
var formatText = LatexExtractor.ApplyLatexFormat(line);
|
|
1733
|
+
var newline = formatText.trim();
|
|
1734
|
+
if (newline !== line) {
|
|
1735
|
+
result.push(newline);
|
|
1734
1736
|
i++;
|
|
1735
1737
|
continue;
|
|
1736
1738
|
}
|