HTMLparser_tags

Properties

overrideAttribs

overrideAttribs
Type
string

If set, this string is preset as the attributes of the tag.

allowedAttribs

allowedAttribs
Type
mixed

Defines the allowed attributes.

Possible values:

0
No attributes allowed.
(comma-separated list of attributes)
Only attributes in this list are allowed.
(blank/not set)
All attributes are allowed.

fixAttrib.[attribute].set

fixAttrib.[attribute].set
Type
string

Force the attribute value to this value.

fixAttrib.[attribute].unset

fixAttrib.[attribute].unset
Type
boolean

If set, the attribute is unset.

fixAttrib.[attribute].default

fixAttrib.[attribute].default
Type
string

If no attribute exists by this name, this value is set as default value (if this value is not blank)

fixAttrib.[attribute].always

fixAttrib.[attribute].always
Type
boolean

If set, the attribute is always processed. Normally an attribute is processed only if it exists

fixAttrib.[attribute].trim

fixAttrib.[attribute].trim
Type
boolean

If true, the value is passed through the respective PHP-function.

fixAttrib.[attribute].intval

fixAttrib.[attribute].intval
Type
boolean

If true, the value is passed through the respective PHP-function.

fixAttrib.[attribute].upper

fixAttrib.[attribute].upper
Type
boolean

If true, the value is passed through the PHP function strtoupper().

fixAttrib.[attribute].lower

fixAttrib.[attribute].lower
Type
boolean

If true, the value is passed through the PHP function strtolower().

fixAttrib.[attribute].range

fixAttrib.[attribute].range
Type
[low],[high]

Setting integer range.

fixAttrib.[attribute].list

fixAttrib.[attribute].list
Type
list of values, trimmed

Attribute value must be in this list. If not, the value is set to the first element.

fixAttrib.[attribute].removeIfFalse

fixAttrib.[attribute].removeIfFalse
Type
boolean / blank string

If set, then the attribute is removed if it is false (= 0). If this value is set to blank then the value must be a blank string (that means a "zero" value will not be removed).

fixAttrib.[attribute].removeIfEquals

fixAttrib.[attribute].removeIfEquals
Type
string

If the attribute value matches the value set here, then it is removed.

fixAttrib.[attribute].casesensitiveComp

fixAttrib.[attribute].casesensitiveComp
Type
boolean

If set, the comparison in fixAttrib.[attribute].removeIfEquals and fixAttrib.[attribute].list will be case-sensitive. At this point, it's insensitive.

fixAttrib.[attribute].prefixRelPathWith

fixAttrib.[attribute].prefixRelPathWith
Type
string

If the value of the attribute seems to be a relative URL (no scheme like "http" and no "/" as first char) then the value of this property will be prefixed the attribute.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.parser.fixAttrib.src.prefixRelPathWith = https://example.org/typo3/32/dummy/
Copied!

fixAttrib.[attribute].userFunc

fixAttrib.[attribute].userFunc
Type
function name

User function for processing of the attribute. The return value of this function will be used as the new tag value.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.parser.fixAttrib.href.userFunc = \Vendor\ExtName\ClassName->function
Copied!

Two parameters are passed to the function:

  1. The tag value as a string or an array containing the tag value and additional configuration (see below).
  2. The reference the to HtmlParser instance that calls the method.

By default the first parameter is the value of the processed tag. This changes when you pass additional configuration options to the user function:

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.parser.fixAttrib.href.userFunc.myCustomParm = myCustomValue
Copied!

In that case the first parameter passed to the user function will be an array containing these values:

protect

protect
Type
boolean

If set, the tag <> is converted to &lt; and &gt;

remap

remap
Type
string

If set, the tagname is remapped to this tagname

rmTagIfNoAttrib

rmTagIfNoAttrib
Type
boolean

If set, then the tag is removed if no attributes happened to be there.

nesting

nesting
Type
mixed

If set true, then this tag must have starting and ending tags in the correct order. Any tags not in this order will be discarded. Thus </B><B><I></B></I></B> will be converted to <B><I></B></I>.

Is the value "global" then true nesting in relation to other tags marked for "global" nesting control is preserved. This means that if <B> and <I> are set for global nesting then this string </B><B><I></B></I></B> is converted to <B></B>