Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should support span id #261

Open
RujulGandhi opened this issue Apr 26, 2024 · 3 comments
Open

should support span id #261

RujulGandhi opened this issue Apr 26, 2024 · 3 comments

Comments

@RujulGandhi
Copy link

I've encountered an issue with a library I'm using. When I set a unique identifier (id) for a span element in the HTML using state.setHtml(), it doesn't seem to retain the id when I retrieve the HTML using state.toHtml().

Here's an example:

state.setHtml(`<span id="${username}" style="color: rgba(0, 0, 255, 1.0);">@${username}</span>`);

However, when I retrieve the HTML using state.toHtml(), the id is missing:

state.toHtml(); // Output: <span style="color: rgba(0, 0, 255, 1.0);">@${username}</span>

I need to send a unique identifier with every span element so that I can retrieve it later. How can I achieve this?

Thank you.

@MohamedRejeb
Copy link
Owner

Hi,
Thanks for opening this issue, for now retuned html format only contains styles and attributes recognized by the library.
Maybe we can add support for ids at least for now. You need this to have a proper mentions support right? Maybe supporting mentions in the library can fix this.

@RujulGandhi
Copy link
Author

Yes, I want mention functionality, but how can I achieve id part for now ?

@RujulGandhi
Copy link
Author

Is there any alternative which you can think to solve this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants