Skip to content

Commit fe8e24d

Browse files
committed
Update comments
1 parent d9c99af commit fe8e24d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/index.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,38 @@ const {
77
} = require('./mapping');
88

99
/**
10-
* returns true if given parent-child nesting is valid html
10+
* returns true if given parent-child nesting is valid HTML
1111
* @param {string} child
1212
* @param {string} parent
1313
* @returns {boolean}
1414
*/
1515
function isValidHTMLNesting(parent, child) {
16-
// if we know the list of children that are the only valid chidren for given parent
16+
// if we know the list of children that are the only valid children for the given parent
1717
if (parent in onlyValidChildren) {
1818
return onlyValidChildren[parent].has(child);
1919
}
2020

21-
// if we know the list of parents that are the only valid parents for given child
21+
// if we know the list of parents that are the only valid parents for the given child
2222
if (child in onlyValidParents) {
2323
return onlyValidParents[child].has(parent);
2424
}
2525

26-
// if we know the lsit of children that not valid for given parent
26+
// if we know the list of children that are NOT valid for the given parent
2727
if (parent in knownInvalidChildren) {
28-
// check if child is in the list of invalid children
28+
// check if the child is in the list of invalid children
2929
// if so, return false
3030
if (knownInvalidChildren[parent].has(child)) return false;
3131
}
3232

33-
// if we know list of parents that are not valid for given children
33+
// if we know the list of parents that are NOT valid for the given child
3434
if (child in knownInvalidParents) {
35-
// check if parent is in the list of invalid parents
35+
// check if the parent is in the list of invalid parents
3636
// if so, return false
3737
if (knownInvalidParents[child].has(parent)) return false;
3838
}
3939

40-
// svg tags should only contain svg tags
41-
if (svgTags.has(parent) && child !== "a" && !svgTags.has(child)) {
40+
// SVG tags should only contain SVG tags or anchor tag
41+
if (svgTags.has(parent) && child !== 'a' && !svgTags.has(child)) {
4242
return false;
4343
}
4444

0 commit comments

Comments
 (0)