Tui.editor: HTML <mark> tag disappearing

Created on 16 Dec 2019  路  7Comments  路  Source: nhn/tui.editor

Version

1.3.0

Development Environment

Windows and Mac: Chrome, Firefox, and edge.

Current Behavior

When a user puts a \ tag in the markdown tab it shows the text highlight correctly on the preview, but when the tab is switched to the wysiwyg the highlight disappears. The tag is no longer on the text when you go back to the markdown tab.

Expected Behavior

The mark tag stays in place like html tags or is a special type like italic and bold.

Enhancement Need Discussion

Most helpful comment

The html5 tag mark does not carry over to the wysiwyg tab, not showing the literal text or displaying the highlight. To contrast the tag \ will still show the text as a subscript on the wysiwyg tab, and the html5 time tag stays when you return to the markdown tab.
1 markdown tab:
image
2 wysiwyg tab:
image
3 back to markdown tab:
image

As you can see the fake tag and the mark tag was removed, but time and sub were still there. Mark is an html5 tag and should stay.

All 7 comments

The mark tag is an HTML5 tag, but it's confusing my users that they can see it and then it goes away
https://www.w3schools.com/tags/tag_mark.asp
image

I tried like you tried. However It is no problem. Can I see your code by codepen or jsbin etc?
I tried at Chrome and Safari.

釀夅叧釀忈叧釀呩叺釂剦釁a喓 2019-12-18 釀嬦叐釀掅叜 1 21 42
釀夅叧釀忈叧釀呩叺釂剦釁a喓 2019-12-18 釀嬦叐釀掅叜 1 22 00

I'm able to reproduce it here https://nhn.github.io/tui.editor/latest/tutorial-example01-editor-basic
On Markdown tab:
image
After changing to WYSIWYG tab:
image

@jolrael-dev
Yes, you're right. Mark tag is now showing in WYSIWYG tab. also removed mark tag when back to Markdown tab

This is a question related to the issue #705. Please check that issue first. Currently, And in WYSIWYG, the tags below and other tags are removed. The mark tag is the case here.

https://github.com/seonim-ryu/Squire/blob/fd40b4e3020845825701e9689f190bab3f4775d4/build/squire-raw.js#L2047

The html5 tag mark does not carry over to the wysiwyg tab, not showing the literal text or displaying the highlight. To contrast the tag \ will still show the text as a subscript on the wysiwyg tab, and the html5 time tag stays when you return to the markdown tab.
1 markdown tab:
image
2 wysiwyg tab:
image
3 back to markdown tab:
image

As you can see the fake tag and the mark tag was removed, but time and sub were still there. Mark is an html5 tag and should stay.

@jolrael-dev I got it.. It's because of the tag handling in Squire. However, what I said before was the processing of block elements. mark is an inline element, which is excluded from the logic of processing inline elements in Squire.

https://github.com/seonim-ryu/Squire/blob/fd40b4e3020845825701e9689f190bab3f4775d4/build/squire-raw.js#L182

Simply adding mark to the code above won't solve the problem. I think this issue can be solved by specifying the specification of which tags should be allowed or not. I'll let you know when it's decided.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cyberjacob picture cyberjacob  路  4Comments

gincheong picture gincheong  路  4Comments

kelvinkoko picture kelvinkoko  路  3Comments

Yeongjae-Shin picture Yeongjae-Shin  路  3Comments

mygyugyu picture mygyugyu  路  3Comments