<htmlFilter> Configuration Element

This element provides the HTML filter settings for use within Ephox EditLive! for XML.

Configuration Element Tree Structure

<editLive>
     ...
     <htmlFilter ... />
     ...
</editLive>

Required Attributes

wrapLength

Specifies the number of characters for each line within the HTML source.

Note

Setting the wrapLength to zero (0) turns wrapping off within the HTML source.

Optional Attributes

indentContent

This option specifies that EditLive! for XML will indent the content of appropriate tags, thus creating well formatted HTML source code. If left blank the default value will be used.

Default Value: true

Note

This attribute is a boolean and can only be true or false.

insertMissingNodes

If set to true, this attribute ensures that when required elements are missing from an XML document, EditLive! for XML can automatically re-add them to avoid validation errors.

Default Value: false

Note

This attribute is boolean and can only be true or false. It is advised that this value is left as false, so users can be aware when they have neglected to enter required element values.

logicalEmphasis

If set to true <B> tags will be replaced by <STRONG> tags and <I> tags will be replaced by <EM> tags. If left blank the default value will be used.

Default Value: true

Note

This attribute is a boolean and can only be true or false.

removeFontTags

If set to true EditLive! for XML will apply all style information via CSS. The relevant styles are then added within the <head> of the document. If not explicitly set this attribute will default to false.

Default Value: false

Note

In order to retain style and formatting information when this attribute is set to true ensure that the head of the document is retrieved and that the configuration file does not specify any embedded styles via the <styles> element (styles can still be specified via an external style sheet)

Note

This attribute is a boolean and can only be true or false.

quoteMarks

If set to true quotation marks (") will be escaped and therefore appear as &quot;. If left blank the default value will be used.

Default Value: true

Note

This attribute is a boolean and can only be true or false.

encloseText

If set to true content will be automatically be wrapped with paragraph (<p>) tags if it has not been properly enclosed with block tags. This is done to ensure that the content inside XHTML sections is valid.

Default Value: true

Note

This attribute is a boolean and can only be true or false.

Note

Ephox does not recommend setting this attribute to false as it may cause invalid HTML to be generated.

allowUnknownTags

If set to true tags not recognised in HTML or XHTML will be interpreted as custom tags inside XHTML sections. This will preserve the unknown tags. When set to false unknown tags will be HTML encoded i.g. "<unknownTag>" would be converted to "&lt;UnknownTag&gt;"

Default Value: true

Note

This attribute is a boolean and can only be true or false.

Note

When producing XHTML output allowing unknown tags to be preserved in the content may cause errors in validating the resulting XHTML. If the XHTML produced by EditLive! for XML is to be run through a validation process then it is recommended that this attribute be set to false.

Example

The following example demonstrates how to set the various attributes of the <htmlFilter> element.

<editLive>
    ...
    <htmlFilter wrapLength="68" indentContent="true" logicalEmphasis="true" />
    ...
</editLive> 

Remarks

To ensure EditLive! for XML provides valid XHTML content where required ensure that allowUnknownTags is set to false and outputXHTML is set to true.

The <htmlFilter> element can appear only once within the <editLive> element.

If the <htmlFilter> element is to be left blank the element must then be a complete tag, it cannot contain a tag body. Therefore the tag must be closed in the same line. It should appear as below:

<htmlFilter wrapLength=... />