Skip to content

Link parsing is based on raw text, not on the displayed text without markup #127

Open

Description

@BlueZeeKing

When links are parsed their beginning and end indices are found in the input text which contains the raw pango markup, but the link regions are determined by using the same index in the final parsed text. This means that as markup is added, including the markup used in styling the links, the link region ends up in the wrong spot.

Activity

  1. UncleJ4ck commented on Nov 9, 2026

    @UncleJ4ck
    Contributor

    Tracked it down: parseText stores each link's begin/end as offsets into the raw marked-up string, but recheckTextBoxes uses them against pango's layout text, which is the markup-stripped version. So the link's own <u><span> wrapper (and any styling before it) pushes the region off the glyphs, worst on the second link onward. Fix in #158 counts displayed bytes for begin/end instead, with a couple of regression tests pinning the slice to the link text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions