How does the front end implement similar rich text parsing?

The scenario of the

application is a comment function. If I want to @ someone, I need to display @ Xiaoming in input, and the content of input is the content field
of this comment. To generate a comment to the backend POST the following data.

let data = {
  content: [@userid|]1
}

but content is @ Xiaoming when shown in input and in the comments list. The backend wants me to do a rich text parsing function to

@   [@userid|]
GET
[@userid|]  @

the format displayed in the front end is different from that in the actual back end. How can this be realized?

Mar.09,2021

find and cache the userid corresponding to @ Xiaoming, and splice it together when you need to send it to the backend.

Menu