Fix link display text escaping for notebooks/plans#10829
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR updates autolink parsing to return owned URL strings after processing Markdown backslash escapes, and adjusts the autolink call site plus parser/editor round-trip tests for escaped URL display text.
Concerns
- No blocking correctness or security concerns found in the changed lines.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
lucieleblanc
left a comment
There was a problem hiding this comment.
Nice. This is almost exactly what I had in warpdotdev/warp-internal#22999, with cleaner logic using parse_escape. There are some assertions and new test cases I'd add (see that old PR), otherwise LGTM.
f5278bf to
9a2b87f
Compare
|
@johnturcoo I see you've included a video of the bug - could you also include a video of the fix? |
|
@peicodes The demo of the fix is in the testing section but I will add it to the "Screenshots / Videos" section for clarity |
peicodes
left a comment
There was a problem hiding this comment.
Sorry I missed the video! Great fix :)
Description
Resolves #10055
Each time a notebook or plan was saved and reopened, backslash escape characters accumulated in the display text of any link.
The root cause:
parse_urlcaptured URLs as raw&strslices without unescaping backslash sequences. When the serializer wrote those URLs back as link display text it re-escaped them (. → \. , \. -> \\\. , etc), so each load/save cycle added another layer of backslashes.This PR modifies
parse_urlto process backslash escapes inline (e.g. \. → .) and return an owned String.Linked Issue
https://linear.app/warpdotdev/issue/APP-2628/text-for-links-escaping-improperly-in-notebooksplans
Testing
./script/run-> Demo of fixmarkdown_parser_tests.rsto verify correct URL parsing behaviormarkdown_tests.rsto verify link consistency after several save/load cyclesScreenshots / Videos
Demo of issue
Demo of fix
Changelog Entries for Stable
CHANGELOG-BUG-FIX: Fixed escape characters accumulating in notebook and plan link display text on each save/load cycle.