@@ -29,7 +29,7 @@ import {LiteElement} from './Element.js';
2929import { LiteText , LiteComment } from './Text.js' ;
3030import { LiteAdaptor } from '../liteAdaptor.js' ;
3131
32- /*
32+ /**
3333 * Patterns used in parsing serialized HTML
3434 */
3535export namespace PATTERNS {
@@ -49,13 +49,13 @@ export namespace PATTERNS {
4949}
5050
5151/************************************************************/
52- /*
52+ /**
5353 * Implements a lightweight DOMParser replacement
5454 * (Not perfect, but handles most well-formed HTML)
5555 */
5656export class LiteParser implements MinDOMParser < LiteDocument > {
5757
58- /*
58+ /**
5959 * The list of self-closing tags
6060 */
6161 public static SELF_CLOSING : { [ name : string ] : boolean } = {
@@ -78,7 +78,7 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
7878 wbr : true
7979 } ;
8080
81- /*
81+ /**
8282 * The list of tags chose content is not parsed (PCDATA)
8383 */
8484 public static PCDATA : { [ name : string ] : boolean } = {
@@ -90,7 +90,7 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
9090 script : true
9191 } ;
9292
93- /*
93+ /**
9494 * The list of attributes that don't get entity translation
9595 */
9696 public static CDATA_ATTR : { [ name : string ] : boolean } = {
@@ -110,7 +110,7 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
110110 scheme : true
111111 } ;
112112
113- /*
113+ /**
114114 * @override
115115 */
116116 public parseFromString ( text : string , format : string = 'text/html' , adaptor : LiteAdaptor = null ) {
@@ -141,32 +141,32 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
141141 return root ;
142142 }
143143
144- /*
145- * @param {LiteAdaptor } adaptor The adaptor for managing nodes
146- * @param {LiteElement } node The node to add a text element to
147- * @param {string } text The text for the text node
148- * @return {LiteText } The text element
144+ /**
145+ * @param {LiteAdaptor } adaptor The adaptor for managing nodes
146+ * @param {LiteElement } node The node to add a text element to
147+ * @param {string } text The text for the text node
148+ * @return {LiteText } The text element
149149 */
150150 protected addText ( adaptor : LiteAdaptor , node : LiteElement , text : string ) {
151151 text = Entities . translate ( text ) ;
152152 return adaptor . append ( node , adaptor . text ( text ) ) as LiteText ;
153153 }
154154
155- /*
156- * @param {LiteAdaptor } adaptor The adaptor for managing nodes
157- * @param {LiteElement } node The node to add a comment to
158- * @param {string } comment The text for the comment node
159- * @return {LiteText } The comment element
155+ /**
156+ * @param {LiteAdaptor } adaptor The adaptor for managing nodes
157+ * @param {LiteElement } node The node to add a comment to
158+ * @param {string } comment The text for the comment node
159+ * @return {LiteText } The comment element
160160 */
161161 protected addComment ( adaptor : LiteAdaptor , node : LiteElement , comment : string ) {
162162 return adaptor . append ( node , new LiteComment ( comment ) ) as LiteComment ;
163163 }
164164
165- /*
166- * @param {LiteAdaptor } adaptor The adaptor for managing nodes
167- * @param {LiteElement } node The node to close
168- * @param {string } tag The close tag being processed
169- * @return {LiteElement } The first unclosed parent node
165+ /**
166+ * @param {LiteAdaptor } adaptor The adaptor for managing nodes
167+ * @param {LiteElement } node The node to close
168+ * @param {string } tag The close tag being processed
169+ * @return {LiteElement } The first unclosed parent node
170170 */
171171 protected closeTag ( adaptor : LiteAdaptor , node : LiteElement , tag : string ) {
172172 const kind = tag . slice ( 2 , tag . length - 1 ) . toLowerCase ( ) ;
@@ -176,12 +176,12 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
176176 return adaptor . parent ( node ) ;
177177 }
178178
179- /*
180- * @param {LiteAdaptor } adaptor The adaptor for managing nodes
181- * @param {LiteElement } node The parent node for the tag
182- * @param {string } tag The tag being processed
183- * @param {string[] } parts The rest of the text/tag array
184- * @return {LiteElement } The node to which the next tag will be added
179+ /**
180+ * @param {LiteAdaptor } adaptor The adaptor for managing nodes
181+ * @param {LiteElement } node The parent node for the tag
182+ * @param {string } tag The tag being processed
183+ * @param {string[] } parts The rest of the text/tag array
184+ * @return {LiteElement } The node to which the next tag will be added
185185 */
186186 protected openTag ( adaptor : LiteAdaptor , node : LiteElement , tag : string , parts : string [ ] ) {
187187 const PCDATA = ( this . constructor as typeof LiteParser ) . PCDATA ;
@@ -222,10 +222,10 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
222222 return node ;
223223 }
224224
225- /*
226- * @param {LiteAdaptor } adaptor The adaptor for managing nodes
227- * @param {LiteElement } node The node getting the attributes
228- * @param {string[] } attributes The array of space, name, value1, value2, value3
225+ /**
226+ * @param {LiteAdaptor } adaptor The adaptor for managing nodes
227+ * @param {LiteElement } node The node getting the attributes
228+ * @param {string[] } attributes The array of space, name, value1, value2, value3
229229 * as described above.
230230 */
231231 protected addAttributes ( adaptor : LiteAdaptor , node : LiteElement , attributes : string [ ] ) {
@@ -240,11 +240,11 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
240240 }
241241 }
242242
243- /*
244- * @param {LiteAdaptor } adaptor The adaptor for managing nodes
245- * @param {LiteElement } node The node whose PCDATA content is being collected
246- * @param {string } kind The tag name being handled
247- * @param {string[] } parts The array of text/tag data for the document
243+ /**
244+ * @param {LiteAdaptor } adaptor The adaptor for managing nodes
245+ * @param {LiteElement } node The node whose PCDATA content is being collected
246+ * @param {string } kind The tag name being handled
247+ * @param {string[] } parts The array of text/tag data for the document
248248 */
249249 protected handlePCDATA ( adaptor : LiteAdaptor , node : LiteElement , kind : string , parts : string [ ] ) {
250250 const pcdata = [ ] as string [ ] ;
@@ -266,13 +266,13 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
266266 adaptor . append ( node , adaptor . text ( pcdata . join ( '' ) ) ) ;
267267 }
268268
269- /*
269+ /**
270270 * Check the contents of the parsed document and move html, head, and body
271271 * tags into the document structure. That way, you can parse fragements or
272272 * full documents and still get a valid document.
273273 *
274- * @param {LiteAdaptor } adaptor The adaptor for managing nodes
275- * @param {LiteDocuemnt } root The document being checked
274+ * @param {LiteAdaptor } adaptor The adaptor for managing nodes
275+ * @param {LiteDocuemnt } root The document being checked
276276 */
277277 protected checkDocument ( adaptor : LiteAdaptor , root : LiteDocument ) {
278278 if ( adaptor . childNodes ( adaptor . body ( root ) ) . length !== 1 ) return ;
@@ -315,10 +315,10 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
315315 }
316316 }
317317
318- /*
319- * @param {LiteAdaptor } adaptor The adaptor for managing nodes
320- * @param {LiteElement } node The node to serialize
321- * @return {string } The serialized element (like outerHTML)
318+ /**
319+ * @param {LiteAdaptor } adaptor The adaptor for managing nodes
320+ * @param {LiteElement } node The node to serialize
321+ * @return {string } The serialized element (like outerHTML)
322322 */
323323 public serialize ( adaptor : LiteAdaptor , node : LiteElement ) {
324324 const SELF_CLOSING = ( this . constructor as typeof LiteParser ) . SELF_CLOSING ;
@@ -333,10 +333,10 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
333333 return html ;
334334 }
335335
336- /*
337- * @param {LiteAdaptor } adaptor The adaptor for managing nodes
338- * @param {LiteElement } node The node whose innerHTML is needed
339- * @return {string } The serialized element (like innerHTML)
336+ /**
337+ * @param {LiteAdaptor } adaptor The adaptor for managing nodes
338+ * @param {LiteElement } node The node whose innerHTML is needed
339+ * @return {string } The serialized element (like innerHTML)
340340 */
341341 public serializeInner ( adaptor : LiteAdaptor , node : LiteElement ) {
342342 const PCDATA = ( this . constructor as typeof LiteParser ) . PCDATA ;
@@ -351,17 +351,17 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
351351 } ) . join ( '' ) ;
352352 }
353353
354- /*
355- * @param {string } text The attribute value to be HTML escaped
356- * @return {string } The string with " replaced by entities
354+ /**
355+ * @param {string } text The attribute value to be HTML escaped
356+ * @return {string } The string with " replaced by entities
357357 */
358358 public protectAttribute ( text : string ) {
359359 return text . replace ( / " / , '"' ) ;
360360 }
361361
362- /*
363- * @param {string } text The text to be HTML escaped
364- * @return {string } The string with &, <, and > replaced by entities
362+ /**
363+ * @param {string } text The text to be HTML escaped
364+ * @return {string } The string with &, <, and > replaced by entities
365365 */
366366 public protectHTML ( text : string ) {
367367 return text . replace ( / & / g, '&' )
0 commit comments