We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
urlObject.hash
linker.toLinkForContent
1 parent 938125e commit 4b67fe5Copy full SHA for 4b67fe5
.changeset/thin-buckets-grow.md
@@ -0,0 +1,5 @@
1
+---
2
+"gitbook-v2": patch
3
4
+
5
+Add `urlObject.hash` to `linker.toLinkForContent` to pass through URL fragment identifiers, used in search
packages/gitbook-v2/src/lib/context.ts
@@ -165,7 +165,7 @@ export function getBaseContext(input: {
165
// Create link in the same format for links to other sites/sections.
166
linker.toLinkForContent = (rawURL: string) => {
167
const urlObject = new URL(rawURL);
168
- return `/url/${urlObject.host}${urlObject.pathname}${urlObject.search}`;
+ return `/url/${urlObject.host}${urlObject.pathname}${urlObject.search}${urlObject.hash}`;
169
};
170
}
171
0 commit comments