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

Add external_link_mode option to open links in a new tab #9

Merged
merged 1 commit into from
Sep 24, 2020

Conversation

jon-betts
Copy link
Contributor

@jon-betts jon-betts commented Sep 7, 2020

This allows you to set an option and have links open in a new tab. For: hypothesis/via#259

Testing

Negative case:

Positive case:

@jon-betts jon-betts added the enhancement New feature or request label Sep 7, 2020
@jon-betts jon-betts requested a review from seanh September 7, 2020 13:19
@jon-betts jon-betts self-assigned this Sep 7, 2020
Base automatically changed from test-coverage to master September 23, 2020 15:30
@@ -111,5 +111,7 @@
var embed_script = document.createElement("script");
embed_script.src = "{{ h_embed_url }}";
document.head.appendChild(embed_script);

setupExternalLinkHandler({{external_link_mode(env) | tojson}});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd copy pasted the code that actually does the work for this above from Via ages ago. We just need to turn it on.

The tojson here will convert our python string into a well formatted javascript string, and prevents any nonsense from leaking out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants