Skip to content

Fix link display text escaping for notebooks/plans#10829

Merged
johnturcoo merged 3 commits into
masterfrom
johnturco/app-2628-text-for-links-escaping-improperly-in-notebooksplans
May 14, 2026
Merged

Fix link display text escaping for notebooks/plans#10829
johnturcoo merged 3 commits into
masterfrom
johnturco/app-2628-text-for-links-escaping-improperly-in-notebooksplans

Conversation

@johnturcoo
Copy link
Copy Markdown
Contributor

@johnturcoo johnturcoo commented May 13, 2026

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_url captured URLs as raw &str slices 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_url to 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

  • I have manually tested my changes locally with ./script/run -> Demo of fix
  • Added several tests to markdown_parser_tests.rs to verify correct URL parsing behavior
  • Added round trip test to markdown_tests.rs to verify link consistency after several save/load cycles

Screenshots / 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.

@cla-bot cla-bot Bot added the cla-signed label May 13, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 13, 2026

@johnturcoo

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Co-Authored-By: Oz <oz-agent@warp.dev>
Copy link
Copy Markdown
Contributor

@lucieleblanc lucieleblanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@johnturcoo johnturcoo force-pushed the johnturco/app-2628-text-for-links-escaping-improperly-in-notebooksplans branch 2 times, most recently from f5278bf to 9a2b87f Compare May 13, 2026 21:21
@peicodes
Copy link
Copy Markdown
Contributor

@johnturcoo I see you've included a video of the bug - could you also include a video of the fix?

@johnturcoo
Copy link
Copy Markdown
Contributor Author

@peicodes The demo of the fix is in the testing section but I will add it to the "Screenshots / Videos" section for clarity

Comment thread crates/markdown_parser/src/markdown_parser.rs
Copy link
Copy Markdown
Contributor

@peicodes peicodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed the video! Great fix :)

@johnturcoo johnturcoo merged commit 5c90c9c into master May 14, 2026
32 of 33 checks passed
@johnturcoo johnturcoo deleted the johnturco/app-2628-text-for-links-escaping-improperly-in-notebooksplans branch May 14, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text for links escaping improperly in notebooks/plans

3 participants