Add "id" attribute to parsed glossary entries

This commit is contained in:
Aaron O'Mullan
2014-08-17 21:13:39 -07:00
parent 00496dbd09
commit 80e2f23714
+6
View File
@@ -33,9 +33,15 @@ function parseGlossary(src) {
// Simplify each group to a simple object with name/description
return {
name: pair[0].text,
id: entryId(pair[0].text),
description: pair[1].text,
};
});
}
// Normalizes a glossary entry's name to create an ID
function entryId(name) {
return name.toLowercase();
}
module.exports = parseGlossary;