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

Adapt some patterns #51

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open

Conversation

Mars073
Copy link

@Mars073 Mars073 commented Mar 8, 2022

Hello,
I had a problem with HTML tag pattern:

  • it matches with typescript generic interfaces
  • it matches all tags that start with html
<template>
<div>
  <html5-custom-tag /> <!-- Provide a language [lang=""] -->
</div>
</template>
<script lang="ts" setup>
// ...
const myTag: Ref<HTMLDivElement | null>(null); // Provide a language [lang=""]
// ...
</script>

I modified some regexes, I don't know if it was more optimized before, but I find my version more "simple". 🙃

@Mars073 Mars073 changed the title Fix/bad patterns Adapt some patterns Mar 8, 2022
@Mars073 Mars073 changed the base branch from main to dev March 8, 2022 21:02
@mvdschee
Copy link
Owner

mvdschee commented Mar 9, 2022

Dankjewel! I will have to write some test cases to check if it's still working in all cases.

I should have done this a long time ago; there are some weird cases where some regex will not work if there is line wrapping example:

<span
  class="btn"
  ...
>

I have added a quick setup in the dev branch called /playground, but it is far from complete and will be adding more cases so I can test.

@Mars073
Copy link
Author

Mars073 commented Mar 9, 2022

I did some tests and noticed that the expression didn't work if the number of characters was even or odd, I think it was groups with \s that were evaluated wrong. I've tried all the playground tests and (I hope) everything is good now 🙈

I think there is a problem in the logic of the validateSpan, role="button" is supposed to be wrong?
image

@mvdschee
Copy link
Owner

@Mars073 I will do some more checks and add the rest to make sure it does everything like before but I think it will be fine.

Hmm yes span with role="button" is correct, it shouldn't give a warning even tho you should really just keep using a button for any clicks with JS that is not a link

@mvdschee
Copy link
Owner

I have checked and what is happening is the span should not have been disabled, I made semanticExclude work on all issues for span which should have just been for the semantic issue. I will change that

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