@@ -58,6 +58,7 @@ export const safeHtmlDefaultOptions: SafeHtmlOptions = {
5858 'img' ,
5959 'ins' ,
6060 'kbd' ,
61+ 'label' ,
6162 'li' ,
6263 'main' ,
6364 'map' ,
@@ -104,10 +105,7 @@ export const safeHtmlDefaultOptions: SafeHtmlOptions = {
104105 allowedUrl : / ^ (?: m a i l t o | t e l | h t t p s ? | f t p | [ ^ : ] * [ ^ a - z 0 - 9 . + - ] [ ^ : ] * ) : | ^ [ ^ : ] * $ / i,
105106} ;
106107
107- export function safeHtml (
108- input : string ,
109- options : Partial < SafeHtmlOptions > = { } ,
110- ) : string {
108+ export function safeHtml ( input : string , options : Partial < SafeHtmlOptions > = { } ) : string {
111109 const config : SafeHtmlOptions = {
112110 ...safeHtmlDefaultOptions ,
113111 ...options ,
@@ -120,11 +118,7 @@ export function safeHtml(
120118 return stringify ( ast , config , input ) ;
121119}
122120
123- function stringify (
124- ast : INode [ ] ,
125- config : SafeHtmlOptions ,
126- input : string ,
127- ) : string {
121+ function stringify ( ast : INode [ ] , config : SafeHtmlOptions , input : string ) : string {
128122 return ast
129123 . map ( ( node ) => {
130124 if ( node . type === SyntaxKind . Text ) {
@@ -135,9 +129,7 @@ function stringify(
135129 }
136130 if ( selfCloseTags [ node . name ] ) {
137131 if ( node . body !== void 0 ) {
138- throw new Error (
139- `self closed tag "${ node . name } " should not have body` ,
140- ) ;
132+ throw new Error ( `self closed tag "${ node . name } " should not have body` ) ;
141133 }
142134 } else {
143135 if ( ! node . body || ! node . close ) {
0 commit comments