From 70e73faa78881b7a743544878296d6dbd62ee47a Mon Sep 17 00:00:00 2001 From: SakuraZ <80140609+Sakura-LF@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:54:06 +0800 Subject: [PATCH] feat: add Dart syntax highlighting for the code blocks in the editor (#5531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加代码块 dart 语言的高亮 #### What type of PR is this? /kind feature /area editor #### What this PR does / why we need it: > 为默认编辑器的代码块导入 dart 语言高亮 #### Which issue(s) this PR fixes: Fixes #5530 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note 为需要代码块dart语言高亮的用户提供支持 ``` --- ui/packages/editor/src/extensions/code-block/lowlight.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/packages/editor/src/extensions/code-block/lowlight.ts b/ui/packages/editor/src/extensions/code-block/lowlight.ts index 9cc5c37f5e..eb1238926b 100644 --- a/ui/packages/editor/src/extensions/code-block/lowlight.ts +++ b/ui/packages/editor/src/extensions/code-block/lowlight.ts @@ -1,6 +1,8 @@ import { common, createLowlight } from "lowlight"; import xml from "highlight.js/lib/languages/xml"; +import dart from "highlight.js/lib/languages/dart"; const lowlight = createLowlight(common); lowlight.register("html", xml); +lowlight.register("dart", dart); export default lowlight;