From ab5bba5ccd3496175b0f4311b23f46ad990d26d6 Mon Sep 17 00:00:00 2001 From: Christophe HENRY Date: Thu, 4 Mar 2021 21:59:57 +0100 Subject: [PATCH] WIP --- TODO | 1 + htmgem.css | 5 +++++ htmgem.php | 4 ++-- tests/test.gmi | 5 ----- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index 8e85554..e72a6a2 100644 --- a/TODO +++ b/TODO @@ -12,3 +12,4 @@ * Command line API for script and testing. * Manage anchors * Page menu on upper and lower sides: [parent dir] [root dir] [inline images] [raw response] [view cert] +* Check unicode capability diff --git a/htmgem.css b/htmgem.css index 68fc1e6..b0de5f3 100644 --- a/htmgem.css +++ b/htmgem.css @@ -20,6 +20,11 @@ p, pre { padding: 0; } +p { + text-align: justify; + text-justify: inter-word; +} + li { margin: 0; padding: 0; diff --git a/htmgem.php b/htmgem.php index acc3a6f..8353cb4 100644 --- a/htmgem.php +++ b/htmgem.php @@ -75,7 +75,7 @@ function addTextAttributes(&$line) { * @param $text1, $text2 texts to process */ function htmlEscape(&$text) { - $text = htmlspecialchars($text, ENT_HTML5, "UTF-8", false); + $text = htmlspecialchars($text, ENT_HTML5|ENT_NOQUOTES, "UTF-8", false); $text = mb_ereg_replace("\ ([?!:;»€$])", " \\1", $text); # Espace fine insécable $text = mb_ereg_replace("([«])\ ", "\\1 ", $text); # Espace fine insécable } @@ -94,7 +94,7 @@ foreach ($fileLines as $line) { if (empty($line)) { print("

 

\n"); } elseif (b"\xEF\xBB\xBF" == $line3) { - # Removes the BOM + # Removes the Byte Order Mark $line = substr($line, 3); continue; } elseif ("#" == $line1) { diff --git a/tests/test.gmi b/tests/test.gmi index 9d9fb42..79838fe 100644 --- a/tests/test.gmi +++ b/tests/test.gmi @@ -43,7 +43,6 @@ Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium dolor => ... # Preformatted text -""" ``` Preformatted text At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. @@ -58,11 +57,7 @@ At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praese Not in HTML bold and not in **markup bold** ``` -""" -``` -Preformatted text with **bold**, //italic//, and so on… But still not HTML stuff. -``` # Quotations