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

Skip custom click behavior on links when the download attribute is set #7311

Merged
merged 1 commit into from Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/rendermime-extension/src/index.ts
Expand Up @@ -80,6 +80,11 @@ function activate(
? null
: {
handleLink: (node: HTMLElement, path: string, id?: string) => {
// If node has the download attribute explicitly set, use the
// default browser downloading behavior.
if (node.tagName === 'A' && node.hasAttribute('download')) {
return;
}
app.commandLinker.connectNode(node, CommandIDs.handleLink, {
path,
id
Expand Down
2 changes: 1 addition & 1 deletion packages/rendermime-interfaces/src/index.ts
Expand Up @@ -320,7 +320,7 @@ export namespace IRenderMime {
/**
* Add the link handler to the node.
*
* @param node: the node for which to handle the link.
* @param node: the anchor node for which to handle the link.
*
* @param path: the path to open when the link is clicked.
*
Expand Down