0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 17:22:49 +00:00

Added comma parsing to the block code

This commit is contained in:
Scott Tolksdorf
2017-01-22 13:56:57 -05:00
parent b1db8040a4
commit 76ced9ca49

View File

@@ -25,7 +25,7 @@ module.exports = {
render : (rawBrewText)=>{ render : (rawBrewText)=>{
//Adds in the new div block syntax //Adds in the new div block syntax
let count = 0; let count = 0;
let blockReg = /{{\w+|}}/g; let blockReg = /{{[\w|,]+|}}/g;
const renderer = new Markdown.Renderer(); const renderer = new Markdown.Renderer();
renderer.paragraph = function (text) { renderer.paragraph = function (text) {
const matches = text.match(blockReg); const matches = text.match(blockReg);
@@ -35,7 +35,7 @@ module.exports = {
if(text) r.push(`<p>${text}</p>\n`); if(text) r.push(`<p>${text}</p>\n`);
const block = matches[matchIndex]; const block = matches[matchIndex];
if(block && _.startsWith(block, '{{')){ if(block && _.startsWith(block, '{{')){
r.push(`<div class="${block.substring(2)}">`); r.push(`<div class="${block.substring(2).split(',').join(' ')}">`);
count++; count++;
} }
if(block == '}}' && count !== 0){ if(block == '}}' && count !== 0){