Filter/forwarder adding a HTML link element for advertising server-side SGML support.

Adds an element as follows to the HTML head element:

<link rel="alternate" type="text/sgml" href="#">

The presence of this link element makes SGML-UA recognize that the containing (initial landing) HTML page was prepared by SGML on the server side, and act accordingly (eg. wrt. session history management).

Note that the generated value for href is bogus, and only provided since a value is required by the HTML specification. Potential alternative "dummy" values are worse: a value of . (dot) is semantically incorrect on URLs that don't end in a slash, and an empty string might be misinterpreted on IE (when occuring on a plain a element, at least; see also eg. this StackOverflow article).

The actual href value is ignored by SGML-UA, and isn't used by browsers either (it might be evaluated by crawlers, though).

Note that a head element is expected in the input event stream; the filter won't insert a head element by itself, and won't generate a link element as described above when no head end-element event is delivered in the input event stream.

Note also that this filter will append a link element to any head child content, regardless of whether processing HTML or another vocabulary.

Note that for simplicity, this blindly appends the link element, ignoring whether an identical link element has already been delivered in upstream events, so the ouput may contain multiple link elements as described (which however is still valid and doesn't change the link element's semantics).

This filter is expected to be placed after markdownoutputfilter and before suppressdocumentelementfilter in a filter chain, (but will also work in another chain setup).

Implements DocumentHandler, LexicalHandler, DTDHandler.

Constructor

new HTMLServersideSGMLFilter(nexthandler)

Parameters

Name Type Description
nexthandler DocumentHandler

Name Description
add_server_side_sgml_support_link_element Flag indicating activation status of filter.

Member Details

Flag indicating activation status of filter.