Skip to content

Commit

Permalink
skip section title for abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
deniak committed Feb 18, 2025
1 parent 4c96232 commit c3b1ff8
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions lib/rules/metadata/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@ export function check(sr, done) {
return true;
}
});
return done({
abstract: abstractTitle
? sr.norm(abstractTitle.parentElement.innerHTML)
: 'Not found',
});

if (abstractTitle) {
const div = sr.jsDocument.createElement('div');
[...abstractTitle.parentElement.children].forEach(child => {
{
if (child !== abstractTitle) {
div.appendChild(child.cloneNode(true));
}
}
});
return done({ abstract: sr.norm(div.innerHTML) });
} else {
return done({ abstract: 'Not found' });
}
}

0 comments on commit c3b1ff8

Please sign in to comment.