# https://invisible-island.net/archives/temp/lynx2.9.0dev.10+fish2.patch.gz # patch by Thomas E. Dickey # created Mon Jun 13 09:16:45 UTC 2022 # ------------------------------------------------------------------------------ # WWW/Library/Implementation/SGML.c | 18 ++++++++++++------ # WWW/Library/Implementation/SGML.h | 6 ++++-- # src/HTInit.c | 2 +- # src/HTML.c | 18 ++++++++++++++---- # src/HTML.h | 7 ++++++- # 5 files changed, 37 insertions(+), 14 deletions(-) # ------------------------------------------------------------------------------ Index: WWW/Library/Implementation/SGML.c --- lynx2.9.0dev.10+/WWW/Library/Implementation/SGML.c 2021-10-24 22:18:29.000000000 +0000 +++ lynx2.9.0dev.10+fish2/WWW/Library/Implementation/SGML.c 2022-06-13 09:12:45.531314299 +0000 @@ -1,5 +1,5 @@ /* - * $LynxId: SGML.c,v 1.182 2021/10/24 22:18:29 tom Exp $ + * $LynxId: SGML.c,v 1.182.1.2 2022/06/13 00:20:50 tom Exp tom $ * * General SGML Parser code SGML.c * ======================== @@ -1621,7 +1621,8 @@ && !(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 @@ 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 @@ 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 @@ sgml_in_psrc_was_initialized = TRUE; } #endif + if (extended_html) + { + me->extended_html = TRUE; + } sgml_offset = 0; return me; Index: WWW/Library/Implementation/SGML.h --- lynx2.9.0dev.10+/WWW/Library/Implementation/SGML.h 2021-07-22 23:34:13.000000000 +0000 +++ lynx2.9.0dev.10+fish2/WWW/Library/Implementation/SGML.h 2022-06-13 09:12:45.531314299 +0000 @@ -1,5 +1,5 @@ /* - * $LynxId: SGML.h,v 1.47 2021/07/22 23:34:13 tom Exp $ + * $LynxId: SGML.h,v 1.47.1.1 2022/06/12 20:19:04 shlomi.fish Exp tom $ * SGML parse and stream definition for libwww * SGML AND STRUCTURED STREAMS * @@ -281,7 +281,9 @@ */ extern HTStream *SGML_new(const SGML_dtd * dtd, HTParentAnchor *anchor, - HTStructured * target); + HTStructured * target, + int extended_html) + ; extern const HTStreamClass SGMLParser; Index: src/HTInit.c --- lynx2.9.0dev.10+/src/HTInit.c 2020-01-21 22:20:09.000000000 +0000 +++ lynx2.9.0dev.10+fish2/src/HTInit.c 2022-06-13 09:14:13.354448503 +0000 @@ -178,7 +178,7 @@ * 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); Index: src/HTML.c --- lynx2.9.0dev.10+/src/HTML.c 2021-10-24 19:10:57.000000000 +0000 +++ lynx2.9.0dev.10+fish2/src/HTML.c 2022-06-13 09:12:45.531314299 +0000 @@ -7957,7 +7957,7 @@ 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 @@ 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 @@ 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 @@ 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 */ Index: src/HTML.h --- lynx2.9.0dev.10+/src/HTML.h 2019-08-23 23:18:06.000000000 +0000 +++ lynx2.9.0dev.10+fish2/src/HTML.h 2022-06-13 09:12:45.531314299 +0000 @@ -1,5 +1,5 @@ /* - * $LynxId: HTML.h,v 1.34 2019/08/23 23:18:06 tom Exp $ + * $LynxId: HTML.h,v 1.34.1.1 2022/06/12 20:19:04 shlomi.fish Exp tom $ * * HTML to rich text converter for libwww * @@ -251,6 +251,11 @@ HTParentAnchor *anchor, HTStream *sink); + extern HTStream *XHTMLPresent(HTPresentation *pres, + HTParentAnchor *anchor, + HTStream *sink); + + extern HTStructured *HTML_new(HTParentAnchor *anchor, HTFormat format_out, HTStream *target);