Skip to content

Commit d449012

Browse files
authored
Merge pull request #610 from docat-org/fix/empty-links-interpreted-as-not-empty
Fix empty links interpreted as not empty, resulted in weird behavior
2 parents d4aa4fd + 8fa13b5 commit d449012

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

web/src/components/IFrame.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ export default function IFrame(props: Props): JSX.Element {
3737
return
3838
}
3939

40-
if (a.href.trim() === '') {
41-
// ignore empty links, may be handled with js internally,
42-
// so we'll ignore it. Will inevitably cause the user to have to click back
40+
const href = a.getAttribute('href') ?? ''
41+
if (href.trim() === '') {
42+
// ignore empty links, may be handled with js internally.
43+
// Will inevitably cause the user to have to click back
4344
// multiple times to get back to the previous page.
4445
return
4546
}

0 commit comments

Comments
 (0)