Created
March 15, 2017 19:00
-
-
Save yoksel/29416f643ea27d0b7dc3d521b0f5978d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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