fix(renderer): join multiline external links#2503
Conversation
Greptile SummaryThis PR adds multiline URL joining to
Confidence Score: 4/5The core joining logic works for the primary Linear UUID-path use case, but one code path in joinMultilineUrl can silently corrupt URLs that break at a separator character followed by an indented label. The breaksUrlSegment branch joins unconditionally without consulting startsIndentedLabel, so a URL like https://example.com/name- apps/emdash-desktop/src/renderer/lib/external-url.ts — the joinMultilineUrl decision tree and the test file both need a case covering a separator-terminated URL followed by an indented label.
|
| Filename | Overview |
|---|---|
| apps/emdash-desktop/src/renderer/lib/external-url.ts | Adds joinMultilineUrl and trimTrailingText helpers; the startsIndentedLabel guard correctly blocks indented labels after alphanumeric URL endings but is bypassed when the previous character is a URL separator (breaksUrlSegment path), leaving a false-join case unhandled. |
| apps/emdash-desktop/src/renderer/lib/external-url.test.ts | Adds two new test cases covering multiline URL joining and indented label detection, but no test covers a URL ending in a separator character followed by an indented label. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[joinMultilineUrl - match linebreak] --> B{previousChar or nextChar missing?}
B -->|Yes| C[Keep linebreak]
B -->|No| D{nextChar matches URL_CONTINUATION?}
D -->|No| C
D -->|Yes| E{breaksUrlSegment - prev is separator}
E -->|Yes| F[Join unconditionally - startsIndentedLabel NOT checked]
E -->|No| G{hasIndent - lineBreak ends with space or tab}
G -->|No| C
G -->|Yes| H{startsIndentedLabel matches Word-colon pattern}
H -->|Yes| C
H -->|No| I[Join]
Reviews (2): Last reviewed commit: "fix(renderer): avoid joining indented UR..." | Re-trigger Greptile
arnestrickmann
left a comment
There was a problem hiding this comment.
thanks for the fix
Description
Screenshot/Recording (if applicable)
https://streamable.com/l1mccd
Checklist
messages and, when possible, the PR title