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

Not all HTML char escapes are converted #157

Closed
garretyoder opened this issue Dec 21, 2023 · 3 comments · Fixed by #161
Closed

Not all HTML char escapes are converted #157

garretyoder opened this issue Dec 21, 2023 · 3 comments · Fixed by #161

Comments

@garretyoder
Copy link
Contributor

garretyoder commented Dec 21, 2023

Some direct char codes like &quot are escaped and converted into " properly, however html style ' are not converted properly.

Example of how I'm using it:

val richTextState = rememberRichTextState()
LaunchedEffect(string) {
    richTextState.setHtml(string)
}
RichText(
    state = richTextState,
    modifier = Modifier
)
@garretyoder
Copy link
Contributor Author

garretyoder commented Dec 21, 2023

I have a workaround for the time being using regex to pull out the unicode codepoint, and convert it into an int and then back to a character. Is there something I'm missing where this should be done automatically?

text.replace(regex = Regex("&#x([^;]*);")) {
    "${it.groupValues[1].toInt(16).toChar()}"
}

@MohamedRejeb
Copy link
Owner

Thanks for reporting this issue. I will check it out.

@MohamedRejeb
Copy link
Owner

It will be available in the next release.

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

Successfully merging a pull request may close this issue.

2 participants