Skip to content

Commit

Permalink
feat: support configure plantuml args
Browse files Browse the repository at this point in the history
  • Loading branch information
jiawei686 committed Jun 13, 2022
1 parent 34725a8 commit ec97968
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/addons/cherry-code-block-plantuml-plugin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/**
* Copyright (C) 2021 THL A29 Limited, a Tencent company.
*
Expand Down Expand Up @@ -72,13 +73,16 @@ function compress(s1, url) {
}

export default class PlantUMLCodeEngine {
static install(cherryOptions, ...args) {
static install(cherryOptions, args) {
mergeWith(cherryOptions, {
engine: {
syntax: {
codeBlock: {
customRenderer: {
plantuml: new PlantUMLCodeEngine(...args),
plantuml: new PlantUMLCodeEngine({
...args,
...(cherryOptions.engine.syntax.plantuml ?? {}),
}),
},
},
},
Expand Down
1 change: 1 addition & 0 deletions tsconfig.addons.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// 按需引入addons,尽量不引入编辑器代码
"include": [
"src/addons/cherry-code-block-mermaid-plugin.js",
"src/addons/cherry-code-block-plantuml-plugin.js",
],
"files": [
"types/codemirror.d.ts",
Expand Down

0 comments on commit ec97968

Please sign in to comment.