Adds suggestion

pull/2059/head
Raiden1411 3 years ago
parent c8e604aa64
commit dfe81438c7
No known key found for this signature in database
GPG Key ID: 337DBED79FA16BE6

@ -10,13 +10,10 @@ export function useCodeGroups() {
const group = el.parentElement?.parentElement
const i = Array.from(group?.querySelectorAll('input') || []).indexOf(el)
// This filters out shiki twoslash divs with the `language-id` className.
const filtered = Array.from(
group?.querySelectorAll('div[class*="language-"]') || []
).filter((val) => !val.className.match('language-id'))
const current = group?.querySelector('div[class*="language-"].active')
const next = filtered?.[i]
const next = group?.querySelectorAll(
'div[class*="language-"]:not(.language-id)'
)?.[i]
if (current && next && current !== next) {
current.classList.remove('active')

Loading…
Cancel
Save