@@ -24,7 +24,7 @@ function getAttrString(node: Node, key: string): string | undefined {
2424 */
2525function buildCommonAttrs ( node : Node ) : string {
2626 if ( ! node . attrs ) return '' ;
27-
27+
2828 const attrs : string [ ] = [ ] ;
2929 if ( node . attrs . style ) {
3030 attrs . push ( ` style="${ node . attrs . style } "` ) ;
@@ -134,7 +134,7 @@ export const defaultNodeOption: RenderOption = {
134134 } ) ;
135135 colgroupHTML += `</${ NodeType . COL_GROUP } >` ;
136136 }
137-
137+
138138 // Generate table with colgroup and other attributes
139139 return `<table${ buildCommonAttrs ( node ) } >${ colgroupHTML } ${ sanitizeHTML ( next ( node . children ) ) } </table>` ;
140140 } ,
@@ -157,7 +157,7 @@ export const defaultNodeOption: RenderOption = {
157157 const colSpan = getAttr ( node , 'colSpan' ) ;
158158 const rowSpanAttr = rowSpan ? ` rowspan="${ rowSpan } "` : '' ;
159159 const colSpanAttr = colSpan ? ` colspan="${ colSpan } "` : '' ;
160-
160+
161161 return `<th${ rowSpanAttr } ${ colSpanAttr } ${ buildCommonAttrs ( node ) } >${ sanitizeHTML ( next ( node . children ) ) } </th>`
162162 } ,
163163 [ NodeType . TABLE_DATA ] :( node : Node , next : Next ) => {
@@ -167,7 +167,7 @@ export const defaultNodeOption: RenderOption = {
167167 const colSpan = getAttr ( node , 'colSpan' ) ;
168168 const rowSpanAttr = rowSpan ? ` rowspan="${ rowSpan } "` : '' ;
169169 const colSpanAttr = colSpan ? ` colspan="${ colSpan } "` : '' ;
170-
170+
171171 return `<td${ rowSpanAttr } ${ colSpanAttr } ${ buildCommonAttrs ( node ) } >${ sanitizeHTML ( next ( node . children ) ) } </td>`
172172 } ,
173173 [ NodeType . BLOCK_QUOTE ] :( node : Node , next : Next ) => {
@@ -180,12 +180,12 @@ export const defaultNodeOption: RenderOption = {
180180 [ 'reference' ] :( node : Node , next : Next ) => {
181181 const type = getAttr ( node , 'type' ) ;
182182 const displayType = getAttr ( node , 'display-type' ) ;
183-
183+
184184 if ( ( type === 'entry' || type === 'asset' ) && displayType === 'link' ) {
185185 const href = getAttrString ( node , 'href' ) || getAttrString ( node , 'url' ) || '' ;
186186 const target = getAttrString ( node , 'target' ) ;
187187 const assetUid = getAttrString ( node , 'asset-uid' ) ;
188-
188+
189189 let aTagAttrs = buildCommonAttrs ( node ) ;
190190 if ( href ) aTagAttrs += ` href="${ href } "` ;
191191 if ( target ) {
@@ -200,7 +200,7 @@ export const defaultNodeOption: RenderOption = {
200200 }
201201 return `<a${ aTagAttrs } >${ sanitizeHTML ( next ( node . children ) ) } </a>` ;
202202 }
203-
203+
204204 if ( type === 'asset' ) {
205205 const assetLink = getAttrString ( node , 'asset-link' ) ;
206206 const src = assetLink ? encodeURI ( assetLink ) : '' ;
@@ -219,7 +219,7 @@ export const defaultNodeOption: RenderOption = {
219219 const altAttr = alt ? ` alt="${ alt } "` : '' ;
220220 const targetAttr = target === "_blank" ? ` target="_blank"` : '' ;
221221 const styleAttr = style ? ` style="${ style } "` : '' ;
222-
222+
223223 const imageTag = `<img${ assetUidAttr } ${ classAttr } ${ srcAttr } ${ altAttr } ${ targetAttr } ${ styleAttr } />` ;
224224 const styleAttrFig = style ? ` style="${ style } "` : '' ;
225225
0 commit comments