Skip to content

Commit

Permalink
fix: class string separator
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Dec 12, 2023
1 parent 0cb5405 commit 337a005
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/autocapture.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
)
})
})
Expand Down
2 changes: 1 addition & 1 deletion src/autocapture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 337a005

Please sign in to comment.