Repository navigation
fix(shared): Markdown links and images with uppercase FILE keep their URLs - #43836
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceReplayed the reported lowercase, uppercase, and mixed-case file links/images and lowercase/uppercase themed pictures in fresh projects. Opened the same response at 1280×800 in light and dark mode. Base loses the affected link destinations and images; head retains destinations, loads all images, and preserves LIGHT/DARK variants.
Scenario source · Before recording · After recording Not shown:
|




Problem
Markdown links and images written with uppercase
FILE:lose their targets during sanitization, although lowercasefile:works and local-file resolvers accept either casing. Theme-specific picture sources are stripped too.Deterministic repro on
origin/main(beb24ffed87bbb45e81dd27c7f253c30e83b2599)Run from the repository root:
Observed: lowercase retains
hrefandsrcand collects["file:///tmp/demo.png"]; uppercase loses both targets and returns[]. Expected: both retainhrefandsrcasfile:///tmp/demo.pngand collect the same source. The linked transcript includes an executable fixture for the realwordsHastrenderer and collector.Change
Extend the existing HTTP(S) scheme normalizer to lowercase
file:before sanitizing linkhrefand imagesrc,dataDarkSrc, anddataLightSrc, preserving the rest of each URL. The shared pass covers web/desktop Words rendering and server image collection; native mobile uses its own renderer. Existing local-file classification and host-path checks remain in place. This is independent of providers and connection modes; no contracts, UI copy, entry points, or documentation change is needed.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
FILE:///tmp/demo.pngyielded an image withoutsrc; the expanded Markdown/HTML link assertions received[{}, {}]instead of twohrefvalues.vp test run packages/shared/src/markdownPipeline.test.ts: 3 consecutive passes, 29/29 tests each. The regression compares lowercase, uppercase, and mixed-case Markdown/HTML links and image sources, both theme variants, Windows paths, percent escapes, query/hash casing, and host URLs, with a disallowed-scheme control.vp run check:changed: exit 0.Authored by GPT-6.1 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).