Add PowerShell syntax highlighting

This commit is contained in:
Yuri Karamian
2026-06-19 14:05:04 +02:00
parent 683a01627e
commit e275f5c0bb
+2
View File
@@ -23,6 +23,7 @@
import { Details, DetailsSummary, DetailsContent } from '@tiptap/extension-details'; import { Details, DetailsSummary, DetailsContent } from '@tiptap/extension-details';
import TextAlign from '@tiptap/extension-text-align'; import TextAlign from '@tiptap/extension-text-align';
import { common, createLowlight } from 'lowlight'; import { common, createLowlight } from 'lowlight';
import powershell from 'highlight.js/lib/languages/powershell';
import MarkdownIt from 'markdown-it'; import MarkdownIt from 'markdown-it';
import markdownItMark from 'markdown-it-mark'; import markdownItMark from 'markdown-it-mark';
import markdownItSup from 'markdown-it-sup'; import markdownItSup from 'markdown-it-sup';
@@ -498,6 +499,7 @@
let isQuickAccess = $derived(noteRelativePath ? $quickAccessPaths.includes(noteRelativePath) : false); let isQuickAccess = $derived(noteRelativePath ? $quickAccessPaths.includes(noteRelativePath) : false);
const lowlight = createLowlight(common); const lowlight = createLowlight(common);
lowlight.register('powershell', powershell);
const codeLanguages = [...lowlight.listLanguages(), 'mermaid'].sort(); const codeLanguages = [...lowlight.listLanguages(), 'mermaid'].sort();
const mdit = MarkdownIt({ html: true, linkify: false, breaks: false }) const mdit = MarkdownIt({ html: true, linkify: false, breaks: false })
.use(markdownItMark) .use(markdownItMark)