Skip to content

Commit d25b80f

Browse files
committed
Refactor comments
1 parent 0da6dbc commit d25b80f

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

lib/constants.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ var formFeed = '\f'
1818

1919
var whitespace = [space, tab, lineFeed, carriageReturn, formFeed]
2020

21-
// https://html.spec.whatwg.org/#attribute-name-state
21+
// See: <https://html.spec.whatwg.org/#attribute-name-state>.
2222
var name = whitespace.concat(ampersand, slash, greaterThan, equalsTo)
2323

24-
// https://html.spec.whatwg.org/#attribute-value-(unquoted)-state
24+
// See: <https://html.spec.whatwg.org/#attribute-value-(unquoted)-state>.
2525
var unquoted = whitespace.concat(ampersand, greaterThan)
2626
var unquotedSafe = unquoted.concat(
2727
nil,
@@ -32,13 +32,14 @@ var unquotedSafe = unquoted.concat(
3232
graveAccent
3333
)
3434

35-
// https://html.spec.whatwg.org/#attribute-value-(single-quoted)-state
35+
// See: <https://html.spec.whatwg.org/#attribute-value-(single-quoted)-state>.
3636
var singleQuoted = [ampersand, apostrophe]
3737

38-
// https://html.spec.whatwg.org/#attribute-value-(double-quoted)-state
38+
// See: <https://html.spec.whatwg.org/#attribute-value-(double-quoted)-state>.
3939
var doubleQuoted = [ampersand, quotationMark]
4040

41-
// Maps of subsets. Each value is a matrix of tuples.
41+
// Maps of subsets.
42+
// Each value is a matrix of tuples.
4243
// The first value causes parse errors, the second is valid.
4344
// Of both values, the first value is unsafe, and the second is safe.
4445
module.exports = {

lib/element.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ function element(ctx, node, index, parent) {
5555
content = all(ctx, root)
5656

5757
// If the node is categorised as void, but it has children, remove the
58-
// categorisation. This enables for example `menuitem`s, which are void in
59-
// W3C HTML but not void in WHATWG HTML, to be stringified properly.
58+
// categorisation.
59+
// This enables for example `menuitem`s, which are void in W3C HTML but not
60+
// void in WHATWG HTML, to be stringified properly.
6061
selfClosing = content ? false : selfClosing
6162

6263
if (attrs || !omit || !omit.opening(node, index, parent)) {

lib/omission/opening.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ function body(node) {
6565
)
6666
}
6767

68-
// Whether to omit `<colgroup>`. The spec describes some logic for the opening
69-
// tag, but it’s easier to implement in the closing tag, to the same effect, so
70-
// we handle it there instead.
68+
// Whether to omit `<colgroup>`.
69+
// The spec describes some logic for the opening tag, but it’s easier to
70+
// implement in the closing tag, to the same effect, so we handle it there
71+
// instead.
7172
function colgroup(node, index, parent) {
7273
var prev = before(parent, index)
7374
var head = first(node, true)

test/omission-closing-menuitem.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ test('`menuitem` (closing)', function(t) {
4343
'should not omit tag followed by others'
4444
)
4545

46-
/* This actually tests an edge case where `menuitems`,
47-
* which can have children in WHATWG HTML, but not in
48-
* W3C HTML, here do not have children. */
46+
// This actually tests an edge case where `menuitems`, which can have children
47+
// in WHATWG HTML, but not in W3C HTML, here do not have children.
4948
t.deepEqual(
5049
to(h('menu', [h('menuitem'), h('p')]), {omitOptionalTags: true}),
5150
'<menu><menuitem><p></menu>',

0 commit comments

Comments
 (0)