Skip to content

Handle links and hashtags in DescriptionText.rememberParsedDescription #11715

Open
@Profpatsch

Description

@Profpatsch

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)
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUIIssue is related to the graphical user interfacecommentsAnything to do with comments and comment replies under videos/audiosrewriteIssues and PRs related to rewrite

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions