Skip to content

Commit 7199f30

Browse files
committed
Remove node.title support
Closes Gh-8.
1 parent e101488 commit 7199f30

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

index.js

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export function toString(node) {
1414
(node.value ||
1515
// @ts-ignore looks like an image.
1616
node.alt ||
17-
// @ts-ignore looks like an image/link.
18-
node.title ||
1917
// @ts-ignore looks like a parent.
2018
('children' in node && all(node.children)) ||
2119
(Array.isArray(node) && all(node)))) ||

test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ test('toString', function (t) {
2626

2727
t.equal(
2828
toString({title: 'baz', children: [{value: 'qux'}]}),
29-
'baz',
30-
'should prefer `title` over all others'
29+
'qux',
30+
'should *not* prefer `title` over all others'
3131
)
3232

3333
t.equal(
3434
toString({children: [{value: 'foo'}, {alt: 'bar'}, {title: 'baz'}]}),
35-
'foobarbaz',
35+
'foobar',
3636
'should serialize children'
3737
)
3838

3939
t.equal(
4040
toString([{value: 'foo'}, {alt: 'bar'}, {title: 'baz'}]),
41-
'foobarbaz',
41+
'foobar',
4242
'should serialize a list of nodes'
4343
)
4444

0 commit comments

Comments
 (0)