mirror of
https://tildegit.org/sbgodin/HtmGem.git
synced 2023-08-25 13:53:12 +02:00
WIP
This commit is contained in:
parent
859b0aad81
commit
d280ceff94
34
index.php
34
index.php
@ -83,24 +83,24 @@ $fileContents</pre>
|
|||||||
</html>
|
</html>
|
||||||
EOL;
|
EOL;
|
||||||
exit();
|
exit();
|
||||||
} else {
|
}
|
||||||
$t = new \htmgem\GemTextTranslate_html($fileContents);
|
|
||||||
if ("none" == $style) {
|
$t = new \htmgem\GemTextTranslate_html($fileContents, $textDecoration);
|
||||||
$t->addCss("");
|
if ("none" == $style) {
|
||||||
} elseif ("/" == @$style[0]) {
|
$t->addCss("");
|
||||||
$t->addCss($style);
|
} elseif ("/" == @$style[0]) {
|
||||||
} elseif (empty($style)) {
|
$t->addCss($style);
|
||||||
$parts = pathinfo($filePath);
|
} elseif (empty($style)) {
|
||||||
$localCss = $parts["filename"].".css";
|
$parts = pathinfo($filePath);
|
||||||
$localCssFilePath = $parts["dirname"]."/".$localCss;
|
$localCss = $parts["filename"].".css";
|
||||||
if (file_exists($localCssFilePath)) {
|
$localCssFilePath = $parts["dirname"]."/".$localCss;
|
||||||
# Warning, using htmhem.php?url=… will make $localCss not found
|
if (file_exists($localCssFilePath)) {
|
||||||
# as the path is relative to htmgem.php and not / !
|
# Warning, using htmhem.php?url=… will make $localCss not found
|
||||||
$t->addCss($localCss);
|
# as the path is relative to htmgem.php and not / !
|
||||||
}
|
$t->addCss($localCss);
|
||||||
} else { #TODO: regex check for $style
|
|
||||||
$t->addCss("/htmgem/css/$style.css");
|
|
||||||
}
|
}
|
||||||
|
} else { #TODO: regex check for $style
|
||||||
|
$t->addCss("/htmgem/css/$style.css");
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $t->getFullHtml();
|
echo $t->getFullHtml();
|
||||||
|
@ -170,8 +170,7 @@ class GemtextTranslate_html {
|
|||||||
|
|
||||||
function __construct($parsedGemtext, $textDecorationEnabled=true) {
|
function __construct($parsedGemtext, $textDecorationEnabled=true) {
|
||||||
if (empty($parsedGemtext))
|
if (empty($parsedGemtext))
|
||||||
// So translate() will do no loop.
|
$parsedGemtext = "";
|
||||||
$parsedGemtext = array();
|
|
||||||
elseif (is_string($parsedGemtext))
|
elseif (is_string($parsedGemtext))
|
||||||
// to delete the last empty line, <p> </p> in HTML
|
// to delete the last empty line, <p> </p> in HTML
|
||||||
$parsedGemtext = rtrim($parsedGemtext);
|
$parsedGemtext = rtrim($parsedGemtext);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user