Repository navigation
fix: resolve document refs from browser URLs with anchors, queries or trailing paths - #155
Merged
Merged
Conversation
… trailing paths The document ID was taken from the last path segment of the input, so URLs copied from the browser (`/doc/<slug>#heading`, `?query`, `/edit`, `/history/...`) missed the ID lookup and fell through to a full title scan that reported "not found". Read the slug from the `/doc/<slug>` segment instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scottlovegrove
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this, the fix looks right and the URL shapes in the test cover what people actually paste. One small follow-on suggestion inline.
Outline also serves documents at `/doc/<urlId>`. That segment has no hyphen, so the slug-suffix match failed and the whole URL was returned, ending in "Document not found". Fall back to the `/doc/` segment itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scottlovegrove
approved these changes
Oct 23, 2026
doist-release-bot Bot
added a commit
that referenced
this pull request
Oct 23, 2026
## [2.1.12](v2.1.11...v2.1.12) (2026-10-23) ### Bug Fixes * resolve document refs from browser URLs with anchors, queries or trailing paths ([#155](#155)) ([78b0087](78b0087))
Contributor
|
🎉 This PR is included in version 2.1.12 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Document refs copied from the browser didn't resolve when the URL had anything after the slug: a
#headinganchor, a?querystring, or a trailing path such as/editor/history/<revision>. The ID was taken from the last path segment, sool doc get https://wiki.example.com/doc/my-doc-AbC123#setupskipped the ID lookup, fetched every document to try a title match, and then reportedDocument not found.The slug is now read from the
/doc/<slug>segment, ignoring the query and fragment. Input without/doc/(bare slugs, IDs, titles) takes the same path as before.Tested:
npm test(240 passing, with a new case for each URL shape), type-check, lint, format and the skill sync check. Against self-hosted Outline 1.11.0, one document resolves to the same ID from its plain URL and with a trailing/,#anchor,?query,/editand/history#…appended.