Skip to content

Commit

Permalink
chore(release): 0.6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
humyfred committed Feb 28, 2022
1 parent 2b8cb1a commit c09dc9f
Show file tree
Hide file tree
Showing 15 changed files with 11,094 additions and 10,956 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

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.8](https://github.com/Tencent/cherry-markdown/compare/v0.6.7...v0.6.8) (2022-02-28)


### Features

* add commonmark test suites ([ef2c950](https://github.com/Tencent/cherry-markdown/commit/ef2c950f03cbc391018fd57655d8413bb37aa780))
* add commonmark test suites ([c2e0c56](https://github.com/Tencent/cherry-markdown/commit/c2e0c56acdc2b19a52b623d6ba9fe352013063b4))
* add commonmark test suites ([44287e3](https://github.com/Tencent/cherry-markdown/commit/44287e3b39adea318c9a1832467811c61b77ded4))
* improve content cache for paragraph ([a7661d7](https://github.com/Tencent/cherry-markdown/commit/a7661d70fa65f0749758abe60ed128bd4f6568bb))


### Bug Fixes

* eslint fix & list test case fix ([2b8cb1a](https://github.com/Tencent/cherry-markdown/commit/2b8cb1a55d5922cd4c2396061a558aa9b68fd3e3))

### [0.6.7](https://github.com/Tencent/cherry-markdown/compare/v0.6.6...v0.6.7) (2022-02-28)


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.

79 changes: 57 additions & 22 deletions dist/cherry-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -20059,7 +20059,8 @@
_classCallCheck(this, ParagraphBase);

_this = _super.call(this, {});
_this.cacheState = !!needCache;
_this.needCache = !!needCache;
_this.sign = '';

if (needCache) {
_this.cache = defaultCache || {};
Expand All @@ -20071,6 +20072,11 @@
}

_createClass(ParagraphBase, [{
key: "toHtml",
value: function toHtml(str, sentenceMakeFunc) {
return str;
}
}, {
key: "makeHtml",
value: function makeHtml(str, sentenceMakeFunc) {
return sentenceMakeFunc(str).html;
Expand Down Expand Up @@ -20219,31 +20225,42 @@
var sign = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var lineCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;

if (!this.cacheState) {
if (!this.needCache) {
return;
}

var $sign = sign || this.$engine.md5(str);
this.cache[$sign] = str;
this.cache[$sign] = {
content: str,
using: true
};
return concat$5(_context4 = concat$5(_context5 = "".concat(this.cacheKey, "I")).call(_context5, $sign, "_L")).call(_context4, lineCount, "$");
}
}, {
key: "popCache",
value: function popCache(sign) {
if (!this.cacheState) {
if (!this.needCache) {
return;
}

return this.cache[sign] || '';
return this.cache[sign].content || '';
}
}, {
key: "resetCache",
value: function resetCache(defaultCache) {
if (!this.cacheState) {
value: function resetCache() {
if (!this.needCache) {
return;
}

this.cache = defaultCache || {};
for (var _i = 0, _Object$keys = keys$3(this.cache); _i < _Object$keys.length; _i++) {
var key = _Object$keys[_i];
if (!this.cache[key].using) delete this.cache[key];
}

for (var _i2 = 0, _Object$keys3 = keys$3(this.cache); _i2 < _Object$keys3.length; _i2++) {
var _key = _Object$keys3[_i2];
this.cache[_key].using = false;
}
}
}, {
key: "restoreCache",
Expand All @@ -20252,7 +20269,7 @@
_this2 = this;

// restore cached content
if (!this.cacheState) {
if (!this.needCache) {
return html;
}

Expand All @@ -20263,6 +20280,27 @@
this.resetCache();
return $html;
}
/**
*
* @param {string} wholeMatch whole match
*/

}, {
key: "checkCache",
value: function checkCache(wholeMatch, sentenceMakeFunc) {
var _context7, _context8;

var lineCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
this.sign = this.$engine.md5(wholeMatch); // miss cache

if (!this.cache[this.sign]) {
return this.toHtml(wholeMatch, sentenceMakeFunc);
} // hit & mark cache


this.cache[this.sign].using = true;
return concat$5(_context7 = concat$5(_context8 = "".concat(this.cacheKey, "I")).call(_context8, this.sign, "_L")).call(_context7, lineCount, "$");
}
}, {
key: "mounted",
value: function mounted() {// console.log('base mounted');
Expand Down Expand Up @@ -31288,10 +31326,15 @@
}
}, {
key: "toHtml",
value: function toHtml(text, sentenceMakeFunc) {
this.sign = this.$engine.md5(text);
value: function toHtml(wholeMatch, sentenceMakeFunc) {
var _wholeMatch$match$len, _wholeMatch$match;

// 行数计算吸收的空行
this.emptyLines = (_wholeMatch$match$len = (_wholeMatch$match = wholeMatch.match(/^\n\n/)) === null || _wholeMatch$match === void 0 ? void 0 : _wholeMatch$match.length) !== null && _wholeMatch$match$len !== void 0 ? _wholeMatch$match$len : 0;
var text = wholeMatch.replace(/~0$/g, '').replace(/^\n+/, '');
this.buildTree(makeChecklist(text), sentenceMakeFunc);
return this.renderTree(0);
var result = this.renderTree(0);
return this.pushCache(result, this.sign);
}
}, {
key: "makeHtml",
Expand All @@ -31302,15 +31345,7 @@

if (this.test($str)) {
$str = $str.replace(this.RULE.reg, function (wholeMatch) {
var _wholeMatch$match$len, _wholeMatch$match;

// 行数计算吸收的空行
_this4.emptyLines = (_wholeMatch$match$len = (_wholeMatch$match = wholeMatch.match(/^\n\n/)) === null || _wholeMatch$match === void 0 ? void 0 : _wholeMatch$match.length) !== null && _wholeMatch$match$len !== void 0 ? _wholeMatch$match$len : 0;
var text = wholeMatch.replace(/~0$/g, '').replace(/^\n+/, '');

var result = _this4.toHtml(text, sentenceMakeFunc);

return _this4.getCacheWithSpace(_this4.pushCache(result, _this4.sign), wholeMatch);
return _this4.getCacheWithSpace(_this4.checkCache(wholeMatch, sentenceMakeFunc), wholeMatch);
});
}

Expand Down Expand Up @@ -84199,7 +84234,7 @@
});
}

var VERSION = "0.6.7-77c750d3";
var VERSION = "0.6.8-2b8cb1a5";
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.7",
"version": "0.6.8",
"description": "a new markdown editor",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit c09dc9f

Please sign in to comment.