Skip to content

Commit

Permalink
chore(release): 0.6.11
Browse files Browse the repository at this point in the history
  • Loading branch information
humyfred committed Mar 17, 2022
1 parent 4dc2a7e commit 3d7ab86
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 32 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.6.11](https://github.com/Tencent/cherry-markdown/compare/v0.6.10...v0.6.11) (2022-03-17)


### Bug Fixes

* replace lookbehind in math regex ([4dc2a7e](https://github.com/Tencent/cherry-markdown/commit/4dc2a7ee9bbed0da99d270e360c45614a35a543a))

### [0.6.10](https://github.com/Tencent/cherry-markdown/compare/v0.6.9...v0.6.10) (2022-03-17)

### [0.6.9](https://github.com/Tencent/cherry-markdown/compare/v0.6.8...v0.6.9) (2022-03-14)
Expand Down
2 changes: 1 addition & 1 deletion dist/cherry-markdown.core.common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cherry-markdown.core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cherry-markdown.engine.core.common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cherry-markdown.engine.core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cherry-markdown.esm.js

Large diffs are not rendered by default.

58 changes: 34 additions & 24 deletions dist/cherry-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -32163,7 +32163,7 @@

_createClass(MathBlock, [{
key: "toHtml",
value: function toHtml(wholeMatch, lineSpace, content) {
value: function toHtml(wholeMatch, lineSpace, leadingChar, content) {
var _this$MathJax, _context5, _context6;

bind$5(LoadMathModule).call(LoadMathModule, this)('engine'); // 去掉开头的空字符,去掉结尾的换行符
Expand Down Expand Up @@ -32198,7 +32198,7 @@

var _result = concat$5(_context = concat$5(_context2 = "<div data-sign=\"".concat(sign, "\" class=\"Cherry-Math\" data-type=\"mathBlock\"\n data-lines=\"")).call(_context2, lines, "\">")).call(_context, html, "</div>");

return this.getCacheWithSpace(this.pushCache(_result, sign, lines), wholeMatch);
return leadingChar + this.getCacheWithSpace(this.pushCache(_result, sign, lines), wholeMatch);
}

if ((_this$MathJax = this.MathJax) !== null && _this$MathJax !== void 0 && _this$MathJax.tex2svg) {
Expand All @@ -32209,22 +32209,26 @@

var _result2 = concat$5(_context3 = concat$5(_context4 = "<div data-sign=\"".concat(sign, "\" class=\"Cherry-Math\" data-type=\"mathBlock\"\n data-lines=\"")).call(_context4, lines, "\">")).call(_context3, svg, "</div>");

return this.getCacheWithSpace(this.pushCache(_result2, sign, lines), wholeMatch);
return leadingChar + this.getCacheWithSpace(this.pushCache(_result2, sign, lines), wholeMatch);
} // 既无MathJax又无katex时,原样输出


var result = concat$5(_context5 = concat$5(_context6 = "<div data-sign=\"".concat(sign, "\" class=\"Cherry-Math\" data-type=\"mathBlock\"\n data-lines=\"")).call(_context6, lines, "\">$$")).call(_context5, escapeFormulaPunctuations(content), "$$</div>");

return this.getCacheWithSpace(this.pushCache(result, sign, lines), wholeMatch);
return leadingChar + this.getCacheWithSpace(this.pushCache(result, sign, lines), wholeMatch);
}
}, {
key: "beforeMakeHtml",
value: function beforeMakeHtml(str) {
var _context7;
var _context8;

var $str = str;
$str = $str.replace(this.RULE.reg, bind$5(_context7 = this.toHtml).call(_context7, this));
return $str;
if (isLookbehindSupported()) {
var _context7;

return str.replace(this.RULE.reg, bind$5(_context7 = this.toHtml).call(_context7, this));
}

return replaceLookbehind(str, this.RULE.reg, bind$5(_context8 = this.toHtml).call(_context8, this), true, 1);
}
}, {
key: "makeHtml",
Expand All @@ -32235,9 +32239,9 @@
key: "rule",
value: function rule() {
var ret = {
begin: '(\\s*)(?<!\\\\)~D~D\\s*',
end: '\\s*(?<!\\\\)~D~D(?:\\s{0,1})',
content: '([\\w\\W]*?)'
begin: isLookbehindSupported() ? '(\\s*)((?<!\\\\))~D~D\\s*' : '(\\s*)(^|[^\\\\])~D~D\\s*',
content: '([\\w\\W]*?)',
end: '(\\s*)~D~D(?:\\s{0,1})'
};
ret.reg = new RegExp(ret.begin + ret.content + ret.end, 'g');
return ret;
Expand Down Expand Up @@ -32289,8 +32293,8 @@

_createClass(InlineMath, [{
key: "toHtml",
value: function toHtml(wholeMatch, m1) {
var _this$katex, _this$MathJax, _context3;
value: function toHtml(wholeMatch, leadingChar, m1) {
var _this$katex, _this$MathJax, _context5, _context6;

if (!m1) {
return wholeMatch;
Expand All @@ -32303,20 +32307,20 @@
var sign = this.$engine.md5(wholeMatch);

if (this.engine === 'katex' && (_this$katex = this.katex) !== null && _this$katex !== void 0 && _this$katex.renderToString) {
var _context;
var _context, _context2;

// katex渲染
var html = this.katex.renderToString(m1, {
throwOnError: false
});

var _result = concat$5(_context = "<span class=\"Cherry-InlineMath\" data-type=\"mathBlock\" data-lines=\"".concat(lines, "\">")).call(_context, html, "</span>");
var _result = concat$5(_context = concat$5(_context2 = "".concat(leadingChar, "<span class=\"Cherry-InlineMath\" data-type=\"mathBlock\" data-lines=\"")).call(_context2, lines, "\">")).call(_context, html, "</span>");

return this.pushCache(_result, ParagraphBase.IN_PARAGRAPH_CACHE_KEY_PREFIX + sign);
}

if ((_this$MathJax = this.MathJax) !== null && _this$MathJax !== void 0 && _this$MathJax.tex2svg) {
var _context2;
var _context3, _context4;

// MathJax渲染
var svg = getHTML(this.MathJax.tex2svg(m1, {
Expand All @@ -32325,26 +32329,32 @@
display: false
}), true);

var _result2 = concat$5(_context2 = "<span class=\"Cherry-InlineMath\" data-type=\"mathBlock\" data-lines=\"".concat(lines, "\">")).call(_context2, svg, "</span>");
var _result2 = concat$5(_context3 = concat$5(_context4 = "".concat(leadingChar, "<span class=\"Cherry-InlineMath\" data-type=\"mathBlock\" data-lines=\"")).call(_context4, lines, "\">")).call(_context3, svg, "</span>");

return this.pushCache(_result2, ParagraphBase.IN_PARAGRAPH_CACHE_KEY_PREFIX + sign);
} // 既无MathJax又无katex时,原样输出


var result = concat$5(_context3 = "<span class=\"Cherry-InlineMath\" data-type=\"mathBlock\"\n data-lines=\"".concat(lines, "\">$")).call(_context3, escapeFormulaPunctuations(m1), "$</span>");
var result = concat$5(_context5 = concat$5(_context6 = "".concat(leadingChar, "<span class=\"Cherry-InlineMath\" data-type=\"mathBlock\"\n data-lines=\"")).call(_context6, lines, "\">$")).call(_context5, escapeFormulaPunctuations(m1), "$</span>");

return this.pushCache(result, ParagraphBase.IN_PARAGRAPH_CACHE_KEY_PREFIX + sign);
}
}, {
key: "beforeMakeHtml",
value: function beforeMakeHtml(str) {
var _context4;
var _context8;

if (!this.test(str)) {
return str;
}

return str.replace(this.RULE.reg, bind$5(_context4 = this.toHtml).call(_context4, this));
if (isLookbehindSupported()) {
var _context7;

return str.replace(this.RULE.reg, bind$5(_context7 = this.toHtml).call(_context7, this));
}

return replaceLookbehind(str, this.RULE.reg, bind$5(_context8 = this.toHtml).call(_context8, this), true, 1);
}
}, {
key: "makeHtml",
Expand All @@ -32355,9 +32365,9 @@
key: "rule",
value: function rule() {
var ret = {
begin: '(?<!\\\\)~D\\n?',
end: '(?<!\\\\)~D',
content: '(.*?)\\n?'
begin: isLookbehindSupported() ? '((?<!\\\\))~D\\n?' : '(^|[^\\\\])~D\\n?',
content: '(.*?)\\n?',
end: '~D'
};
ret.reg = new RegExp(ret.begin + ret.content + ret.end, 'g');
return ret;
Expand Down Expand Up @@ -84246,7 +84256,7 @@
});
}

var VERSION = "0.6.10-64f1001b";
var VERSION = "0.6.11-4dc2a7ee";
var CherryStatic = /*#__PURE__*/function () {
function CherryStatic() {
_classCallCheck(this, CherryStatic);
Expand Down
2 changes: 1 addition & 1 deletion dist/cherry-markdown.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cherry-markdown.min.js

Large diffs are not rendered by default.

Binary file modified dist/fonts/ch-icon.eot
Binary file not shown.
Binary file modified dist/fonts/ch-icon.ttf
Binary file not shown.
Binary file modified dist/fonts/ch-icon.woff
Binary file not shown.
Binary file modified dist/fonts/ch-icon.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cherry-markdown",
"license": "Apache-2.0",
"version": "0.6.10",
"version": "0.6.11",
"description": "a new markdown editor",
"repository": {
"type": "git",
Expand Down

0 comments on commit 3d7ab86

Please sign in to comment.