nhn / tui.editor

πŸžπŸ“ Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
http://ui.toast.com/tui-editor
MIT License
16.91k stars 1.71k forks source link

Some characters will cause rendering to fail #3249

Open scarqin opened 1 month ago

scarqin commented 1 month ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch @toast-ui/editor@3.2.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@toast-ui/editor/dist/esm/index.js b/node_modules/@toast-ui/editor/dist/esm/index.js
index d966ba8..02e8bd2 100644
--- a/node_modules/@toast-ui/editor/dist/esm/index.js
+++ b/node_modules/@toast-ui/editor/dist/esm/index.js
@@ -20056,7 +20056,7 @@ var CommandManager = /** @class */ (function () {
     return CommandManager;
 }());

-function getTextWithoutTrailingNewline(text) {
+function getTextWithoutTrailingNewline(text='') {
     return text[text.length - 1] === '\n' ? text.slice(0, text.length - 1) : text;
 }
 function isCustomHTMLInlineNode(_a, node) {

This issue body was partially generated by patch-package.