about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTMLGen.c
diff options
context:
space:
mode:
Diffstat (limited to 'WWW/Library/Implementation/HTMLGen.c')
-rw-r--r--WWW/Library/Implementation/HTMLGen.c57
1 files changed, 37 insertions, 20 deletions
diff --git a/WWW/Library/Implementation/HTMLGen.c b/WWW/Library/Implementation/HTMLGen.c
index 6af8a344..32e83dde 100644
--- a/WWW/Library/Implementation/HTMLGen.c
+++ b/WWW/Library/Implementation/HTMLGen.c
@@ -83,7 +83,7 @@ struct _HTStructured {
 */
 
 PRIVATE void flush_breaks ARGS1(
-	HTStructured *, 	me)
+	HTStructured *,		me)
 {
     int i;
     for (i=0; i<= MAX_CLEANNESS; i++) {
@@ -92,7 +92,7 @@ PRIVATE void flush_breaks ARGS1(
 }
 
 PRIVATE void HTMLGen_flush ARGS1(
-	HTStructured *, 	me)
+	HTStructured *,		me)
 {
     (*me->targetClass.put_block)(me->target,
 				 me->buffer,
@@ -132,7 +132,7 @@ PRIVATE void HTMLGen_flush ARGS1(
  *  -preparsed flag. - kw
  */
 PRIVATE void do_cstyle_flush ARGS1(
-	HTStructured *, 	me)
+	HTStructured *,		me)
 {
     if (!me->text && LYPreparsedSource) {
 	me->text = HTMainText;
@@ -177,7 +177,7 @@ PRIVATE void allow_break ARGS3(
 **	by hand, too, though this is not a primary design consideration. TBL
 */
 PRIVATE void HTMLGen_put_character ARGS2(
-	HTStructured *, 	me,
+	HTStructured *,		me,
 	char,			c)
 {
     if (me->escape_specials && (unsigned char)c < 32) {
@@ -288,7 +288,7 @@ PRIVATE void HTMLGen_put_character ARGS2(
 **	---------------
 */
 PRIVATE void HTMLGen_put_string ARGS2(
-	HTStructured *, 	me,
+	HTStructured *,		me,
 	CONST char *,		s)
 {
     CONST char * p;
@@ -298,7 +298,7 @@ PRIVATE void HTMLGen_put_string ARGS2(
 }
 
 PRIVATE void HTMLGen_write ARGS3(
-	HTStructured *, 	me,
+	HTStructured *,		me,
 	CONST char *,		s,
 	int,			l)
 {
@@ -314,8 +314,8 @@ PRIVATE void HTMLGen_write ARGS3(
 **	Within the opening tag, there may be spaces
 **	and the line may be broken at these spaces.
 */
-PRIVATE void HTMLGen_start_element ARGS6(
-	HTStructured *, 	me,
+PRIVATE int HTMLGen_start_element ARGS6(
+	HTStructured *,		me,
 	int,			element_number,
 	CONST BOOL*,		present,
 	CONST char **,		value,
@@ -487,10 +487,8 @@ PRIVATE void HTMLGen_start_element ARGS6(
      */
 
 /* end really empty tags straight away */
-#define REALLY_EMPTY(e) ((HTML_dtd.tags[e].contents == SGML_EMPTY) && \
-			 !(HTML_dtd.tags[e].flags & Tgf_nreie))
 
-    if (LYPreparsedSource && REALLY_EMPTY(element_number))
+    if (LYPreparsedSource && ReallyEmptyTagNum(element_number))
     {
 	CTRACE((tfp, "STYLE:begin_element:ending EMPTY element style\n"));
 	do_cstyle_flush(me);
@@ -503,6 +501,24 @@ PRIVATE void HTMLGen_start_element ARGS6(
 		       Style_className, &hcode);
     }
 #endif /* USE_COLOR_STYLE */
+    if (element_number == HTML_OBJECT && tag->contents == SGML_LITTERAL) {
+	/*
+	 *  These conditions only approximate the ones used in HTML.c.
+	 *  Let our SGML parser know that further content is to be parsed
+	 *  normally not literally. - kw
+	 */
+	if (!present) {
+	    return HT_PARSER_OTHER_CONTENT;
+	} else if (!present[HTML_OBJECT_DECLARE] &&
+		   !(present[HTML_OBJECT_NAME]  &&
+		     value[HTML_OBJECT_NAME] && *value[HTML_OBJECT_NAME])) {
+	    if (present[HTML_OBJECT_SHAPES] ||
+		!(present[HTML_OBJECT_USEMAP] &&
+		  value[HTML_OBJECT_USEMAP] && *value[HTML_OBJECT_USEMAP]))
+		return HT_PARSER_OTHER_CONTENT;
+	}
+    }
+    return HT_OK;
 }
 
 /*		End Element
@@ -516,8 +532,8 @@ PRIVATE void HTMLGen_start_element ARGS6(
 **	should be linked to the whole stack not just the top one.)
 **	TBL 921119
 */
-PRIVATE void HTMLGen_end_element ARGS3(
-	HTStructured *, 	me,
+PRIVATE int HTMLGen_end_element ARGS3(
+	HTStructured *,		me,
 	int,			element_number,
 	char **,		insert GCC_UNUSED)
 {
@@ -544,7 +560,7 @@ PRIVATE void HTMLGen_end_element ARGS3(
     TrimColorClass(HTML_dtd.tags[element_number].name,
 		   Style_className, &hcode);
 
-    if (LYPreparsedSource && !REALLY_EMPTY(element_number))
+    if (LYPreparsedSource && !ReallyEmptyTagNum(element_number))
     {
 	CTRACE((tfp, "STYLE:end_element: ending non-EMPTY style\n"));
 	do_cstyle_flush(me);
@@ -555,6 +571,7 @@ PRIVATE void HTMLGen_end_element ARGS3(
 #endif /* USE_HASH */
     }
 #endif /* USE_COLOR_STYLE */
+    return HT_OK;
 }
 
 /*		Expanding entities
@@ -562,7 +579,7 @@ PRIVATE void HTMLGen_end_element ARGS3(
 **
 */
 PRIVATE int HTMLGen_put_entity ARGS2(
-	HTStructured *, 	me,
+	HTStructured *,		me,
 	int,			entity_number)
 {
     int nent = HTML_dtd.number_of_entities;
@@ -580,7 +597,7 @@ PRIVATE int HTMLGen_put_entity ARGS2(
 **
 */
 PRIVATE void HTMLGen_free ARGS1(
-	HTStructured *, 	me)
+	HTStructured *,		me)
 {
     (*me->targetClass.put_character)(me->target, '\n');
     HTMLGen_flush(me);
@@ -592,14 +609,14 @@ PRIVATE void HTMLGen_free ARGS1(
 }
 
 PRIVATE void PlainToHTML_free ARGS1(
-	HTStructured *, 	me)
+	HTStructured *,		me)
 {
     HTMLGen_end_element(me, HTML_PRE, 0);
     HTMLGen_free(me);
 }
 
 PRIVATE void HTMLGen_abort ARGS2(
-	HTStructured *, 	me,
+	HTStructured *,		me,
 	HTError,		e GCC_UNUSED)
 {
     HTMLGen_free(me);
@@ -609,7 +626,7 @@ PRIVATE void HTMLGen_abort ARGS2(
 }
 
 PRIVATE void PlainToHTML_abort ARGS2(
-	HTStructured *, 	me,
+	HTStructured *,		me,
 	HTError,		e GCC_UNUSED)
 {
     PlainToHTML_free(me);
@@ -633,7 +650,7 @@ PRIVATE CONST HTStructuredClass HTMLGeneration = /* As opposed to print etc */
 */
 extern int LYcols;			/* LYCurses.h, set in LYMain.c	*/
 extern BOOL dump_output_immediately;	/* TRUE if no interactive user	*/
-extern int dump_output_width;		/* -width instead of 80 	*/
+extern int dump_output_width;		/* -width instead of 80		*/
 
 PUBLIC HTStructured * HTMLGenerator ARGS1(
 	HTStream *,		output)