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 {
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 === '' ) {
Original file line number Diff line number Diff 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 : '上标' ,
Original file line number Diff line number Diff line change 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" : [
You can’t perform that action at this time.
0 commit comments