summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fe9c243)
Allow replacements within replacements.
$rep = [];
foreach ($blocks as $name => $html) {
$rep["[[$name]]"] = sprintf('<!--BLOCK:%s-->%s<!--/-->',
$rep = [];
foreach ($blocks as $name => $html) {
$rep["[[$name]]"] = sprintf('<!--BLOCK:%s-->%s<!--/-->',
- is_numeric($name) ? '' : "[[$name]]", $html
+ is_numeric($name) ? '' : "[[$name]]",
+ preg_replace('{<!--[^-]*-->}', '', $html)
);
}
return str_replace(array_keys($rep), array_values($rep), ob_get_clean());
);
}
return str_replace(array_keys($rep), array_values($rep), ob_get_clean());