diff --git a/core.php b/core.php
index bca3cc3..b669584 100755
--- a/core.php
+++ b/core.php
@@ -232,10 +232,13 @@ function convertMarkdownToHTML($contents) {
break;
case '/.*@csgen\.span.*<STYLE.*,.*TEXT>\(.*"(.*)".*, "(.*)"\);/':
- $out = str_replace($matches[0], "$matches[2]", $out);
+ $cssCode = htmlspecialchars_decode($matches[1]);
+ $out = str_replace($matches[0], "$matches[2]", $out);
break;
case '/.*@csgen\.span.*<STYLE.*,.*HTML>\(.*"(.*)".*, "(.*)"\);/':
- $out = str_replace($matches[0], "$matches[2]", $out);
+ $cssCode = htmlspecialchars_decode($matches[1]);
+ $htmlCode = htmlspecialchars_decode($matches[2]);
+ $out = str_replace($matches[0], "$htmlCode", $out);
break;
case '/.*@csgen\.div.*<START.*,.*NAME>\(.*"(.*)"\);/':
$out = str_replace($matches[0], "
", $out);
@@ -244,16 +247,20 @@ function convertMarkdownToHTML($contents) {
$out = str_replace($matches[0], "
", $out);
break;
case '/.*@csgen\.div.*<STYLE.*,.*NAME>\(.*"(.*)".*, "(.*)"\);/':
- $out = str_replace($matches[0], "", $out);
+ $cssCode = htmlspecialchars_decode($matches[1]);
+ $out = str_replace($matches[0], "\n", $out);
break;
case '/.*@csgen\.inline.*<HTML>\(.*"(.*)"\);/':
- $out = str_replace($matches[0], "$matches[1]", $out);
+ $htmlCode = htmlspecialchars_decode($matches[1]);
+ $out = str_replace($matches[0], "$htmlCode", $out);
break;
case '/.*@csgen\.inline.*<CSS>\(.*"(.*)"\);/':
- $out = str_replace($matches[0], "", $out);
+ $cssCode = htmlspecialchars_decode($matches[1]);
+ $out = str_replace($matches[0], "", $out);
break;
case '/.*@csgen\.inline.*<JAVASCRIPT>\(.*"(.*)"\);/':
- $out = str_replace($matches[0], "", $out);
+ $javascriptCode = htmlspecialchars_decode($matches[1]);
+ $out = str_replace($matches[0], "", $out);
break;
case '/.*@csgen\.image.*<SIZE.*,.*PATH>\(.*"(.*)".*, "(.*)"\);/':
$imgres = array();