Skip to content

Instantly share code, notes, and snippets.

@yoksel
Created March 15, 2017 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoksel/29416f643ea27d0b7dc3d521b0f5978d to your computer and use it in GitHub Desktop.
Save yoksel/29416f643ea27d0b7dc3d521b0f5978d to your computer and use it in GitHub Desktop.
module.exports = function(bh) {
bh.match('list', function (ctx) {
ctx.tag('ul');
ctx.content(
ctx.ctx.items.map(function (item) {
const items = ctx.ctx.items;
const block = ctx.ctx.mix.block;
let content = item.content;
if (item.url) {
content = {
block: 'link',
mix: { block: block, elem: 'link' },
url: item.url,
content: item.content
};
}
return {
elem: 'item',
mix: { block: block, elem: 'item' },
tag: 'li',
content: content
};
})
);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment