@toast-ui/editor 3.1.5 → 3.1.8

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/dist/esm/i18n/ar.js +1 -1
  2. package/dist/esm/i18n/cs-cz.js +1 -1
  3. package/dist/esm/i18n/de-de.js +1 -1
  4. package/dist/esm/i18n/en-us.js +1 -1
  5. package/dist/esm/i18n/es-es.js +1 -1
  6. package/dist/esm/i18n/fi-fi.js +1 -1
  7. package/dist/esm/i18n/fr-fr.js +1 -1
  8. package/dist/esm/i18n/gl-es.js +1 -1
  9. package/dist/esm/i18n/hr-hr.js +1 -1
  10. package/dist/esm/i18n/i18n.js +1 -1
  11. package/dist/esm/i18n/it-it.js +1 -1
  12. package/dist/esm/i18n/ja-jp.js +1 -1
  13. package/dist/esm/i18n/ko-kr.js +1 -1
  14. package/dist/esm/i18n/nb-no.js +1 -1
  15. package/dist/esm/i18n/nl-nl.js +1 -1
  16. package/dist/esm/i18n/pl-pl.js +1 -1
  17. package/dist/esm/i18n/pt-br.js +1 -1
  18. package/dist/esm/i18n/ru-ru.js +1 -1
  19. package/dist/esm/i18n/sv-se.js +1 -1
  20. package/dist/esm/i18n/tr-tr.js +1 -1
  21. package/dist/esm/i18n/uk-ua.js +1 -1
  22. package/dist/esm/i18n/zh-cn.js +1 -1
  23. package/dist/esm/i18n/zh-tw.js +1 -1
  24. package/dist/esm/index.js +76 -21
  25. package/dist/esm/indexViewer.js +8 -3
  26. package/dist/i18n/ar.js +1 -1
  27. package/dist/i18n/cs-cz.js +1 -1
  28. package/dist/i18n/de-de.js +1 -1
  29. package/dist/i18n/es-es.js +1 -1
  30. package/dist/i18n/fi-fi.js +1 -1
  31. package/dist/i18n/fr-fr.js +1 -1
  32. package/dist/i18n/gl-es.js +1 -1
  33. package/dist/i18n/hr-hr.js +1 -1
  34. package/dist/i18n/it-it.js +1 -1
  35. package/dist/i18n/ja-jp.js +1 -1
  36. package/dist/i18n/ko-kr.js +1 -1
  37. package/dist/i18n/nb-no.js +1 -1
  38. package/dist/i18n/nl-nl.js +1 -1
  39. package/dist/i18n/pl-pl.js +1 -1
  40. package/dist/i18n/pt-br.js +1 -1
  41. package/dist/i18n/ru-ru.js +1 -1
  42. package/dist/i18n/sv-se.js +1 -1
  43. package/dist/i18n/tr-tr.js +1 -1
  44. package/dist/i18n/uk-ua.js +1 -1
  45. package/dist/i18n/zh-cn.js +1 -1
  46. package/dist/i18n/zh-tw.js +1 -1
  47. package/dist/toastui-editor-only.css +1 -1
  48. package/dist/toastui-editor-viewer.css +1 -1
  49. package/dist/toastui-editor-viewer.js +28 -9
  50. package/dist/toastui-editor.css +1 -1
  51. package/dist/toastui-editor.js +77 -21
  52. package/package.json +1 -1
  53. package/types/convertor.d.ts +6 -2
  54. package/types/index.d.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : i18n
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -704,7 +704,8 @@ var reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_]
704
704
  var reEscapeBackSlash = /\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g;
