title | tags | created | modified | ||||
---|---|---|---|---|---|---|---|
lib-collab-crdt-blog-editor |
|
2023-10-28 09:02:53 UTC |
2023-10-28 09:03:33 UTC |
-
Why not Markdown
-
Problem 1: Syntax barfing(呕吐)
- Suppose you want to add a behavior that markdown doesn't usually support, others cannot parse/render correctly
-
Problem 2: Parsing sucks
- Your markdown variation is going to need a library for every environment.
-
Problem 3: Character counting
- In microblogging networks, the character limit is a somewhat defining feature.
- You have to strip the syntax first.
-
Bluesky's answer: Richtext Facets
- Our answer was to use strings annotated by slices that point into the string.
- Data in the AT Proto is transmitted as JSON or CBOR. No custom parsing is required.
- If there's a facet-type your client doesn't understand, it's just ignored and the original text carries through.
// slightly simplified
{
text: "Hello @bob.com",
facets: [
{ feature: "mention", index: { start: 6, end: 14 } }
]
}
- Bonus discussion: maintaining intent