Skip to content

Conversation

@gustavnikolaj
Copy link
Contributor

This PR addresses #101

I went with a slightly different approach than the two suggestions I outlined in the issue.

I decided not to alter the existing logic, which is enabling it in specific attributes where it makes sense by the HTML spec as laid out in the PATH_TAG_AND_ATTR object (referring to this stackoverflow comment: https://stackoverflow.com/questions/2725156/complete-list-of-html-tag-attributes-which-have-a-url-value/2725168#2725168).

Instead, I added a check before that, such that isPathAttribute will return true whenever the name of the attribute is src or href.

I could have cleaned up the PATH_TAG_AND_ATTR object, as the href attribute on the a tag is already covered by the early return, but I kept it in there for completeness sake.

I added a test which shows that the completion is now triggered in both href and src attributes on a fictitious custom element.

@ghost
Copy link

ghost commented Nov 17, 2021

CLA assistant check
All CLA requirements met.

@aeschli aeschli added this to the November 2021 milestone Nov 29, 2021
@aeschli aeschli self-assigned this Nov 29, 2021
@aeschli aeschli merged commit 0080c38 into microsoft:main Nov 29, 2021
@aeschli
Copy link
Collaborator

aeschli commented Nov 29, 2021

Thanks @gustavnikolaj !

@gustavnikolaj gustavnikolaj deleted the gno/wider-path-completion branch November 29, 2021 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants