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: class string separator #935

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: class string separator
pauldambra committed Dec 12, 2023
commit 337a00554106fc0531ac741b7cab0b8280188e10
2 changes: 1 addition & 1 deletion src/__tests__/autocapture.test.ts
Original file line number Diff line number Diff line change
@@ -1123,7 +1123,7 @@ describe('Autocapture system', () => {
const props1 = getCapturedProps(newLib.capture)

expect(props1['$elements_chain']).toBe(
'a.test-class,test-class2,test-class3,test-class4,test-class5:nth-child="1"nth-of-type="1"href="http://test.com"attr__href="http://test.com"attr__class="test-class,test-class2,test-class3,test-class4,test-class5";span:nth-child="1"nth-of-type="1"'
'a.test-class.test-class2.test-class3.test-class4.test-class5:nth-child="1"nth-of-type="1"href="http://test.com"attr__href="http://test.com"attr__class="test-class test-class2 test-class3 test-class4 test-class5";span:nth-child="1"nth-of-type="1"'
)
})
})
2 changes: 1 addition & 1 deletion src/autocapture.ts
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ const autocapture = {
// html attributes can _technically_ contain linebreaks,
// but we're very intolerant of them in the class string,
// so we strip them.
value = splitClassString(value).join()
value = splitClassString(value).join(' ')
}
props['attr__' + attr.name] = limitText(1024, value)
}