Group items in "Related" section of README.md by category.

This commit is contained in:
David Anson 2020-06-22 20:59:13 -07:00
parent 53a0ba18d8
commit e1772ddc51
2 changed files with 23 additions and 12 deletions

View file

@ -1450,7 +1450,10 @@ tape("readme", (test) => {
let seenTags = false;
let inTags = false;
md.parse(contents, {}).forEach(function forToken(token) {
if (token.type === "bullet_list_open") {
if (
(token.type === "bullet_list_open") &&
(token.level === 0)
) {
if (!seenRelated) {
seenRelated = true;
} else if (seenRelated && !seenRules) {
@ -1460,7 +1463,10 @@ tape("readme", (test) => {
seenTags = true;
inTags = true;
}
} else if (token.type === "bullet_list_close") {
} else if (
(token.type === "bullet_list_close") &&
(token.level === 0)
) {
inRules = false;
inTags = false;
} else if (token.type === "inline") {