705
705
  var reEscapePairedChars = /[*_~`]/g;
706
706
  var reMdImageSyntax = /!\[.*\]\(.*\)/g;
707
- var reEscapedCharInLinkSyntax = /[[\]]/g; //
707
+ var reEscapedCharInLinkSyntax = /[[\]]/g;
708
+ var reEscapeBackSlashInSentence = /(?:^|[^\\])\\(?!\\)/g;
708
709
  var XMLSPECIAL$1 = '[&<>"]';
709
710
  var reXmlSpecial$1 = new RegExp(XMLSPECIAL$1, 'g');
710
711
  function replaceUnsafeChar$1(char) {
@@ -789,17 +790,21 @@ function escapeTextForLink(text) {
789
790
  });
790
791
  }
791
792
  function escape$1(text) {
792
- var replacer = function (matched) { return "\\" + matched; };
793
+ var aheadReplacer = function (matched) { return "\\" + matched; };
794
+ var behindReplacer = function (matched) { return matched + "\\"; };
793
795
  var escapedText = text.replace(reSpaceMoreThanOne, ' ');
794
796
  if (reEscapeBackSlash.test(escapedText)) {
795
- escapedText = escapedText.replace(reEscapeBackSlash, replacer);
797
+ escapedText = escapedText.replace(reEscapeBackSlash, aheadReplacer);
796
798
  }
797
- escapedText = escapedText.replace(reEscapePairedChars, replacer);
799
+ if (reEscapeBackSlashInSentence.test(escapedText)) {
800
+ escapedText = escapedText.replace(reEscapeBackSlashInSentence, behindReplacer);
801
+ }
802
+ escapedText = escapedText.replace(reEscapePairedChars, aheadReplacer);
798
803
  if (reEscapeHTML.test(escapedText)) {
799
- escapedText = escapedText.replace(reEscapeHTML, replacer);
804
+ escapedText = escapedText.replace(reEscapeHTML, aheadReplacer);
800
805
  }
801
806
  if (isNeedEscapeText(escapedText)) {
802
- escapedText = escapedText.replace(reEscapeChars$1, replacer);
807
+ escapedText = escapedText.replace(reEscapeChars$1, aheadReplacer);
803
808
  }
804
809
  return escapedText;
805
810
  }
@@ -909,6 +914,14 @@ function assign(targetObj, obj) {
909
914
  function getSortedNumPair(valueA, valueB) {
910
915
  return valueA > valueB ? [valueB, valueA] : [valueA, valueB];
911
916
  }
917
+ function isStartWithSpace(text) {
918
+ var reStartWithSpace = /^\s(\S*)/g;
919
+ return reStartWithSpace.test(text);
920
+ }
921
+ function isEndWithSpace(text) {
922
+ var reEndWithSpace = /(\S*)\s$/g;
923
+ return reEndWithSpace.test(text);
924
+ }
912
925
 
913
926
  /**
914
927
  * @fileoverview Transform the Array-like object to Array.
@@ -1161,7 +1174,10 @@ function createWidgetContent(info, text) {
1161
1174
  }
1162
1175
  function widgetToDOM(info, text) {
1163
1176
  var _a = widgetRuleMap[info], rule = _a.rule, toDOM = _a.toDOM;
1164
- text = unwrapWidgetSyntax(text).match(rule)[0];
1177
+ var matches = unwrapWidgetSyntax(text).match(rule);
1178
+ if (matches) {
1179
+ text = matches[0];
1180
+ }
1165
1181
  return toDOM(text);
1166
1182
  }
1167
1183
  function getWidgetRules() {
@@ -1357,6 +1373,7 @@ var reHTMLTag = new RegExp("^" + HTML_TAG, 'i');
1357
1373
  var reBR = /<br\s*\/*>/i;
1358
1374
  var reHTMLComment = /<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/;
1359
1375
  var ALTERNATIVE_TAG_FOR_BR = '</p><p>';
1376
+ var DEFAULT_TEXT_NOT_START_OR_END_WITH_SPACE = 'a';
1360
1377
 
1361
1378
  function isPositionInBox(style, offsetX, offsetY) {
1362
1379
  var left = parseInt(style.left, 10);
@@ -11286,7 +11303,9 @@ var InlineParser = /** @class */ (function () {
11286
11303
  res = this.parseAutolink(block) || this.parseHtmlTag(block);
11287
11304
  break;
11288
11305
  case C_AMPERSAND:
11289
- res = this.parseEntity(block);
11306
+ if (!block.disabledEntityParse) {
11307
+ res = this.parseEntity(block);
11308
+ }
11290
11309
  break;
11291
11310
  default:
11292
11311
  res = this.parseString(block);
@@ -20784,6 +20803,12 @@ var nodeTypeWriters = {
20784
20803
  state.write('<br>\n');
20785
20804
  }
20786
20805
  else if (emptyNode && !prevEmptyNode && !firstChildNode) {
20806
+ if ((parent === null || parent === void 0 ? void 0 : parent.type.name) === 'listItem') {
20807
+ var prevDelim = state.getDelim();
20808
+ state.setDelim('');
20809
+ state.write('<br>');
20810
+ state.setDelim(prevDelim);
20811
+ }
20787
20812
  state.write('\n');
20788
20813
  }
20789
20814
  else {
@@ -21138,30 +21163,42 @@ var toMdConvertors = {
21138
21163
  text: node.textContent,
21139
21164
  };
21140
21165
  },
21141
- strong: function (_a, _b) {
21166
+ strong: function (_a, _b, betweenSpace) {
21142
21167
  var node = _a.node;
21143
21168
  var entering = _b.entering;
21144
21169
  var rawHTML = node.attrs.rawHTML;
21170
+ var delim = '**';
21171
+ if (!betweenSpace) {
21172
+ delim = entering ? '<strong>' : '</strong>';
21173
+ }
21145
21174
  return {
21146
- delim: '**',
21175
+ delim: delim,
21147
21176
  rawHTML: entering ? getOpenRawHTML(rawHTML) : getCloseRawHTML(rawHTML),
21148
21177
  };
21149
21178
  },
21150
- emph: function (_a, _b) {
21179
+ emph: function (_a, _b, betweenSpace) {
21151
21180
  var node = _a.node;
21152
21181
  var entering = _b.entering;
21153
21182
  var rawHTML = node.attrs.rawHTML;
21183
+ var delim = '*';
21184
+ if (!betweenSpace) {
21185
+ delim = entering ? '<em>' : '</em>';
21186
+ }
21154
21187
  return {
21155
- delim: '*',
21188
+ delim: delim,
21156
21189
  rawHTML: entering ? getOpenRawHTML(rawHTML) : getCloseRawHTML(rawHTML),
21157
21190
  };
21158
21191
  },
21159
- strike: function (_a, _b) {
21192
+ strike: function (_a, _b, betweenSpace) {
21160
21193
  var node = _a.node;
21161
21194
  var entering = _b.entering;
21162
21195
  var rawHTML = node.attrs.rawHTML;
21196
+ var delim = '~~';
21197
+ if (!betweenSpace) {
21198
+ delim = entering ? '<del>' : '</del>';
21199
+ }
21163
21200
  return {
21164
- delim: '~~',
21201
+ delim: delim,
21165
21202
  rawHTML: entering ? getOpenRawHTML(rawHTML) : getCloseRawHTML(rawHTML),
21166
21203
  };
21167
21204
  },
@@ -21268,7 +21305,7 @@ function createMarkTypeConvertors(convertors) {
21268
21305
  var markTypeConvertors = {};
21269
21306
  var markTypes = Object.keys(markTypeOptions);
21270
21307
  markTypes.forEach(function (type) {
21271
- markTypeConvertors[type] = function (nodeInfo, entering) {
21308
+ markTypeConvertors[type] = function (nodeInfo, entering, betweenSpace) {
21272
21309
  var markOption = markTypeOptions[type];
21273
21310
  var convertor = convertors[type];
21274
21311
  // There are two ways to call the mark type converter
@@ -21276,7 +21313,9 @@ function createMarkTypeConvertors(convertors) {
21276
21313
  // When calling the converter without using `delim` and `rawHTML` values,
21277
21314
  // the converter is called without parameters.
21278
21315
  var runConvertor = convertor && nodeInfo && !isUndefined_1(entering);
21279
- var params = runConvertor ? convertor(nodeInfo, { entering: entering }) : {};
21316
+ var params = runConvertor
21317
+ ? convertor(nodeInfo, { entering: entering }, betweenSpace)
21318
+ : {};
21280
21319
  return __assign$1(__assign$1({}, params), markOption);
21281
21320
  };
21282
21321
  });
@@ -21337,14 +21376,30 @@ var ToMdConvertorState = /** @class */ (function () {
21337
21376
  ToMdConvertorState.prototype.isInBlank = function () {
21338
21377
  return /(^|\n)$/.test(this.result);
21339
21378
  };
21379
+ ToMdConvertorState.prototype.isBetweenSpaces = function (parent, index) {
21380
+ var _a, _b;
21381
+ var content = parent.content;
21382
+ var isFrontNodeEndWithSpace = index === 0 ||
21383
+ isEndWithSpace((_a = content.child(index - 1).text) !== null && _a !== void 0 ? _a : DEFAULT_TEXT_NOT_START_OR_END_WITH_SPACE);
21384
+ var isRearNodeStartWithSpace = index >= content.childCount - 1 ||
21385
+ isStartWithSpace((_b = content.child(index + 1).text) !== null && _b !== void 0 ? _b : DEFAULT_TEXT_NOT_START_OR_END_WITH_SPACE);
21386
+ return isFrontNodeEndWithSpace && isRearNodeStartWithSpace;
21387
+ };
21340
21388
  ToMdConvertorState.prototype.markText = function (mark, entering, parent, index) {
21341
21389
  var convertor = this.getMarkConvertor(mark);
21342
21390
  if (convertor) {
21343
- var _a = convertor({ node: mark, parent: parent, index: index }, entering), delim = _a.delim, rawHTML = _a.rawHTML;
21391
+ var betweenSpace = this.isBetweenSpaces(parent, entering ? index : index - 1);
21392
+ var _a = convertor({ node: mark, parent: parent, index: index }, entering, betweenSpace), delim = _a.delim, rawHTML = _a.rawHTML;
21344
21393
  return rawHTML || delim;
21345
21394
  }
21346
21395
  return '';
21347
21396
  };
21397
+ ToMdConvertorState.prototype.setDelim = function (delim) {
21398
+ this.delim = delim;
21399
+ };
21400
+ ToMdConvertorState.prototype.getDelim = function () {
21401
+ return this.delim;
21402
+ };
21348
21403
  ToMdConvertorState.prototype.flushClose = function (size) {
21349
21404
  if (!this.stopNewline && this.closed) {
21350
21405
  if (!this.isInBlank()) {
@@ -21367,11 +21422,11 @@ var ToMdConvertorState = /** @class */ (function () {
21367
21422
  }
21368
21423
  };
21369
21424
  ToMdConvertorState.prototype.wrapBlock = function (delim, firstDelim, node, fn) {
21370
- var old = this.delim;
21425
+ var old = this.getDelim();
21371
21426
  this.write(firstDelim || delim);
21372
- this.delim += delim;
21427
+ this.setDelim(this.getDelim() + delim);
21373
21428
  fn();
21374
- this.delim = old;
21429
+ this.setDelim(old);
21375
21430
  this.closeBlock(node);
21376
21431
  };
21377
21432
  ToMdConvertorState.prototype.ensureNewLine = function () {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @toast-ui/editor : viewer
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -6635,7 +6635,9 @@ var InlineParser = /** @class */ (function () {
6635
6635
  res = this.parseAutolink(block) || this.parseHtmlTag(block);
6636
6636
  break;
6637
6637
  case C_AMPERSAND:
6638
- res = this.parseEntity(block);
6638
+ if (!block.disabledEntityParse) {
6639
+ res = this.parseEntity(block);
6640
+ }
6639
6641
  break;
6640
6642
  default:
6641
6643
  res = this.parseString(block);
@@ -10105,7 +10107,10 @@ function unwrapWidgetSyntax(text) {
10105
10107
  }
10106
10108
  function widgetToDOM(info, text) {
10107
10109
  var _a = widgetRuleMap[info], rule = _a.rule, toDOM = _a.toDOM;
10108
- text = unwrapWidgetSyntax(text).match(rule)[0];
10110
+ var matches = unwrapWidgetSyntax(text).match(rule);
10111
+ if (matches) {
10112
+ text = matches[0];
10113
+ }
10109
10114
  return toDOM(text);
10110
10115
  }
10111
10116
  function getWidgetContent(widgetNode) {
package/dist/i18n/ar.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * TOAST UI Editor : i18n
3
- * @version 3.1.5
3
+ * @version 3.1.8
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -9619,7 +9619,9 @@ var InlineParser = /** @class */ (function () {
9619
9619
  res = this.parseAutolink(block) || this.parseHtmlTag(block);
9620
9620
  break;
9621
9621
  case C_AMPERSAND:
9622
- res = this.parseEntity(block);
9622
+ if (!block.disabledEntityParse) {
9623
+ res = this.parseEntity(block);
9624
+ }
9623
9625
  break;
9624
9626
  default:
9625
9627
  res = this.parseString(block);
@@ -12078,6 +12080,7 @@ var reHTMLTag = new RegExp("^" + constants_HTML_TAG, 'i');
12078
12080
  var constants_reBR = /<br\s*\/*>/i;
12079
12081
  var reHTMLComment = /<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/;
12080
12082
  var constants_ALTERNATIVE_TAG_FOR_BR = '</p><p>';
12083
+ var DEFAULT_TEXT_NOT_START_OR_END_WITH_SPACE = 'a';
12081
12084
 
12082
12085
  // EXTERNAL MODULE: ../../node_modules/tui-code-snippet/type/isNull.js
12083
12086
  var type_isNull = __webpack_require__(934);
@@ -12096,7 +12099,8 @@ var reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_]
12096
12099
  var reEscapeBackSlash = /\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g;
12097
12100
  var reEscapePairedChars = /[*_~`]/g;
