-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add data-language attribute to code blocks in ProsePre component
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@d0rich/nuxt-design-system': patch | ||
--- | ||
|
||
Add data-language for code blocks for telegram instant view |
48 changes: 48 additions & 0 deletions
48
packages/nuxt-design-system/components/content/ProsePre.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<template> | ||
<ProseCode | ||
:code="code" | ||
:language="language" | ||
:filename="filename" | ||
:highlights="highlights" | ||
:meta="meta" | ||
> | ||
<pre | ||
:class="$props.class" | ||
:style="style" | ||
:data-language="language" | ||
><slot /></pre> | ||
</ProseCode> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
defineProps({ | ||
code: { | ||
type: String, | ||
default: '' | ||
}, | ||
language: { | ||
type: String, | ||
default: null | ||
}, | ||
filename: { | ||
type: String, | ||
default: null | ||
}, | ||
highlights: { | ||
type: Array as () => number[], | ||
default: () => [] | ||
}, | ||
meta: { | ||
type: String, | ||
default: null | ||
}, | ||
class: { | ||
type: String, | ||
default: null | ||
}, | ||
style: { | ||
type: [String, Object], | ||
default: null | ||
} | ||
}) | ||
</script> |