File tree Expand file tree Collapse file tree 3 files changed +54
-73
lines changed
test/scripts/apidoc/__snapshots__ Expand file tree Collapse file tree 3 files changed +54
-73
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,15 @@ const htmlSanitizeOptions: sanitizeHtml.IOptions = {
39
39
40
40
function comparableSanitizedHtml ( html : string ) : string {
41
41
return html
42
+ . replace ( / & # x [ 0 - 9 A - F ] { 2 } ; / g, ( x ) =>
43
+ String . fromCodePoint ( Number . parseInt ( x . slice ( 3 , - 1 ) , 16 ) )
44
+ )
42
45
. replace ( / & g t ; / g, '>' )
43
- . replace ( / / g, '' )
46
+ . replace ( / & l t ; / g, '<' )
47
+ . replace ( / & a m p ; / g, '&' )
44
48
. replace ( / & q u o t ; / g, '"' )
45
- . replace ( / & # 3 9 ; / g, "'" ) ;
49
+ . replace ( / = " " / g, '' )
50
+ . replace ( / / g, '' ) ;
46
51
}
47
52
48
53
/**
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ exports[`module > analyzeModule() > ModuleExampleTest 1`] = `
12
12
{
13
13
" comment" : " This is a description for a module with a code example." ,
14
14
" deprecated" : undefined ,
15
- " examples" : " <div class=\\ " language - ts vp - adaptive - theme \\" ><button title=\\ " Copy Code \\" class=\\ " copy \\" ></button><span class=\\ " lang \\" >ts</span><pre v-pre class=\\ " shiki github - dark vp - code - dark \\" ><code><span class=\\ " line \\" ><span style=\\ " color :# F97583 \\" >new</span><span style=\\ " color :# E1E4E8 \\ " > </span><span style= \\ " color :#B392F0 \\" >ModuleExampleTest</span><span style=\\ " color :# E1E4E8 \\ " >()</span></span></code></pre><pre v-pre class= \\ " shiki github - light vp - code - light \\ " ><code><span class= \\ " line \\ " ><span style= \\ " color :# D73A49 \\ " >new</span><span style= \\ " color :# 24292E \\ " > </span><span style= \\ " color :#6 F42C1 \\ " >ModuleExampleTest</span><span style= \\ " color :#24292 E \\" >()</span></span></code></pre>
15
+ " examples" : " <div class=\\ " language - ts vp - adaptive - theme \\" ><button title=\\ " Copy Code \\" class=\\ " copy \\" ></button><span class=\\ " lang \\" >ts</span><pre class=\\ " shiki shiki - themes github - light github - dark vp - code \\" v-pre ><code><span class=\\ " line \\" ><span style=\\ " -- shiki - light :# D73A49 ; -- shiki - dark :# F97583 \\" >new</span><span style=\\ " -- shiki - light :#6 F42C1 ; -- shiki - dark :#B392F0 \\" > ModuleExampleTest</span><span style=\\ " -- shiki - light :# 24292E ; -- shiki - dark :# E1E4E8 \\" >()</span></span></code></pre>
16
16
< / div > " ,
17
17
}
18
18
` ;
You can’t perform that action at this time.
0 commit comments