Skip to content

merged clippings can lose Kindle locations #15

@cfm

Description

@cfm

In the adjacent-location merge branch, a.location_end is overwritten with b.location_end. Since parse_clippings allows location_end to be None when the input is Location <n> (no range), this can accidentally erase an existing a.location_end even though the merged clipping still has a known end. Consider normalizing single-location entries to end = start in parse_clippings, or (at least in this branch) updating the end via max_opt(a.location_end, b.location_end.or(b.location_start)) / preserving a.location_end when b.location_end is None.

                    let new_end = max_opt(a.location_end, b.location_end.or(b.location_start));
                    a.location_end = new_end;

Originally posted by @Copilot in #14 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions