Skip to content

Commit

Permalink
chore: merge dev to main
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatZPP committed Sep 13, 2023
2 parents 5030024 + 33feb4b commit 91415ba
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/devui-vue/devui/code-review/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ export function parseDiffCode(container: HTMLElement, code: string, outputFormat
newTrStr += `<tr>${leftTdList?.join('')}${rightTdList?.join('')}</tr>`;
}
const tbodyAttr = diffHtmlStr.match(TableTbodyAttrReg)?.[1] || '';
const newDiffHtmlStr = diffHtmlStr.replace(TableTbodyReg, `<tbody ${tbodyAttr}>${newTrStr}</tbody>`);
const emptyDiffHtmlStr = diffHtmlStr.replace(TableTbodyReg, `<tbody${tbodyAttr}></tbody>`);
const index = emptyDiffHtmlStr.indexOf(`<tbody${tbodyAttr}>`);
const newDiffHtmlStr = emptyDiffHtmlStr.slice(0, index) + newTrStr + emptyDiffHtmlStr.slice(index);
diff2HtmlUi.diffHtml = newDiffHtmlStr;
}
diff2HtmlUi.draw();
Expand Down
84 changes: 84 additions & 0 deletions packages/devui-vue/docs/components/editor-md/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,90 @@ export default defineComponent({
editor-md/checkbox
:::

### 数学公式 渲染

:::demo 通过配置md-plugins katex插件,进行数学公式渲染。

```vue
<template>
<d-editor-md
v-model="content"
>
</d-editor-md>
<!-- <d-editor-md
v-model="content"
:md-plugins="plugins"
>
</d-editor-md> -->
</template>
<script>
import { defineComponent, reactive, ref } from 'vue';
// import mk from '@ittakahiro/markdown-it-katex'; // 请首先安装 @ittakahiro/markdown-it-katex 依赖
export default defineComponent({
setup() {
const content = ref(`$E = mc^2$
$\\sqrt{3x-1}+(1+x)^2$ // DEMO无法进行import,使用时请放开代码中注释
`);
mdPlugins = [{
// plugin: mk
}];
return { content, mdPlugins };
},
});
</script>
```

:::

### PlantUML 渲染

:::demo 通过配置md-plugins plantuml插件,进行plantuml图渲染。

```vue
<template>
<d-editor-md
v-model="content"
>
</d-editor-md>
<!-- <d-editor-md
v-model="content"
:md-plugins="plugins"
>
</d-editor-md> -->
</template>
<script>
import { defineComponent, reactive, ref } from 'vue';
// import PlantUml from 'markdown-it-plantuml'; // 请首先安装 markdown-it-plantuml 依赖
export default defineComponent({
setup() {
const content = ref(`// DEMO无法进行import,使用时请放开代码中注释
@startuml
Alice -> "Bob()" : Hello
"Bob()" -> "This is very long" as Long
' You can also declare:
' "Bob()" -> Long as "This is very long"
Long --> "Bob()" : ok
@enduml`);
mdPlugins = [{
// plugin: PlantUml,
// opts: {server: 'https://www/plantuml.com/plantuml'} // 自定义server可参考plantuml官方文档进行搭建
}];
return { content, mdPlugins };
},
});
</script>
```

:::

### 配置快速提示

:::demo 设置 hintConfig 后,可用于支持@选择用户等场景。
Expand Down
4 changes: 3 additions & 1 deletion packages/devui-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-devui",
"version": "1.5.15-feat.1",
"version": "1.5.15-hotfix.1",
"license": "MIT",
"description": "DevUI components based on Vite and Vue3",
"keywords": [
Expand Down Expand Up @@ -48,6 +48,7 @@
"@babel/helper-hoist-variables": "^7.22.5",
"@devui-design/icons": "^1.3.0",
"@floating-ui/dom": "^0.4.4",
"@iktakahiro/markdown-it-katex": "^4.0.1",
"@types/codemirror": "0.0.97",
"@types/lodash-es": "^4.17.4",
"@vue/shared": "^3.2.33",
Expand All @@ -65,6 +66,7 @@
"lodash": "^4.17.21",
"lodash-es": "^4.17.20",
"markdown-it": "12.2.0",
"markdown-it-plantuml": "^1.4.1",
"mermaid": "9.1.1",
"mitt": "^3.0.0",
"monaco-editor": "0.34.0",
Expand Down

0 comments on commit 91415ba

Please sign in to comment.