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

Handle links and hashtags in DescriptionText.rememberParsedDescription #11715

Open
Profpatsch opened this issue Nov 18, 2024 · 0 comments
Open
Labels
comments Anything to do with comments and comment replies under videos/audios GUI Issue is related to the graphical user interface rewrite Issues and PRs related to rewrite

Comments

@Profpatsch
Copy link
Contributor

Profpatsch commented Nov 18, 2024

Note: reimplementing Description -> AnnotatedString is going to be a tough task, considering how complicated TextLinkifier is: https://github.com/TeamNewPipe/NewPipe/blob/9d6ac67c46a6cc55e03dec0599d8070f7430098d/app/src/main/java/org/schabi/newpipe/util/text/TextLinkifier.java

Originally posted by @Stypox in #11060 (comment)

fun rememberParsedDescription(description: Description): AnnotatedString {
// TODO: Handle links and hashtags, Markdown.
return remember(description) {
if (description.type == Description.HTML) {
val styles = TextLinkStyles(SpanStyle(textDecoration = TextDecoration.Underline))
AnnotatedString.fromHtml(description.content, styles)
} else {
AnnotatedString(description.content)
}
}
}

@Profpatsch Profpatsch moved this to Todo in Rewrite Nov 18, 2024
@AudricV AudricV added GUI Issue is related to the graphical user interface comments Anything to do with comments and comment replies under videos/audios rewrite Issues and PRs related to rewrite labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comments Anything to do with comments and comment replies under videos/audios GUI Issue is related to the graphical user interface rewrite Issues and PRs related to rewrite
Projects
Status: Todo
Development

No branches or pull requests

2 participants