From e4bb191e1dbacb010a2408a6c492c662d4bcd80d Mon Sep 17 00:00:00 2001 From: barrycohen Date: Wed, 7 Dec 2022 14:59:18 +0000 Subject: [PATCH 1/2] Fix language prop being ignored Fixes a logic error which meant autodetection would override an explicit language being given. --- src/vue.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vue.ts b/src/vue.ts index 2358af4..dc575d6 100644 --- a/src/vue.ts +++ b/src/vue.ts @@ -27,7 +27,7 @@ const component = defineComponent({ language.value = newLanguage }) - const autodetect = computed(() => props.autodetect || !language.value) + const autodetect = computed(() => props.autodetect && !language.value) const cannotDetectLanguage = computed(() => !autodetect.value && !hljs.getLanguage(language.value)) const className = computed((): string => { From c85bdc5fb783255ed030d48c32977e1730740ebe Mon Sep 17 00:00:00 2001 From: barrycohen Date: Thu, 8 Dec 2022 09:10:45 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3e1d4b..19017fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.3 + +- Fix `language` prop being ignored unless `autodetect` is explicitly set to `false` (#41) + ## 2.1.2 - Default to `tabindex="0"` on the internal `` element to allow keyboard scrolling when a scrollbar is applied to the element. This resolves an accessibility issue found by Vue-Axe. (#33)