1
0
mirror of https://tildegit.org/sbgodin/HtmGem.git synced 2023-08-25 13:53:12 +02:00

Improves processing of ^^^ and ^

This commit is contained in:
Christophe HENRY 2021-03-08 10:41:59 +01:00
parent 6a37ecebcf
commit ac0de467ab

View File

@ -103,14 +103,16 @@ foreach ($fileLines as $line) {
if (empty($line)) {
echo "<p>&nbsp;</p>\n";
} elseif ('^^^' == $line3) {
$mode_textAttributes = !$mode_textAttributes;
} elseif ('^' == $line1) {
if (preg_match("/^\^\s*(.*)$/", $line, $parts)) {
$line = $parts[1];
$mode_textAttributes_temp = true;
if (preg_match("/^\^\^\^\s+(.*)$/", $line)) {
$mode_textAttributes = !$mode_textAttributes;
} else {
$mode = "raw";
continue;
}
} elseif ('^' == $line1 and !$mode_textAttributes_temp) {
preg_match("/^\^\s*(.*)$/", $line, $parts);
$line = $parts[1];
$mode_textAttributes_temp = true;
continue;
} elseif ("#" == $line1) {
preg_match("/^(#{1,3})\s*(.*)/", $line, $sharps);