Add support for the @csgen.span element

This commit is contained in:
Jacob 2024-01-03 08:56:51 +01:00
parent 4db018f5bc
commit 37487956fd

View file

@ -130,6 +130,7 @@ function convertMarkdownToHTML($contents) {
'/.*@csgen\.allowComments.*=.*"(.*)(");/',
'/.*@csgen\.displayTitle.*=.*"(.*)(");/',
'/.*@csgen\.displayDate.*=.*"(.*)(");/',
'/.*@csgen\.span.*<STYLE.*,.*TEXT>\(.*"(.*)".*, "(.*)"\);/',
);
$out = $parser->transform($contents);
@ -174,6 +175,12 @@ function convertMarkdownToHTML($contents) {
$ret->displayDate = preg_replace('/<.*?$/', '', $ret->displayDate);
$out = removePrefix("@csgen\.displayDate", $out);
break;
case '/.*@csgen\.span.*&lt;STYLE.*,.*TEXT&gt;\(.*&quot;(.*)&quot;.*, &quot;(.*)&quot;\);/':
$style = $matches[1];
$text = $matches[2];
$out = removePrefix("@csgen\.span", $out);
$out = preg_replace("/$matches[0]/i", "<span style=\"$style\">$text</span>", $out);
break;
}
}