@@ -59,10 +59,10 @@ export async function processMarkdown(content: string): Promise<string> {
5959 const safeCode = text . replace ( / " / g, """ ) ;
6060
6161 return `
62- <div class="relative group my-4" data-copy-wrapper="true">
62+ <div data-copy-wrapper="true">
6363 <button
6464 type="button"
65- class="copy-btn absolute top-2 right-2 z-10 h-8 w-8 flex items-center justify-center rounded-md border border-white/20 bg-[#121212] text-white hover:bg-[#202020] transition-all "
65+ class="copy-btn"
6666 aria-label="Copy code to clipboard"
6767 title="Copy"
6868 data-code="${ safeCode } "
@@ -85,10 +85,17 @@ export async function processMarkdown(content: string): Promise<string> {
8585
8686 const cleanContent = sanitizeHtml ( String ( rawContent ) , {
8787 allowedTags : sanitizeHtml . defaults . allowedTags . concat ( [
88+ "img" ,
8889 "iframe" ,
8990 "button" ,
9091 "svg" ,
9192 "path" ,
93+ "rect" ,
94+ "line" ,
95+ "circle" ,
96+ "polyline" ,
97+ "polygon" ,
98+ "div" ,
9299 ] ) ,
93100 allowedAttributes : {
94101 a : [ "href" , "name" , "target" , "rel" , "title" ] ,
@@ -104,9 +111,26 @@ export async function processMarkdown(content: string): Promise<string> {
104111 "title" ,
105112 ] ,
106113 button : [ "id" , "class" , "data-code" , "aria-label" , "title" , "type" ] ,
114+ div : [ "class" , "data-copy-wrapper" ] ,
107115 "*" : [ "id" , "class" ] ,
108- svg : [ "xmlns" , "width" , "height" , "viewBox" , "fill" ] ,
109- path : [ "d" ] ,
116+ svg : [
117+ "xmlns" ,
118+ "width" ,
119+ "height" ,
120+ "viewBox" ,
121+ "fill" ,
122+ "stroke" ,
123+ "stroke-width" ,
124+ "stroke-linecap" ,
125+ "stroke-linejoin" ,
126+ "aria-hidden" ,
127+ ] ,
128+ path : [ "d" , "fill" , "stroke" ] ,
129+ rect : [ "x" , "y" , "width" , "height" , "rx" , "ry" , "fill" , "stroke" ] ,
130+ line : [ "x1" , "y1" , "x2" , "y2" , "stroke" ] ,
131+ circle : [ "cx" , "cy" , "r" , "fill" , "stroke" ] ,
132+ polyline : [ "points" , "fill" , "stroke" ] ,
133+ polygon : [ "points" , "fill" , "stroke" ] ,
110134 } ,
111135 allowedSchemes : [ "http" , "https" , "mailto" , "tel" ] ,
112136 allowedSchemesByTag : {
0 commit comments