File tree Expand file tree Collapse file tree 5 files changed +14
-8
lines changed
docs/components/editor-md Expand file tree Collapse file tree 5 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,11 @@ export class MDRenderService {
73
73
setCustomXssRules ( rules : ICustomXssRule [ ] ) {
74
74
if ( rules ) {
75
75
rules . forEach ( ( rule ) => {
76
- this . xssWhiteList [ rule [ 'key' ] ] = rule [ 'value' ] ;
76
+ if ( rule [ 'value' ] === null ) {
77
+ delete this . xssWhiteList [ rule [ 'key' ] ] ;
78
+ } else {
79
+ this . xssWhiteList [ rule [ 'key' ] ] = rule [ 'value' ] ;
80
+ }
77
81
} ) ;
78
82
}
79
83
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export interface MdPlugin {
16
16
17
17
export interface ICustomXssRule {
18
18
key : string ;
19
- value : string [ ] ;
19
+ value : string [ ] | null ;
20
20
}
21
21
22
22
export interface ICustomRenderRule {
Original file line number Diff line number Diff line change @@ -75,8 +75,7 @@ class ToolBarHandler {
75
75
76
76
if ( cursor . ch !== 0 ) {
77
77
editor . setCursor ( cursor . line , 0 ) ;
78
- editor . replaceSelection ( '# ' + selection ) ;
79
- editor . setCursor ( cursor . line , cursor . ch + 2 ) ;
78
+ editor . replaceSelection ( '# ' ) ;
80
79
} else {
81
80
editor . replaceSelection ( '# ' + selection ) ;
82
81
}
@@ -89,8 +88,7 @@ class ToolBarHandler {
89
88
90
89
if ( cursor . ch !== 0 ) {
91
90
editor . setCursor ( cursor . line , 0 ) ;
92
- editor . replaceSelection ( '## ' + selection ) ;
93
- editor . setCursor ( cursor . line , cursor . ch + 3 ) ;
91
+ editor . replaceSelection ( '## ' ) ;
94
92
} else {
95
93
editor . replaceSelection ( '## ' + selection ) ;
96
94
}
Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ export default defineComponent({
58
58
key: 'kbd',
59
59
value: [], // 为空表示过滤所有属性,放开属性则添加对应项,如['id', 'style']
60
60
},
61
+ {
62
+ key: 'input',
63
+ value: null, // value值为null,则对应标签不会被渲染
64
+ }
61
65
])
62
66
const customRendererRules = ref([
63
67
{
@@ -635,7 +639,7 @@ interface ICustomRenderRule {
635
639
``` ts
636
640
interface ICustomXssRule {
637
641
key: string ;
638
- value: string [];
642
+ value: string [] | null ;
639
643
}
640
644
```
641
645
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-devui" ,
3
- "version" : " 1.6.3-markdown.1 " ,
3
+ "version" : " 1.6.3-markdown.2 " ,
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