tui.editor icon indicating copy to clipboard operation
tui.editor copied to clipboard

copy word data into WISIWIG, get **** before num porint

Open zwb3707811 opened this issue 3 years ago • 6 comments

zwb3707811 avatar Mar 09 '21 03:03 zwb3707811

@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.

seonim-ryu avatar Mar 10 '21 01:03 seonim-ryu

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 avatar Mar 10 '21 01:03 zwb3707811

@zwb3707811 I checked the issue. This is not a bug, it's the correct behavior.

capture

For explanation, if you copy the document you gave and paste it into WYSIWYG, the html is created as follows.

wwe

<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 ****.

seonim-ryu avatar Mar 10 '21 01:03 seonim-ryu

I use Viewer to show the document, and i want to see WYSIWYG,not markdown. What will I do?

zwb3707811 avatar Mar 10 '21 01:03 zwb3707811

@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

seonim-ryu avatar Mar 10 '21 02:03 seonim-ryu

OK,i will try it,thank you very much

zwb3707811 avatar Mar 10 '21 02:03 zwb3707811