From a9fb49802a69ddc030c74da265118284fd2946ec Mon Sep 17 00:00:00 2001 From: Christophe HENRY Date: Mon, 5 Apr 2021 11:36:14 +0200 Subject: [PATCH] FIX adds alt property to preformated text in HTML --- lib-htmgem.inc.php | 3 ++- tests/files_with_html/preformated-utf-16.gmi.html | 6 +++--- tests/files_with_html/preformated.gmi.html | 6 +++--- tests/files_with_html/text-utf-16.gmi.html | 4 ++-- tests/files_with_html/text.gmi.html | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib-htmgem.inc.php b/lib-htmgem.inc.php index f93baf4..cc305ec 100644 --- a/lib-htmgem.inc.php +++ b/lib-htmgem.inc.php @@ -314,7 +314,8 @@ class GemtextTranslate_html { case "```": $text = implode("\n", $node["texts"]); self::htmlPrepare($text); - $output .= "
\n$text\n
\n"; + $alt = $node["alt"]; + $output .= "
\n$text\n
\n"; break; case ">": $output .= "
\n"; diff --git a/tests/files_with_html/preformated-utf-16.gmi.html b/tests/files_with_html/preformated-utf-16.gmi.html index 3398b98..cb4747d 100644 --- a/tests/files_with_html/preformated-utf-16.gmi.html +++ b/tests/files_with_html/preformated-utf-16.gmi.html @@ -1,13 +1,13 @@ -
+
 Bellow here, an empty line
 
 

 

-
+
  
 

 

-
+
 No
 alt
 text
diff --git a/tests/files_with_html/preformated.gmi.html b/tests/files_with_html/preformated.gmi.html
index 3398b98..cb4747d 100644
--- a/tests/files_with_html/preformated.gmi.html
+++ b/tests/files_with_html/preformated.gmi.html
@@ -1,13 +1,13 @@
-
+
 Bellow here, an empty line
 
 

 

-
+
  
 

 

-
+
 No
 alt
 text
diff --git a/tests/files_with_html/text-utf-16.gmi.html b/tests/files_with_html/text-utf-16.gmi.html
index 4f3b03d..2f1f765 100644
--- a/tests/files_with_html/text-utf-16.gmi.html
+++ b/tests/files_with_html/text-utf-16.gmi.html
@@ -223,7 +223,7 @@
 

 

Lines beginning with the two characters "=>" are link lines, which have the following syntax:

 

-
+
 =>[<whitespace>]<URL>[<whitespace><USER-FRIENDLY LINK NAME>]
 

 

@@ -237,7 +237,7 @@

 

All the following examples are valid link lines:

 

-
+
 => gemini://example.org/
 => gemini://example.org/ An example link
 => gemini://example.org/foo	Another example link at the same host
diff --git a/tests/files_with_html/text.gmi.html b/tests/files_with_html/text.gmi.html
index 4f3b03d..2f1f765 100644
--- a/tests/files_with_html/text.gmi.html
+++ b/tests/files_with_html/text.gmi.html
@@ -223,7 +223,7 @@
 

 

Lines beginning with the two characters "=>" are link lines, which have the following syntax:

 

-
+
 =>[<whitespace>]<URL>[<whitespace><USER-FRIENDLY LINK NAME>]
 

 

@@ -237,7 +237,7 @@

 

All the following examples are valid link lines:

 

-
+
 => gemini://example.org/
 => gemini://example.org/ An example link
 => gemini://example.org/foo	Another example link at the same host