app/functions/contentProcessors.js
function processVars (markdownContent, config) {
  if (config.variables && Array.isArray(config.variables)) {
    config.variables.forEach((v) => {
      markdownContent = markdownContent.replace(new RegExp('%' + v.name + '%', 'g'), v.content);
    });
  }
  if (config.base_url) {
    markdownContent = markdownContent.replace(/%base_url%/g, config.base_url);
  }
  if (config.image_url) {
    markdownContent = markdownContent.replace(/%image_url%/g, config.image_url);
  }
  return markdownContent;
}
function processVars (markdownContent, config) {
  if (config.variables && Array.isArray(config.variables)) {
    config.variables.forEach((v) => {
      markdownContent = markdownContent.replace(new RegExp('%' + v.name + '%', 'g'), v.content);
    });
  }
  if (config.base_url) {
    markdownContent = markdownContent.replace(/%base_url%/g, config.base_url);
  }
  if (config.image_url) {
    markdownContent = markdownContent.replace(/%image_url%/g, config.image_url);
  }
  return markdownContent;
}
function processVars ( markdownContent , config ) { if ( config . variables && Array . isArray ( config . variables ) ) { config . variables . forEach ( ( v ) => { markdownContent = markdownContent . replace ( new RegExp ( '%' + v . name + '%' , 'g' ) , v . content ) ; } ) ; } if ( config . base_url ) { markdownContent = markdownContent . replace ( / %base_url% / g , config . base_url ) ; } if ( config . image_url ) { markdownContent = markdownContent . replace ( / %image_url% / g , config . image_url ) ; } return markdownContent ; }
Replace content variables in Markdown content
Replace content variables in Markdown content