12098
12101
  var reMdImageSyntax = /!\[.*\]\(.*\)/g;
12099
- var reEscapedCharInLinkSyntax = /[[\]]/g; //
12102
+ var reEscapedCharInLinkSyntax = /[[\]]/g;
12103
+ var reEscapeBackSlashInSentence = /(?:^|[^\\])\\(?!\\)/g;
12100
12104
  var common_XMLSPECIAL = '[&<>"]';
12101
12105
  var common_reXmlSpecial = new RegExp(common_XMLSPECIAL, 'g');
12102
12106
  function common_replaceUnsafeChar(char) {
@@ -12181,17 +12185,21 @@ function escapeTextForLink(text) {
12181
12185
  });
12182
12186
  }
12183
12187
  function common_escape(text) {
12184
- var replacer = function (matched) { return "\\" + matched; };
12188
+ var aheadReplacer = function (matched) { return "\\" + matched; };
12189
+ var behindReplacer = function (matched) { return matched + "\\"; };
12185
12190
  var escapedText = text.replace(reSpaceMoreThanOne, ' ');
12186
12191
  if (reEscapeBackSlash.test(escapedText)) {
12187
- escapedText = escapedText.replace(reEscapeBackSlash, replacer);
12192
+ escapedText = escapedText.replace(reEscapeBackSlash, aheadReplacer);
12193
+ }
12194
+ if (reEscapeBackSlashInSentence.test(escapedText)) {
12195
+ escapedText = escapedText.replace(reEscapeBackSlashInSentence, behindReplacer);
12188
12196
  }
12189
- escapedText = escapedText.replace(reEscapePairedChars, replacer);
12197
+ escapedText = escapedText.replace(reEscapePairedChars, aheadReplacer);
12190
12198
  if (reEscapeHTML.test(escapedText)) {
12191
- escapedText = escapedText.replace(reEscapeHTML, replacer);
12199
+ escapedText = escapedText.replace(reEscapeHTML, aheadReplacer);
12192
12200
  }
12193
12201
  if (isNeedEscapeText(escapedText)) {
12194
- escapedText = escapedText.replace(common_reEscapeChars, replacer);
12202
+ escapedText = escapedText.replace(common_reEscapeChars, aheadReplacer);
12195
12203
  }
12196
12204
  return escapedText;
12197
12205
  }
