0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 19:32:45 +00:00

Added nested markdown parsering within blocks

This commit is contained in:
Scott Tolksdorf
2017-02-23 10:03:04 -05:00
parent a6a1f41e77
commit dc486cfba9

View File

@@ -12,8 +12,8 @@ renderer.paragraph = function(text){
const res = _.reduce(text.split(blockReg), (r, text) => { const res = _.reduce(text.split(blockReg), (r, text) => {
if(text) r.push(Markdown(text, {renderer : renderer, sanitize: true})); if(text) r.push(Markdown(text, {renderer : renderer, sanitize: true}));
const block = matches[matchIndex]; const block = matches[matchIndex];
if(block && _.startsWith(block, '{{')){ if(block && block[0] == '{'){
r.push(`\n\n<div class="${block.substring(2).split(',').join(' ')}">`); r.push(`\n\n<div class="block ${block.substring(2).split(',').join(' ')}">`);
blockCount++; blockCount++;
} }
if(block == '}}' && blockCount !== 0){ if(block == '}}' && blockCount !== 0){