Skip to content

Commit

Permalink
fix(vscode): fix colon highlighting (#2463)
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Apr 8, 2023
1 parent 1c177bf commit 4b29c98
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/extractors/split.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Extractor } from '../types'
import { isValidSelector } from '../utils'

export const defaultSplitRE = /[\\:]?[\s'"`;{}]+/g
export const splitWithVariantGroupRE = /[\\:]?([\s"'`;<>*]|:\(|\)"|\)\s)/g
export const splitWithVariantGroupRE = /([\\:]?[\s"'`;<>*]|:\(|\)"|\)\s)/g

export const quotedArbitraryValuesRE = /(?:[\w&:[\]-]|\[\S+=\S+\])+\[\\?['"]?\S+?['"]\]\]?[\w:-]*/g
export const arbitraryPropertyRE = /\[(\\\W|[\w-])+:[^\s:]*?("\S+?"|'\S+?'|`\S+?`|[^\s:]+?)[^\s:]*?\)?\]/g
Expand Down
19 changes: 19 additions & 0 deletions test/pos.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,25 @@ describe('matched-positions', async () => {
]
`)
})

test('colon highlighting #2460', async () => {
const uno = createGenerator({
presets: [
presetUno(),
],
})

expect(await match(uno, 'w5:<div class="w-full"></div>'))
.toMatchInlineSnapshot(`
[
[
15,
21,
"w-full",
],
]
`)
})
})

describe('matched-positions-pug', async () => {
Expand Down

0 comments on commit 4b29c98

Please sign in to comment.