Skip to content

Commit 2e3eb8a

Browse files
committed
Update some doc comments in the HTML node classes
1 parent e3fe487 commit 2e3eb8a

File tree

4 files changed

+75
-59
lines changed

4 files changed

+75
-59
lines changed

src/htmlParser/ElementNode.js

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,59 @@
22
/**
33
* @class Autolinker.htmlParser.ElementNode
44
* @extends Autolinker.htmlParser.HtmlNode
5-
*
5+
*
66
* Represents an HTML element node that has been parsed by the {@link Autolinker.htmlParser.HtmlParser}.
7-
*
8-
* See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more details.
7+
*
8+
* See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more
9+
* details.
910
*/
1011
Autolinker.htmlParser.ElementNode = Autolinker.Util.extend( Autolinker.htmlParser.HtmlNode, {
11-
12+
1213
/**
1314
* @cfg {String} tagName (required)
14-
*
15+
*
1516
* The name of the tag that was matched.
1617
*/
1718
tagName : '',
18-
19+
1920
/**
2021
* @cfg {Boolean} closing (required)
21-
*
22-
* `true` if the element (tag) is a closing tag, `false` if its an opening tag.
22+
*
23+
* `true` if the element (tag) is a closing tag, `false` if its an opening
24+
* tag.
2325
*/
2426
closing : false,
2527

26-
28+
2729
/**
2830
* Returns a string name for the type of node that this class represents.
29-
*
31+
*
3032
* @return {String}
3133
*/
3234
getType : function() {
3335
return 'element';
3436
},
35-
37+
3638

3739
/**
38-
* Returns the HTML element's (tag's) name. Ex: for an <img> tag, returns "img".
39-
*
40+
* Returns the HTML element's (tag's) name. Ex: for an <img> tag,
41+
* returns "img".
42+
*
4043
* @return {String}
4144
*/
4245
getTagName : function() {
4346
return this.tagName;
4447
},
45-
46-
48+
49+
4750
/**
48-
* Determines if the HTML element (tag) is a closing tag. Ex: <div> returns
49-
* `false`, while </div> returns `true`.
50-
*
51+
* Determines if the HTML element (tag) is a closing tag. Ex: <div>
52+
* returns `false`, while </div> returns `true`.
53+
*
5154
* @return {Boolean}
5255
*/
5356
isClosing : function() {
5457
return this.closing;
5558
}
56-
59+
5760
} );

src/htmlParser/EntityNode.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,26 @@
22
/**
33
* @class Autolinker.htmlParser.EntityNode
44
* @extends Autolinker.htmlParser.HtmlNode
5-
*
5+
*
66
* Represents a known HTML entity node that has been parsed by the {@link Autolinker.htmlParser.HtmlParser}.
7-
* Ex: ' ', or '&amp#160;' (which will be retrievable from the {@link #getText} method.
8-
*
9-
* Note that this class will only be returned from the HtmlParser for the set of checked HTML entity nodes
10-
* defined by the {@link Autolinker.htmlParser.HtmlParser#htmlCharacterEntitiesRegex}.
11-
*
12-
* See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more details.
7+
* Ex: ' ', or '&amp#160;' (which will be retrievable from the {@link #getText}
8+
* method.
9+
*
10+
* Note that this class will only be returned from the HtmlParser for the set of
11+
* checked HTML entity nodes defined by the {@link Autolinker.htmlParser.HtmlParser#htmlCharacterEntitiesRegex}.
12+
*
13+
* See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more
14+
* details.
1315
*/
1416
Autolinker.htmlParser.EntityNode = Autolinker.Util.extend( Autolinker.htmlParser.HtmlNode, {
15-
17+
1618
/**
1719
* Returns a string name for the type of node that this class represents.
18-
*
20+
*
1921
* @return {String}
2022
*/
2123
getType : function() {
2224
return 'entity';
2325
}
24-
26+
2527
} );

