File tree Expand file tree Collapse file tree 1 file changed +70
-3
lines changed
src/renderer/components/markdown Expand file tree Collapse file tree 1 file changed +70
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ const snippetStore = useSnippetStore()
2929const forceRefresh = ref ()
3030
3131const init = () => {
32- const renderer = {
32+ const renderer: marked . RendererObject = {
3333 code (code : string , lang : string ) {
3434 if (lang === ' mermaid' ) {
3535 return ` <div class="mermaid">${code }</div><br> `
@@ -66,7 +66,71 @@ onMounted(() => {
6666const getRenderer = () => {
6767 const raw = marked .parse (props .value )
6868 const html = sanitizeHtml (raw , {
69- allowedTags: false ,
69+ allowedTags: [
70+ ' h1' ,
71+ ' h2' ,
72+ ' h3' ,
73+ ' h4' ,
74+ ' h5' ,
75+ ' h6' ,
76+ ' h7' ,
77+ ' h8' ,
78+ ' br' ,
79+ ' b' ,
80+ ' i' ,
81+ ' strong' ,
82+ ' em' ,
83+ ' a' ,
84+ ' pre' ,
85+ ' code' ,
86+ ' img' ,
87+ ' tt' ,
88+ ' div' ,
89+ ' ins' ,
90+ ' del' ,
91+ ' sup' ,
92+ ' sub' ,
93+ ' p' ,
94+ ' ol' ,
95+ ' ul' ,
96+ ' table' ,
97+ ' thead' ,
98+ ' tbody' ,
99+ ' tfoot' ,
100+ ' blockquote' ,
101+ ' dl' ,
102+ ' dt' ,
103+ ' dd' ,
104+ ' kbd' ,
105+ ' q' ,
106+ ' samp' ,
107+ ' var' ,
108+ ' hr' ,
109+ ' ruby' ,
110+ ' rt' ,
111+ ' rp' ,
112+ ' li' ,
113+ ' tr' ,
114+ ' td' ,
115+ ' th' ,
116+ ' s' ,
117+ ' strike' ,
118+ ' summary' ,
119+ ' details' ,
120+ ' caption' ,
121+ ' figure' ,
122+ ' figcaption' ,
123+ ' abbr' ,
124+ ' bdo' ,
125+ ' cite' ,
126+ ' dfn' ,
127+ ' mark' ,
128+ ' small' ,
129+ ' span' ,
130+ ' time' ,
131+ ' wbr' ,
132+ ' input'
133+ ],
70134 allowedAttributes: {
71135 ' *' : [
72136 ' align' ,
@@ -77,7 +141,10 @@ const getRenderer = () => {
77141 ' src' ,
78142 ' target' ,
79143 ' width' ,
80- ' class'
144+ ' class' ,
145+ ' type' ,
146+ ' checked' ,
147+ ' disabled'
81148 ]
82149 }
83150 })
You can’t perform that action at this time.
0 commit comments