Skip to content

Commit a2dcfbe

Browse files
authored
Merge pull request #1944 from DevCloudFE/dev
chore: update main
2 parents 676903b + 9e56c45 commit a2dcfbe

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/devui-vue/devui/editor-md/src/toolbar-config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ class ToolBarHandler {
258258
static code = (editor: any): void => {
259259
const cursor = editor.getCursor();
260260
const selection = editor.getSelection();
261-
editor.replaceSelection('`' + selection + '`');
261+
if (selection.indexOf('\n') === -1) {
262+
editor.replaceSelection('`' + selection + '`');
263+
} else {
264+
editor.replaceSelection('```\n' + selection + '\n```');
265+
}
262266
editor.focus();
263267

264268
if (selection === '') {

packages/devui-vue/devui/editor-md/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function locale(key: string): string {
4040
file: '文件',
4141
table: '表格',
4242
link: '超链接',
43-
code: '行内代码',
43+
code: '代码',
4444
codeblock: '代码块',
4545
blockquote: '引用',
4646
superscript: '上标',

packages/devui-vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-devui",
3-
"version": "1.6.32",
3+
"version": "1.6.33",
44
"license": "MIT",
55
"description": "DevUI components based on Vite and Vue3",
66
"keywords": [

0 commit comments

Comments
 (0)