You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
It will tidy up how we identify what is a mention. In some places we check for the contenteditable attribute, others we check for data-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
It would really help to tidy up Rust tests, which suffer from the same confusion, and make them easier to read. For example when reading a test in Rust, if I see a test with an <a> tag in it, is the test for links or is it for mentions? It's not easy to tell at a glance
Discrimination between links and mentions becomes explicit in the html markup, not just in the inner workings of the Rust model
Proposed solution would be to move from <a data-mention-type="X" ... /> to:
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:
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: