tui.editor
tui.editor copied to clipboard
copy word data into WISIWIG, get **** before num porint
@zwb3707811 I can't confirm the problem just by looking at this content. Is the situation in the Viewer wrong after setting the data pasted in WYSIWYG in the Viewer? Please explain in more detail.
first,thank you for answer。 I copy from .doc into WYSIWYG is normal,but in the Viewer,just like picture No2, see **** before "选择意向目的地"。 WISIWIG.docx
@zwb3707811 I checked the issue. This is not a bug, it's the correct behavior.
For explanation, if you copy the document you gave and paste it into WYSIWYG, the html is created as follows.
<div><b><span class="colour" style="color: black;">1.</span></b><b><span class="colour" style="color: black;">选中意向目的地:</span></b><span class="colour" style="color: black;"></span><br></div>
Since there is already a bold break between the 1.
and 选
characters, when converted to markdown, the <b>
tag is replaced with **
and the </b><b>
becomes It looks like a bug by replacing it with ****
.
I use Viewer to show the document, and i want to see WYSIWYG,not markdown. What will I do?
@zwb3707811 The Markdown Viewer and the viewer you were talking about are the same. When it was copied from MS Word, it was broken and copied as <b>...</b><b>...</b>
, so it works like that in the Editor. But I think it's possible if you use an informal method. I think it would be possible if you catch the convertorBeforeHtmlToMarkdownConverted
event that is used internally and you replace </b><b>
with an empty string using a regular expression.
https://github.com/nhn/tui.editor/blob/8e31e3a076805078636eac18be988ae00466ab1f/apps/editor/src/js/eventManager.js#L48
OK,i will try it,thank you very much