Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(shiki): switch to official shiki package #40

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"@kong/design-tokens": "^1.12.7",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@shikijs/markdown-it": "^1.1.2",
"@types/jsdom": "^21.1.6",
"@types/markdown-it": "^13.0.7",
"@types/markdown-it-attrs": "^4.1.3",
Expand All @@ -107,14 +108,13 @@
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.20.1",
"jsdom": "^23.2.0",
"markdown-it-shikiji": "^0.9.19",
"postcss": "^8.4.33",
"postcss-html": "^1.6.0",
"rimraf": "^5.0.5",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.70.0",
"semantic-release": "^22.0.12",
"shikiji": "^0.9.19",
"shiki": "^1.1.2",
"stylelint": "^16.2.0",
"stylelint-config-html": "^1.1.0",
"stylelint-config-recommended-scss": "^14.0.0",
Expand Down
106 changes: 29 additions & 77 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
},
{
"automerge": true,
"groupName": "all shikiji dependencies",
"groupSlug": "all-shikiji-dependencies",
"groupName": "all shiki dependencies",
"groupSlug": "all-shiki-dependencies",
"matchPackagePatterns": [
"^(.*)?shikiji"
"^(.*)?shiki"
]
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/composables/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import useDebounce from './useDebounce'
import useKeyboardShortcuts from './useKeyboardShortcuts'
import useMarkdownActions from './useMarkdownActions'
import useMarkdownIt from './useMarkdownIt'
import useShikiji from './useShikiji'
import useShiki from './useShiki'
import useSyncScroll from './useSyncScroll'

export default {
useDebounce,
useKeyboardShortcuts,
useMarkdownActions,
useMarkdownIt,
useShikiji,
useShiki,
useSyncScroll,
}
6 changes: 3 additions & 3 deletions src/composables/useMarkdownIt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref } from 'vue'
import useShikiji from '@/composables/useShikiji'
import useShiki from '@/composables/useShiki'
import { NEW_LINE_CHARACTER, COPY_ICON_SVG, HEADER_LINK_ICON_SVG } from '@/constants'
import type { Theme } from '@/types'

Expand All @@ -26,7 +26,7 @@ const md = ref()
export default function useMarkdownIt() {
/** Initialize markdown-it - ideally called in the `onBeforeMount` hook */
const init = async (theme: Theme = 'light'): Promise<void> => {
const { MarkdownItShikiji } = useShikiji()
const { MarkdownItShiki } = useShiki()

md.value = MarkdownIt({
html: false, // Keep disabled to prevent XSS
Expand All @@ -36,7 +36,7 @@ export default function useMarkdownIt() {
typographer: true, // Enable some language-neutral replacement + quotes beautification
quotes: '“”‘’',
})
.use(await MarkdownItShikiji(theme))
.use(await MarkdownItShiki(theme))
.use(anchor, {
level: 2,
slugify: s => slugify(s),
Expand Down
Loading