Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Custom Link AttributesNew to Visual Studio Code? Get it now.
Custom Link Attributes

Custom Link Attributes

andersonbruceb

|
2 installs
| (0) | Free
Make custom HTML attributes behave like hyperlinks
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vs-code-custom-links

Features

This extension automatically resolves some custom attributes so that they are tried like the href or src attributes, with a bit of a twist:

Example

<html>
    <head>
        <script type=importmap>
            {
                "imports": {
                    "my-package/": "/node_modules/my-package/"
                }
            }           
        </script>
    </head>
    <body>
        <my-html-based-web-component imp-h="my-package/root.html"></my-html-based-web-component>


        <script type=module>
            import './imp-h.js';
        </script>
    </body>
</html>

Assuming node module my-package has a file called root.html, right clicking on the imp-h attribute will take you to that file.

This extension provides out of the box support for imp-h, be-importing and be-written.

Adding support for additional attributes

To add your additional custom attributes, for example: ["data-src", "data-href", "custom-link"]:

Open VS Code settings (Ctrl+,) Search for "Custom Link Attributes"

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft