Showing with 37 additions and 8 deletions.
  1. +9 −2 WWW/Library/Implementation/SGML.c
  2. +3 −1 WWW/Library/Implementation/SGML.h
  3. +1 −1 src/HTInit.c
  4. +19 −4 src/HTML.c
  5. +5 −0 src/HTML.h
11 changes: 9 additions & 2 deletions WWW/Library/Implementation/SGML.c
Expand Up @@ -3647,7 +3647,9 @@ static void SGML_character(HTStream *me, int c_in)
&& (string->size == 1)
&& (string->data[0] == '/')) {
if (me->extended_html
&& ignore_when_empty(me->current_tag)) {
&& 1
// ignore_when_empty(me->current_tag)
) {
discard_empty(me);
}
} else {
Expand Down Expand Up @@ -4590,7 +4592,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);

Expand Down Expand Up @@ -4660,6 +4663,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;
Expand Down
4 changes: 3 additions & 1 deletion WWW/Library/Implementation/SGML.h
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/HTInit.c
Expand Up @@ -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);
Expand Down
23 changes: 19 additions & 4 deletions src/HTML.c
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -8067,7 +8067,22 @@ 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"));
#if 0
HTStream *ret=HTMLPresent(pres, anchor, sink);
ret->extended_html = TRUE;
return ret;
#endif
return CacheThru_new(anchor,
SGML_new(&HTML_dtd, anchor,
HTML_new(anchor, WWW_PRESENT, NULL), TRUE));
}
#endif /* !GUI */

Expand Down
5 changes: 5 additions & 0 deletions src/HTML.h
Expand Up @@ -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);
Expand Down