Skip to content

Commit 6dde5f0

Browse files
committed
Treat portal book links as external; open in current tab
1 parent e34f61e commit 6dde5f0

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/app/helpers/link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {WindowWithSettings} from './window-settings';
22

33
const EXTERNAL = /^([a-z]+:)/;
44
const ABSOLUTE_OPENSTAX = new RegExp(
5-
`(?:https?://openstax.org|${window.location.origin})(?!/(?:books|accounts|oxauth|blog-feed|documents)/)`
5+
`(?:https?://openstax.org|${window.location.origin})(?!/(?:(?:.*/)?books|accounts|oxauth|blog-feed|documents)/)`
66
);
77
const MAILTO = /^mailto:(.+)/;
88

src/app/pages/details/common/get-this-title-files/give-before-pdf/content-warning.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default function ContentWarning({
3636
{...(track ? {'data-track': track} : {})}
3737
onClick={closeAfterDelay}
3838
className="btn go-to"
39+
data-local="true"
3940
>
4041
Go to your {variant === 'View online' ? 'book' : 'file'}
4142
</a>

src/app/pages/details/common/get-this-title-files/give-before-pdf/give-before-other.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export default function GiveBeforeOther({
6464
className='btn go-to'
6565
{...(track ? {'data-track': track} : {})}
6666
data-variant={lookupVariant(variant)}
67+
data-local="true"
6768
>
6869
Go to your {lookupVariant(variant)}
6970
</a>

0 commit comments

Comments
 (0)