Adapt some patterns
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". 🙃
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.
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?

@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
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