Closed williamtan37 closed 1 year ago
Hi, this library doesn't take an opinionated stance on how the app represents rich text. There are multiple ways to do so with different trade-offs. For example:
Option 1: Use specialized characters to markup text inside a string:
{
text: "<b>Hello</b> world. This is <member id="123">John</member> speaking"
}
Option 2: Represent it in your data structure:
{
text: "Hello world. This is John speaking",
attributes: [
{
type: "BOLD",
start: 0,
count: 5
},
{
type: "MEMBER",
start: 21
count: 4
id: "123"
}
]
}
This library is designed to simplify allowing users to annotate rich text (e.g. inserting mentions) but requires the app to handle persisting those annotations in a format suitable for the app.
Please see similar issues that I've answered in the past for more info (e.g. https://github.com/linkedin/Spyglass/issues/35#issuecomment-269735466).
Thanks
Hello,
I've seen some post regarding:
user text with mentions : "I want to thanks to @john and to @jane "
server text: "I want to thanks to [John, id:45] and to [Jane, id:156]"
Is this the right way to represent the data to server? Because then we wont be able to use "[". How is every doing this? So that we can also read the data back again and display it to the client in the correct format.