about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/SGML.c
diff options
context:
space:
mode:
Diffstat (limited to 'WWW/Library/Implementation/SGML.c')
-rw-r--r--WWW/Library/Implementation/SGML.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index d120644b..2534606e 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: SGML.c,v 1.182 2021/10/24 22:18:29 tom Exp $
+ * $LynxId: SGML.c,v 1.183 2022/06/13 00:20:50 tom Exp $
  *
  *			General SGML Parser code		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;