tokens.forEach((token) => { if (token.type === 'heading' && token.text) { currentHeader = token.text; addons[currentHeader] = { files: {} }; } if (token.type === 'code') { var match = token.text.match(/^\/\/\s+(.*\.(?:cc|h|js))[\r\n]/); if (match !== null) { addons[currentHeader].files[match[1]] = token.text; } } });
const lexed = marked.lexer(input); lexed.forEach(function(tok) { const type = tok.type; var text = tok.text;
var lexed = marked.lexer(input); lexed.forEach(function (tok) { var type = tok.type; var text = tok.text;