Skip to content

Commit

Permalink
fix(VCode,VKbd): set default tag
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Oct 31, 2024
1 parent 9809ad5 commit 18c0adc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/docs/src/components/app/Markdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { compile } from '@vue/compiler-dom'
import * as vue from 'vue'
import { VCode } from 'vuetify/components/VCode'
import { VWindowItem } from 'vuetify/components/VWindow'
import { VTab } from 'vuetify/components/VTabs'
import AppMarkup from '@/components/app/Markup.vue'
Expand Down Expand Up @@ -125,6 +126,7 @@
const template = computed(() => ({
// These components are all used in markdown-it-rules
components: {
VCode,
VWindowItem,
VTab,
AppMarkup,
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/utils/markdown-it-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ function addCodeRules (md: MarkdownIt) {
(token.attrs || []).reduce((acc, [key, value]) => {
acc[key] = acc[key] ? acc[key] + ' ' + value : value
return acc
}, { class: 'v-code' } as Record<string, string>)
}, {} as Record<string, string>)
).map(([key, value]) => `${key}="${value}"`).join(' ')

return `<code ${attrs}>${md.utils.escapeHtml(token.content)}</code>`
return `<v-code ${attrs}>${md.utils.escapeHtml(token.content)}</v-code>`
}

createContainer(md, 'error')
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VCode/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import './VCode.sass'
// Utilities
import { createSimpleFunctional } from '@/util'

export const VCode = createSimpleFunctional('v-code')
export const VCode = createSimpleFunctional('v-code', 'code')

export type VCode = InstanceType<typeof VCode>
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VKbd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import './VKbd.sass'
// Utilities
import { createSimpleFunctional } from '@/util'

export const VKbd = createSimpleFunctional('v-kbd')
export const VKbd = createSimpleFunctional('v-kbd', 'kbd')

export type VKbd = InstanceType<typeof VKbd>

0 comments on commit 18c0adc

Please sign in to comment.