src/htmlParser/HtmlNode.js

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,61 @@
22
/**
33
* @abstract
44
* @class Autolinker.htmlParser.HtmlNode
5-
*
6-
* Represents an HTML node found in an input string. An HTML node is one of the following:
7-
*
8-
* 1. An {@link Autolinker.htmlParser.ElementNode ElementNode}, which represents HTML tags.
9-
* 2. A {@link Autolinker.htmlParser.TextNode TextNode}, which represents text outside or within HTML tags.
10-
* 3. A {@link Autolinker.htmlParser.EntityNode EntityNode}, which represents one of the known HTML
11-
* entities that Autolinker looks for. This includes common ones such as " and  
5+
*
6+
* Represents an HTML node found in an input string. An HTML node is one of the
7+
* following:
8+
*
9+
* 1. An {@link Autolinker.htmlParser.ElementNode ElementNode}, which represents
10+
* HTML tags.
11+
* 2. A {@link Autolinker.htmlParser.CommentNode CommentNode}, which represents
12+
* HTML comments.
13+
* 3. A {@link Autolinker.htmlParser.TextNode TextNode}, which represents text
14+
* outside or within HTML tags.
15+
* 4. A {@link Autolinker.htmlParser.EntityNode EntityNode}, which represents
16+
* one of the known HTML entities that Autolinker looks for. This includes
17+
* common ones such as " and  
1218
*/
1319
Autolinker.htmlParser.HtmlNode = Autolinker.Util.extend( Object, {
14-
20+
1521
/**
1622
* @cfg {String} text (required)
17-
*
18-
* The original text that was matched for the HtmlNode.
19-
*
20-
* - In the case of an {@link Autolinker.htmlParser.ElementNode ElementNode}, this will be the tag's
21-
* text.
22-
* - In the case of a {@link Autolinker.htmlParser.TextNode TextNode}, this will be the text itself.
23-
* - In the case of a {@link Autolinker.htmlParser.EntityNode EntityNode}, this will be the text of
24-
* the HTML entity.
23+
*
24+
* The original text that was matched for the HtmlNode.
25+
*
26+
* - In the case of an {@link Autolinker.htmlParser.ElementNode ElementNode},
27+
* this will be the tag's text.
28+
* - In the case of an {@link Autolinker.htmlParser.CommentNode CommentNode},
29+
* this will be the comment's text.
30+
* - In the case of a {@link Autolinker.htmlParser.TextNode TextNode}, this
31+
* will be the text itself.
32+
* - In the case of a {@link Autolinker.htmlParser.EntityNode EntityNode},
33+
* this will be the text of the HTML entity.
2534
*/
2635
text : "",
27-
28-
36+
37+
2938
/**
3039
* @constructor
31-
* @param {Object} cfg The configuration properties for the Match instance, specified in an Object (map).
40+
* @param {Object} cfg The configuration properties for the Match instance,
41+
* specified in an Object (map).
3242
*/
3343
constructor : function( cfg ) {
3444
Autolinker.Util.assign( this, cfg );
3545
},
3646

37-
47+
3848
/**
3949
* Returns a string name for the type of node that this class represents.
40-
*
50+
*
4151
* @abstract
4252
* @return {String}
4353
*/
4454
getType : Autolinker.Util.abstractMethod,
45-
46-
55+
56+
4757
/**
4858
* Retrieves the {@link #text} for the HtmlNode.
49-
*
59+
*
5060
* @return {String}
5161
*/
5262
getText : function() {

src/htmlParser/TextNode.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
/**
33
* @class Autolinker.htmlParser.TextNode
44
* @extends Autolinker.htmlParser.HtmlNode
5-
*
5+
*
66
* Represents a text node that has been parsed by the {@link Autolinker.htmlParser.HtmlParser}.
7-
*
8-
* See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more details.
7+
*
8+
* See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more
9+
* details.
910
*/
1011
Autolinker.htmlParser.TextNode = Autolinker.Util.extend( Autolinker.htmlParser.HtmlNode, {
11-
12+
1213
/**
1314
* Returns a string name for the type of node that this class represents.
14-
*
15+
*
1516
* @return {String}
1617
*/
1718
getType : function() {
1819
return 'text';
1920
}
20-
21+
2122
} );

0 commit comments

Comments
 (0)