FIX: textDecoration switch not updated

This commit is contained in:
Christophe HENRY 2021-03-19 17:49:00 +01:00
parent cef2417f91
commit 5df9d5ff15
1 changed files with 3 additions and 3 deletions

View File

@ -168,7 +168,7 @@ class GemtextTranslate_html {
protected $pageTitle = ""; protected $pageTitle = "";
public $translatedGemtext; public $translatedGemtext;
function __construct($parsedGemtext, $textDecorationEnabled=true) { function __construct($parsedGemtext, $textDecoration=true) {
if (empty($parsedGemtext)) if (empty($parsedGemtext))
$parsedGemtext = ""; $parsedGemtext = "";
elseif (is_string($parsedGemtext)) elseif (is_string($parsedGemtext))
@ -177,7 +177,7 @@ class GemtextTranslate_html {
// The text must be parsed // The text must be parsed
$parsedGemtext = gemtextParser($parsedGemtext); $parsedGemtext = gemtextParser($parsedGemtext);
$this->parsedGemtext = $parsedGemtext; $this->parsedGemtext = $parsedGemtext;
$this->translate($textDecorationEnabled); $this->translate($textDecoration);
} }
function addCss($css) { function addCss($css) {
@ -308,7 +308,7 @@ class GemtextTranslate_html {
echo "<h3>$title</h3>\n"; echo "<h3>$title</h3>\n";
break; break;
case "^^^": case "^^^":
$this->textDecorationEnabled = !$this->textDecorationEnabled; $textDecoration = !$textDecoration;
break; break;
default: default:
die("Unknown mode: '{$node["mode"]}'\n"); die("Unknown mode: '{$node["mode"]}'\n");