diff --git a/lynx-2.9.0dev.10-xhtml.patch b/lynx-2.9.0dev.10-xhtml.patch
new file mode 100644
index 0000000..0b4ce93
--- /dev/null
+++ b/lynx-2.9.0dev.10-xhtml.patch
@@ -0,0 +1,165 @@
+From efc075db2309c3dee59b80b6a8488d5f429c0297 Mon Sep 17 00:00:00 2001
+From: "Thomas E. Dickey"
+Date: Mon, 13 Jun 2022 00:23:57 +0000
+Subject: [PATCH] add presentation type for xhtml
+
+...related state information to better handle things
+such as "" -Sholmi Fish, TD
+
+snapshot of project "lynx", label v2-9-0dev_10h
+
+Upstream-commit: 6308534d913fccf7c0a17d592b9584e15fac455c
+Signed-off-by: Kamil Dudka
+---
+ WWW/Library/Implementation/SGML.c | 16 +++++++++++-----
+ WWW/Library/Implementation/SGML.h | 4 +++-
+ src/HTInit.c | 2 +-
+ src/HTML.c | 18 ++++++++++++++----
+ src/HTML.h | 5 +++++
+ 5 files changed, 34 insertions(+), 11 deletions(-)
+
+diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
+index d120644..e211b2a 100644
+--- a/WWW/Library/Implementation/SGML.c
++++ b/WWW/Library/Implementation/SGML.c
+@@ -1621,7 +1621,8 @@ static BOOL ignore_when_empty(HTTag * tag)
+ && !(tag->flags & Tgf_mafse)
+ && tag->contents != SGML_EMPTY
+ && tag->tagclass != Tgc_Plike
+- && (tag->tagclass == Tgc_SELECTlike
++ && (tag->tagclass == Tgc_APPLETlike
++ || tag->tagclass == Tgc_SELECTlike
+ || (tag->contains && tag->icontains))) {
+ result = TRUE;
+ }
+@@ -3644,9 +3645,9 @@ static void SGML_character(HTStream *me, int c_in)
+ case S_attr:
+ if (WHITE(c) || (c == '>') || (c == '=')) { /* End of word */
+ if ((c == '>')
+- && (string->size == 1)
+- && (string->data[0] == '/')) {
+- if (me->extended_html
++ && (string->size >= 1)
++ && (string->data[string->size - 1] == '/')) {
++ if ((LYxhtml_parsing || me->extended_html)
+ && ignore_when_empty(me->current_tag)) {
+ discard_empty(me);
+ }
+@@ -4590,7 +4591,8 @@ const HTStreamClass SGMLParser =
+
+ HTStream *SGML_new(const SGML_dtd * dtd,
+ HTParentAnchor *anchor,
+- HTStructured * target)
++ HTStructured * target,
++ int extended_html)
+ {
+ HTStream *me = typecalloc(struct _HTStream);
+
+@@ -4660,6 +4662,10 @@ HTStream *SGML_new(const SGML_dtd * dtd,
+ sgml_in_psrc_was_initialized = TRUE;
+ }
+ #endif
++ if (extended_html)
++ {
++ me->extended_html = TRUE;
++ }
+
+ sgml_offset = 0;
+ return me;
+diff --git a/WWW/Library/Implementation/SGML.h b/WWW/Library/Implementation/SGML.h
+index 8b6445f..2ddef5f 100644
+--- a/WWW/Library/Implementation/SGML.h
++++ b/WWW/Library/Implementation/SGML.h
+@@ -281,7 +281,9 @@ Create an SGML parser
+ */
+ extern HTStream *SGML_new(const SGML_dtd * dtd,
+ HTParentAnchor *anchor,
+- HTStructured * target);
++ HTStructured * target,
++ int extended_html)
++ ;
+
+ extern const HTStreamClass SGMLParser;
+
+diff --git a/src/HTInit.c b/src/HTInit.c
+index c451762..bd41dee 100644
+--- a/src/HTInit.c
++++ b/src/HTInit.c
+@@ -178,7 +178,7 @@ void HTFormatInit(void)
+ * application/xhtml+xml
+ * text/html
+ */
+- SET_INTERNL("application/xhtml+xml", "www/present", HTMLPresent, 1.0);
++ SET_INTERNL("application/xhtml+xml", "www/present", XHTMLPresent, 1.0);
+ SET_INTERNL("application/xhtml+xml", "www/source", HTPlainPresent, 1.0);
+ SET_INTERNL("text/css", "www/present", HTPlainPresent, 1.0);
+ SET_INTERNL(STR_HTML, "www/present", HTMLPresent, 1.0);
+diff --git a/src/HTML.c b/src/HTML.c
+index a012466..9ec15c2 100644
+--- a/src/HTML.c
++++ b/src/HTML.c
+@@ -7957,7 +7957,7 @@ HTStream *HTMLToPlain(HTPresentation *pres,
+ CTRACE((tfp, "HTMLToPlain calling CacheThru_new\n"));
+ return CacheThru_new(anchor,
+ SGML_new(&HTML_dtd, anchor,
+- HTML_new(anchor, pres->rep_out, sink)));
++ HTML_new(anchor, pres->rep_out, sink), FALSE));
+ }
+
+ /* HTConverter for HTML source to plain text
+@@ -8020,7 +8020,7 @@ HTStream *HTMLParsedPresent(HTPresentation *pres,
+ CTRACE((tfp, "HTMLParsedPresent calling CacheThru_new\n"));
+ return CacheThru_new(anchor,
+ SGML_new(&HTML_dtd, anchor,
+- HTMLGenerator(intermediate)));
++ HTMLGenerator(intermediate), FALSE));
+ }
+
+ /* HTConverter for HTML to C code
+@@ -8048,7 +8048,7 @@ HTStream *HTMLToC(HTPresentation *pres GCC_UNUSED,
+ HTML_put_string(html, html->comment_start);
+ CTRACE((tfp, "HTMLToC calling CacheThru_new\n"));
+ return CacheThru_new(anchor,
+- SGML_new(&HTML_dtd, anchor, html));
++ SGML_new(&HTML_dtd, anchor, html, FALSE));
+ }
+
+ /* Presenter for HTML
+@@ -8067,7 +8067,17 @@ HTStream *HTMLPresent(HTPresentation *pres GCC_UNUSED,
+ CTRACE((tfp, "HTMLPresent calling CacheThru_new\n"));
+ return CacheThru_new(anchor,
+ SGML_new(&HTML_dtd, anchor,
+- HTML_new(anchor, WWW_PRESENT, NULL)));
++ HTML_new(anchor, WWW_PRESENT, NULL), FALSE));
++}
++
++HTStream *XHTMLPresent(HTPresentation *pres GCC_UNUSED,
++ HTParentAnchor *anchor,
++ HTStream *sink GCC_UNUSED)
++{
++ CTRACE((tfp, "XHTMLPresent calling CacheThru_new\n"));
++ return CacheThru_new(anchor,
++ SGML_new(&HTML_dtd, anchor,
++ HTML_new(anchor, WWW_PRESENT, NULL), TRUE));
+ }
+ #endif /* !GUI */
+
+diff --git a/src/HTML.h b/src/HTML.h
+index 9f5d1d5..0baa23e 100644
+--- a/src/HTML.h
++++ b/src/HTML.h
+@@ -251,6 +251,11 @@ extern "C" {
+ HTParentAnchor *anchor,
+ HTStream *sink);
+
++ extern HTStream *XHTMLPresent(HTPresentation *pres,
++ HTParentAnchor *anchor,
++ HTStream *sink);
++
++
+ extern HTStructured *HTML_new(HTParentAnchor *anchor,
+ HTFormat format_out,
+ HTStream *target);
+--
+2.35.3
+
diff --git a/lynx.spec b/lynx.spec
index 145350f..c18fb0d 100644
--- a/lynx.spec
+++ b/lynx.spec
@@ -3,7 +3,7 @@
Summary: A text-based Web browser
Name: lynx
Version: 2.9.0
-Release: %{devrel}.1%{?dist}.1
+Release: %{devrel}.2%{?dist}
License: GPLv2
Source: https://invisible-mirror.net/archives/lynx/tarballs/lynx%{version}%{devrel}.tar.bz2
URL: https://lynx.invisible-island.net/
@@ -20,6 +20,9 @@ Patch1: lynx-2.8.9-build.patch
# [CVE-2008-4690]
Patch2: lynx-CVE-2008-4690.patch
+# add presentation type for xhtml
+Patch3: lynx-2.9.0dev.10-xhtml.patch
+
Provides: webclient
Provides: text-www-browser
BuildRequires: dos2unix
@@ -51,6 +54,7 @@ exits quickly and swiftly displays web pages.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
sed -e "s,^HELPFILE:.*,HELPFILE:file://localhost%{_pkgdocdir}/lynx_help/lynx_help_main.html,g" -i lynx.cfg
@@ -128,6 +132,9 @@ EOF
%config(noreplace,missingok) %{_sysconfdir}/lynx-site.cfg
%changelog
+* Thu Jul 07 2022 Kamil Dudka - 2.9.0dev.10.2
+- add presentation type for xhtml
+
* Thu Jan 20 2022 Fedora Release Engineering - 2.9.0-dev.10.1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild