Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links in citation hover should open in new window, or as per link-external-newwindow #7441

Closed
petrbouchal opened this issue Oct 31, 2023 · 3 comments · Fixed by #7465
Closed
Assignees
Labels
bibliography bug Something isn't working html Issues with HTML and related web technology (html/css/scss)
Milestone

Comments

@petrbouchal
Copy link

petrbouchal commented Oct 31, 2023

Bug description

In HTML format, links in reference previews in hovers above citations open in the same tab/window.

Presumably the behaviour of reference links in hover previews should follow link-external-newwindow, perhaps without the box-arrow given the space limitation (also the user can see the URL directly so there is less need for indicating external links).

Steps to reproduce

  1. create project
quarto create project website quarto-ref-links
cd quarto-link

Create references.bib with a reference containing a URL or DOI, e.g.


@article{athey,
	title = {Machine Learning Methods Economists Should Know About},
	author = {Athey, Susan and Imbens, Guido},
	doi = {10.48550/arXiv.1903.10075}
}

Edit index.qmd to use the references file and cite the reference:

---
title: "Bug"
format: 
    html:
        link-external-icon: true
        link-external-newwindow: true
bibliography: references.bib
---
@athey

Render to HTML. Click the DOI-based link in the hover tip over the citation.

Expected behavior

Presumably the behaviour of reference links in hover previews should follow link-external-newwindow, perhaps without the box-arrow given the space limitation (also the user can see the URL directly so there is less need for indicating external links).

Actual behavior

Link opens in same window/tab.

Your environment

MacOS 14.0 (23A344)
No IDE used

Quarto check output

Quarto 1.4.398
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.8: OK
Dart Sass version 1.55.0: OK
Deno version 1.33.4: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.4.398
Path: /Applications/quarto/bin

[✓] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/petr/Library/TinyTeX/bin/universal-darwin
Version: 2022

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
Version: 3.11.6
Path: /opt/homebrew/opt/python@3.11/bin/python3.11
Jupyter: 5.1.3
Kernels: python3, ir

() Checking Jupyter engine render....0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
Version: 4.3.1
Path: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources
LibPaths:
- /Users/petr/Library/R/4.3/library
- /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
knitr: 1.44
rmarkdown: 2.25

[✓] Checking Knitr engine render......OK

@petrbouchal petrbouchal added the bug Something isn't working label Oct 31, 2023
@mcanouil mcanouil added bibliography html Issues with HTML and related web technology (html/css/scss) labels Nov 1, 2023
@mcanouil
Copy link
Collaborator

mcanouil commented Nov 1, 2023

Few things, to open link in new window, you need link-external-newwindow: true which is not part of the example.

This being said, it works as expected in the reference section but indeed, the hover tippy box external links are not recognised.

image

@mcanouil mcanouil added the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Nov 1, 2023
@petrbouchal
Copy link
Author

@mcanouil Thanks for catching that - I edited the reprex to make it actually reproduce the issue.

@cderv
Copy link
Collaborator

cderv commented Nov 3, 2023

I think this is a matter of order. We are doing the creation of hover box with tippy before we research the links to add the icon.

If we do the external link processing before, this would work. I don't think this would have some bad effect.

@dragonstyle I can do a PR, but probably worth your thoughts before merging... 🤔

@cderv cderv added this to the v1.4 milestone Nov 3, 2023
@cderv cderv self-assigned this Nov 3, 2023
@cderv cderv removed the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bibliography bug Something isn't working html Issues with HTML and related web technology (html/css/scss)
Projects
None yet
4 participants