mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Add "id" attribute to parsed glossary entries
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user