This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
Move from <a>
tags to custom html tags for mentions
#714
Labels
It is possible in html to use custom tags. To prevent us having to constantly parse attributes to check if something is a mention, we could move to using a custom tag. This has many benefits:
contenteditable
attribute, others we check fordata-mention-type
often these are combined with checking the tag type too. All this repetition/confusion could be tidied up if we could simply always check the tag type in the html<a>
tag in it, is the test for links or is it for mentions? It's not easy to tell at a glanceProposed solution would be to move from
<a data-mention-type="X" ... />
to:<mention-user contenteditable="false" style="{}" href="">user name</mention-user>
<mention-room contenteditable="false" style="{}" href= "">room name</mention-room>
<mention-at-room contenteditable="false" style="{}" href= "">text</mention-at-room>
I think that this arrangement of information would satisfy all clients, as we have defined the type of mention (in the tag) then if it is editable (needed for web), custom styling (needed for web) and href (needed for all clients) in attributes. It's possible that another attribute may be required to make this legitimate html (I'm not completely familiar with custom components) but hopefully this serves as a reasonable start point.
The text was updated successfully, but these errors were encountered: