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

fix: add hyphen to data attribute regexp #231

Merged
merged 1 commit into from Oct 15, 2022

Conversation

hbanham
Copy link
Contributor

@hbanham hbanham commented Oct 10, 2022

Issue
Data attributes with multiple hyphens do not get removed entirely which causes the validator to check incorrect HTML.

Example
HTML (note the "-s"):
<p data-v-f17e0b0c-s>Test</p>

HTML expected to run through validator:
<p>Test</p>

HTML that actually runs through validator:
<p-s>Test</p>

html-validator output:

4:75  error  Unknown element <p-s>                                     no-unknown-elements
4:85  error  Mismatched close-tag, expected '</p-s>' but found '</p>'  close-order

Minimal reproduction
https://stackblitz.com/edit/github-cpclz6?file=components/test-outer.vue

Pull request suggested fix
I've added a hyphen character inside the matching list so that it will replace data attributes with multiple hyphens.

@netlify
Copy link

netlify bot commented Oct 10, 2022

Deploy Preview for html-validator canceled.

Name Link
🔨 Latest commit 30ace40
🔍 Latest deploy log https://app.netlify.com/sites/html-validator/deploys/63440000cbb7cf000805c79d

@danielroe danielroe changed the title fix: Some data attributes not being removed entirely fix: add hyphen to data attribute regexp Oct 15, 2022
@danielroe danielroe merged commit 900dd93 into nuxt-modules:main Oct 15, 2022
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.

None yet

2 participants