File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,11 @@ class ToolBarHandler {
258
258
static code = ( editor : any ) : void => {
259
259
const cursor = editor . getCursor ( ) ;
260
260
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
+ }
262
266
editor . focus ( ) ;
263
267
264
268
if ( selection === '' ) {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export function locale(key: string): string {
40
40
file : '文件' ,
41
41
table : '表格' ,
42
42
link : '超链接' ,
43
- code : '行内代码 ' ,
43
+ code : '代码 ' ,
44
44
codeblock : '代码块' ,
45
45
blockquote : '引用' ,
46
46
superscript : '上标' ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-devui" ,
3
- "version" : " 1.6.32 " ,
3
+ "version" : " 1.6.33 " ,
4
4
"license" : " MIT" ,
5
5
"description" : " DevUI components based on Vite and Vue3" ,
6
6
"keywords" : [
You can’t perform that action at this time.
0 commit comments