Skip to content

[Bug] Links in a video description can get misaligned #5821

Description

@lunasorcery

Describe the bug

Links in a video description may start later in the text than they should, i.e. <a href="...">Click here!</a> to... may instead render as Cli<a href="...">ck here! to</a>.... This occurs most visibly when there are emojis in the description before the link.

From a quick skim of description.cr, it looks like Invidious counts the offset/length in codepoints, and I'm guessing YouTube might be counting in utf16 code units instead (where an emoji would be a surrogate pair and count for 2 instead of 1)

Steps to Reproduce

  1. Open https://youtu.be/jjyesTkGNT4 in your instance of choice.
  2. Scroll down to the description.
  3. Observe that the clickable links start slightly later in the text than they should. For this video it's perhaps most obvious on the chapter markers.

Logs

Screenshots

Image

Additional context

No response

AI Policy

  • I have read the AI Policy and understand the disclosure requirements

AI usage

AI was not used to create this issue

Model(s) used

No response

Tool(s) used

No response

How was AI used?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions