Skip to content

Commit

Permalink
2.43.14
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 authored Jul 5, 2022
2 parents efa72ca + ac8acd3 commit 1f886eb
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/css/suneditor.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/suneditor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suneditor",
"version": "2.43.13",
"version": "2.43.14",
"description": "Pure JavaScript based WYSIWYG web editor",
"author": "JiHong.Lee",
"license": "MIT",
Expand Down
5 changes: 5 additions & 0 deletions src/assets/css/suneditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

/** --- Icons ---------------------------------------------------------- */
/* default svg */
.sun-editor svg {
fill: currentColor;
}
.sun-editor button > svg, .sun-editor .se-svg {
width: 16px;
height: 16px;
Expand Down Expand Up @@ -340,6 +343,8 @@
.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-math-preview {font-size:13px;}
.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-math-preview > span {display:inline-block; -webkit-box-shadow:0 0 0 0.1rem #c7deff; box-shadow:0 0 0 0.1rem #c7deff;}
.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-math-preview > span * {direction:ltr;}
.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-math-preview > .se-math-katex-error {color:#b94a48; -webkit-box-shadow:0 0 0 0.1rem #f2dede; box-shadow:0 0 0 0.1rem #f2dede;}
.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-math-preview > .se-math-katex-error svg {width:auto; height:30px; color:#b94a48;}
/* dialog - modal - link preview */
.sun-editor .se-dialog .se-dialog-inner .se-link-preview {display:block; height:auto; max-height:18px; font-size:13px; font-weight:normal; font-family:inherit; color:#666; background-color:transparent; overflow:hidden; text-overflow:ellipsis; word-break:break-all; white-space:pre;}
/* dialog - modal - anchor module */
Expand Down
2 changes: 2 additions & 0 deletions src/assets/defaultIcons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/plugins/dialog/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,14 @@ export default {
},

_renderer: function (exp) {
const katex = this.options.katex;
return katex.src.renderToString(exp, {throwOnError: true, displayMode: true});
let result = '';
try {
result = this.options.katex.src.renderToString(exp, {throwOnError: true, displayMode: true});
} catch(error) {
result = '<span class="se-math-katex-error">' + error + '</span>';
console.warn('[SUNEDITOR.math.Katex.error] ', error);
}
return result;
},

_renderMathExp: function (contextMath, e) {
Expand Down
16 changes: 13 additions & 3 deletions test/dev/suneditor_build_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,19 @@ function ResizeImage (files, uploadHandler) {
// uploadHandler(response);
// }

// ss.onImageUpload = function (targetElement, index, state, info, core) {
// console.log('imageInfo-----', info);
// }
ss.onImageUpload = function (targetElement, index, state, info, uploadedFileLength, core) {
console.log('imageInfo-----', info);
if (!targetElement) return;
const component = core.getFileComponent(targetElement).component;
const p = core.util.createElement('p');
p.innerHTML = '<br>';
if (!component.nextElementSibling) {
core.context.element.wysiwyg.appendChild(p.cloneNode(true))
}
if (!component.previousElementSibling) {
core.context.element.wysiwyg.insertBefore(p.cloneNode(true), component);
}
}

ss.showInline = function (toolbar, context) {

Expand Down

0 comments on commit 1f886eb

Please sign in to comment.