@@ -12301,6 +12309,14 @@ function common_assign(targetObj, obj) {
12301
12309
  function getSortedNumPair(valueA, valueB) {
12302
12310
  return valueA > valueB ? [valueB, valueA] : [valueA, valueB];
12303
12311
  }
12312
+ function isStartWithSpace(text) {
12313
+ var reStartWithSpace = /^\s(\S*)/g;
12314
+ return reStartWithSpace.test(text);
12315
+ }
12316
+ function isEndWithSpace(text) {
12317
+ var reEndWithSpace = /(\S*)\s$/g;
12318
+ return reEndWithSpace.test(text);
12319
+ }
12304
12320
 
12305
12321
  ;// CONCATENATED MODULE: ./src/utils/dom.ts
12306
12322
 
@@ -12710,7 +12726,10 @@ function createWidgetContent(info, text) {
12710
12726
  }
12711
12727
  function widgetToDOM(info, text) {
12712
12728
  var _a = widgetRuleMap[info], rule = _a.rule, toDOM = _a.toDOM;
12713
- text = unwrapWidgetSyntax(text).match(rule)[0];
12729
+ var matches = unwrapWidgetSyntax(text).match(rule);
12730
+ if (matches) {
12731
+ text = matches[0];
12732
+ }
12714
12733
  return toDOM(text);
12715
12734
  }
12716
12735
  function getWidgetRules() {
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @toast-ui/editor
3
- * @version 3.1.5 | Sat Apr 23 2022
3
+ * @version 3.1.8 | Tue Jul 12 2022
4
4
  * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
5
5
  * @license MIT
6
6
  */
@@ -3392,7 +3392,8 @@ var reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_]
3392
3392
  var reEscapeBackSlash = /\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g;
3393
3393
  var reEscapePairedChars = /[*_~`]/g;
3394
3394
  var reMdImageSyntax = /!\[.*\]\(.*\)/g;
3395
- var reEscapedCharInLinkSyntax = /[[\]]/g; //
3395
+ var reEscapedCharInLinkSyntax = /[[\]]/g;
3396
+ var reEscapeBackSlashInSentence = /(?:^|[^\\])\\(?!\\)/g;
3396
3397
  var XMLSPECIAL = '[&<>"]';
3397
3398
  var reXmlSpecial = new RegExp(XMLSPECIAL, 'g');
3398
3399
  function replaceUnsafeChar(char) {
@@ -3477,17 +3478,21 @@ function escapeTextForLink(text) {
3477
3478
  });
3478
3479
  }
3479
3480
  function common_escape(text) {
3480
- var replacer = function (matched) { return "\\" + matched; };
3481
+ var aheadReplacer = function (matched) { return "\\" + matched; };
3482
+ var behindReplacer = function (matched) { return matched + "\\"; };
3481
3483
  var escapedText = text.replace(reSpaceMoreThanOne, ' ');
3482
3484
  if (reEscapeBackSlash.test(escapedText)) {
3483
- escapedText = escapedText.replace(reEscapeBackSlash, replacer);
3485
+ escapedText = escapedText.replace(reEscapeBackSlash, aheadReplacer);
3484
3486
  }
3485
- escapedText = escapedText.replace(reEscapePairedChars, replacer);
3487
+ if (reEscapeBackSlashInSentence.test(escapedText)) {
3488
+ escapedText = escapedText.replace(reEscapeBackSlashInSentence, behindReplacer);
3489
+ }
3490
+ escapedText = escapedText.replace(reEscapePairedChars, aheadReplacer);
3486
3491
  if (reEscapeHTML.test(escapedText)) {
3487
- escapedText = escapedText.replace(reEscapeHTML, replacer);
3492
+ escapedText = escapedText.replace(reEscapeHTML, aheadReplacer);
3488
3493
  }
3489
3494
  if (isNeedEscapeText(escapedText)) {
3490
- escapedText = escapedText.replace(reEscapeChars, replacer);
3495
+ escapedText = escapedText.replace(reEscapeChars, aheadReplacer);
3491
3496
  }
3492
3497
  return escapedText;
3493
3498
  }
@@ -3597,6 +3602,14 @@ function common_assign(targetObj, obj) {
3597
3602
  function getSortedNumPair(valueA, valueB) {
3598
3603
  return valueA > valueB ? [valueB, valueA] : [valueA, valueB];
3599
3604
  }
3605
+ function isStartWithSpace(text) {
3606
+ var reStartWithSpace = /^\s(\S*)/g;
3607
+ return reStartWithSpace.test(text);
3608
+ }
3609
+ function isEndWithSpace(text) {
3610
+ var reEndWithSpace = /(\S*)\s$/g;
3611
+ return reEndWithSpace.test(text);
3612
+ }
3600
3613
 
3601
3614
  // EXTERNAL MODULE: external {"commonjs":"prosemirror-view","commonjs2":"prosemirror-view","amd":"prosemirror-view"}
3602
3615
  var external_commonjs_prosemirror_view_commonjs2_prosemirror_view_amd_prosemirror_view_ = __webpack_require__(311);
@@ -3846,7 +3859,10 @@ function createWidgetContent(info, text) {
3846
3859
  }
3847
3860
  function widgetToDOM(info, text) {
3848
3861
  var _a = widgetRuleMap[info], rule = _a.rule, toDOM = _a.toDOM;
3849
- text = unwrapWidgetSyntax(text).match(rule)[0];
3862
+ var matches = unwrapWidgetSyntax(text).match(rule);
3863
+ if (matches) {
3864
+ text = matches[0];
3865
+ }
3850
3866
  return toDOM(text);
3851
3867
  }
3852
3868
  function getWidgetRules() {
@@ -3998,6 +4014,7 @@ var reHTMLTag = new RegExp("^" + HTML_TAG, 'i');
3998
4014
  var reBR = /<br\s*\/*>/i;
3999
4015
  var reHTMLComment = /<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/;
4000
4016
  var ALTERNATIVE_TAG_FOR_BR = '</p><p>';
4017
+ var DEFAULT_TEXT_NOT_START_OR_END_WITH_SPACE = 'a';
4001
4018
 
4002
4019
  ;// CONCATENATED MODULE: ./src/utils/dom.ts
4003
4020
 
@@ -13932,7 +13949,9 @@ var InlineParser = /** @class */ (function () {
13932
13949
  res = this.parseAutolink(block) || this.parseHtmlTag(block);
13933
13950
  break;
13934
13951
  case C_AMPERSAND:
13935
- res = this.parseEntity(block);
13952
+ if (!block.disabledEntityParse) {
13953
+ res = this.parseEntity(block);
13954
+ }
13936
13955
  break;
13937
13956
  default:
13938
13957
  res = this.parseString(block);
@@ -22346,6 +22365,12 @@ var nodeTypeWriters = {
22346
22365
  state.write('<br>\n');
22347
22366
  }
22348
22367
  else if (emptyNode && !prevEmptyNode && !firstChildNode) {
22368
+ if ((parent === null || parent === void 0 ? void 0 : parent.type.name) === 'listItem') {
22369
+ var prevDelim = state.getDelim();
22370
+ state.setDelim('');
22371
+ state.write('<br>');
22372
+ state.setDelim(prevDelim);
22373
+ }
22349
22374
  state.write('\n');
22350
22375
  }
22351
22376
  else {
@@ -22705,30 +22730,42 @@ var toMdConvertors = {
22705
22730
  text: node.textContent,
22706
22731
  };
22707
22732
  },
22708
- strong: function (_a, _b) {
22733
+ strong: function (_a, _b, betweenSpace) {
22709
22734
  var node = _a.node;
22710
22735
  var entering = _b.entering;
22711
22736
  var rawHTML = node.attrs.rawHTML;
22737
+ var delim = '**';
22738
+ if (!betweenSpace) {
22739
+ delim = entering ? '<strong>' : '</strong>';
22740
+ }
22712
22741
  return {
22713
- delim: '**',
22742
+ delim: delim,
22714
22743
  rawHTML: entering ? getOpenRawHTML(rawHTML) : getCloseRawHTML(rawHTML),
22715
22744
  };
22716
22745
  },
22717
- emph: function (_a, _b) {
22746
+ emph: function (_a, _b, betweenSpace) {
22718
22747
  var node = _a.node;
22719
22748
  var entering = _b.entering;
22720
22749
  var rawHTML = node.attrs.rawHTML;
22750
+ var delim = '*';
22751
+ if (!betweenSpace) {
22752
+ delim = entering ? '<em>' : '</em>';
22753
+ }
22721
22754
  return {
22722
- delim: '*',
22755
+ delim: delim,
22723
22756
  rawHTML: entering ? getOpenRawHTML(rawHTML) : getCloseRawHTML(rawHTML),
22724
22757
  };
22725
22758
  },
22726
- strike: function (_a, _b) {
22759
+ strike: function (_a, _b, betweenSpace) {
22727
22760
  var node = _a.node;
22728
22761
  var entering = _b.entering;
22729
22762
  var rawHTML = node.attrs.rawHTML;
22763
+ var delim = '~~';
22764
+ if (!betweenSpace) {
22765
+ delim = entering ? '<del>' : '</del>';
22766
+ }
22730
22767
  return {
22731
- delim: '~~',
22768
+ delim: delim,
22732
22769
  rawHTML: entering ? getOpenRawHTML(rawHTML) : getCloseRawHTML(rawHTML),
22733
22770
  };
22734
22771
  },
@@ -22835,7 +22872,7 @@ function createMarkTypeConvertors(convertors) {
22835
22872
  var markTypeConvertors = {};
22836
22873
  var markTypes = Object.keys(markTypeOptions);
22837
22874
  markTypes.forEach(function (type) {
22838
- markTypeConvertors[type] = function (nodeInfo, entering) {
22875
+ markTypeConvertors[type] = function (nodeInfo, entering, betweenSpace) {
22839
22876
  var markOption = markTypeOptions[type];
22840
22877
  var convertor = convertors[type];
22841
22878
  // There are two ways to call the mark type converter
@@ -22843,7 +22880,9 @@ function createMarkTypeConvertors(convertors) {
22843
22880
  // When calling the converter without using `delim` and `rawHTML` values,
22844
22881
  // the converter is called without parameters.
22845
22882
  var runConvertor = convertor && nodeInfo && !isUndefined_default()(entering);
22846
- var params = runConvertor ? convertor(nodeInfo, { entering: entering }) : {};
22883
+ var params = runConvertor
22884
+ ? convertor(nodeInfo, { entering: entering }, betweenSpace)
22885
+ : {};
22847
22886
  return __assign(__assign({}, params), markOption);
22848
22887
  };
22849
22888
  });
@@ -22887,6 +22926,7 @@ function createMdConvertors(customConvertors) {
22887
22926
 
22888
22927
  ;// CONCATENATED MODULE: ./src/convertors/toMarkdown/toMdConvertorState.ts
22889
22928
 
22929
+
22890
22930
  var ToMdConvertorState = /** @class */ (function () {
22891
22931
  function ToMdConvertorState(_a) {
22892
22932
  var nodeTypeConvertors = _a.nodeTypeConvertors, markTypeConvertors = _a.markTypeConvertors;
@@ -22906,14 +22946,30 @@ var ToMdConvertorState = /** @class */ (function () {
22906
22946
  ToMdConvertorState.prototype.isInBlank = function () {
22907
22947
  return /(^|\n)$/.test(this.result);
22908
22948
  };
22949
+ ToMdConvertorState.prototype.isBetweenSpaces = function (parent, index) {
22950
+ var _a, _b;
22951
+ var content = parent.content;
22952
+ var isFrontNodeEndWithSpace = index === 0 ||
22953
+ isEndWithSpace((_a = content.child(index - 1).text) !== null && _a !== void 0 ? _a : DEFAULT_TEXT_NOT_START_OR_END_WITH_SPACE);
22954
+ var isRearNodeStartWithSpace = index >= content.childCount - 1 ||
22955
+ isStartWithSpace((_b = content.child(index + 1).text) !== null && _b !== void 0 ? _b : DEFAULT_TEXT_NOT_START_OR_END_WITH_SPACE);
22956
+ return isFrontNodeEndWithSpace && isRearNodeStartWithSpace;
22957
+ };
22909
22958
  ToMdConvertorState.prototype.markText = function (mark, entering, parent, index) {
22910
22959
  var convertor = this.getMarkConvertor(mark);
22911
22960
  if (convertor) {
22912
- var _a = convertor({ node: mark, parent: parent, index: index }, entering), delim = _a.delim, rawHTML = _a.rawHTML;
22961
+ var betweenSpace = this.isBetweenSpaces(parent, entering ? index : index - 1);
22962
+ var _a = convertor({ node: mark, parent: parent, index: index }, entering, betweenSpace), delim = _a.delim, rawHTML = _a.rawHTML;
22913
22963
  return rawHTML || delim;
22914
22964
  }
22915
22965
  return '';
22916
22966
  };
22967
+ ToMdConvertorState.prototype.setDelim = function (delim) {
22968
+ this.delim = delim;
22969
+ };
22970
+ ToMdConvertorState.prototype.getDelim = function () {
22971
+ return this.delim;
22972
+ };
22917
22973
  ToMdConvertorState.prototype.flushClose = function (size) {
22918
22974
  if (!this.stopNewline && this.closed) {
22919
22975
  if (!this.isInBlank()) {
@@ -22936,11 +22992,11 @@ var ToMdConvertorState = /** @class */ (function () {
22936
22992
  }
22937
22993
  };
22938
22994
  ToMdConvertorState.prototype.wrapBlock = function (delim, firstDelim, node, fn) {
22939
- var old = this.delim;
22995
+ var old = this.getDelim();
22940
22996
  this.write(firstDelim || delim);
22941
- this.delim += delim;
22997
+ this.setDelim(this.getDelim() + delim);
22942
22998
  fn();
22943
- this.delim = old;
22999
+ this.setDelim(old);
22944
23000
  this.closeBlock(node);
22945
23001
  };
22946
23002
  ToMdConvertorState.prototype.ensureNewLine = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toast-ui/editor",
3
- "version": "3.1.5",
3
+ "version": "3.1.8",
4
4
  "description": "GFM Markdown Wysiwyg Editor - Productive and Extensible",
5
5
  "keywords": [
6
6
  "nhn",
@@ -45,6 +45,8 @@ export type FirstDelimFn = (index: number) => string;
45
45
  export interface ToMdConvertorState {
46
46
  stopNewline: boolean;
47
47
  inTable: boolean;
48
+ getDelim(): string;
49
+ setDelim(delim: string): void;
48
50
  flushClose(size?: number): void;
49
51
  wrapBlock(delim: string, firstDelim: string | null, node: ProsemirrorNode, fn: () => void): void;
50
52
  ensureNewLine(): void;
@@ -111,7 +113,8 @@ export type ToMdNodeTypeConvertorMap = Partial<Record<WwNodeType, ToMdNodeTypeCo
111
113
 
112
114
  type ToMdMarkTypeConvertor = (
113
115
  nodeInfo?: MarkInfo,
114
- entering?: boolean
116
+ entering?: boolean,
117
+ betweenSpace?: boolean
115
118
  ) => ToMdConvertorReturnValues & ToMdMarkTypeOption;
116
119
 
117
120
  export type ToMdMarkTypeConvertorMap = Partial<Record<WwMarkType, ToMdMarkTypeConvertor>>;
@@ -124,7 +127,8 @@ interface ToMdConvertorContext {
124
127
 
125
128
  type ToMdConvertor = (
126
129
  nodeInfo: NodeInfo | MarkInfo,
127
- context: ToMdConvertorContext
130
+ context: ToMdConvertorContext,
131
+ betweenSpace?: boolean
128
132
  ) => ToMdConvertorReturnValues;
129
133
 
130
134
  export type ToMdConvertorMap = Partial<Record<WwNodeType | MdNodeType, ToMdConvertor>>;
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for TOAST UI Editor v3.1.5
1
+ // Type definitions for TOAST UI Editor v3.1.8
2
2
  // TypeScript Version: 4.2.3
3
3
  import {
4
4
  EditorCore,