WP_HTML_Tag_Processor::get_updated_html(): string

In this article

Returns the string representation of the HTML Tag Processor.

Return

string The processed HTML.

Source


			case 'xml:lang':
				return 'xml lang';

			case 'xml:space':
				return 'xml space';

			case 'xmlns':
				return 'xmlns';

			case 'xmlns:xlink':
				return 'xmlns xlink';
		}
	}

	return $attribute_name;
}

/**
 * Indicates if the currently matched tag contains the self-closing flag.
 *
 * No HTML elements ought to have the self-closing flag and for those, the self-closing
 * flag will be ignored. For void elements this is benign because they "self close"
 * automatically. For non-void HTML elements though problems will appear if someone
 * intends to use a self-closing element in place of that element with an empty body.
 * For HTML foreign elements and custom elements the self-closing flag determines if
 * they self-close or not.
 *
 * This function does not determine if a tag is self-closing,
 * but only if the self-closing flag is present in the syntax.
 *
 * @since 6.3.0
 *
 * @return bool Whether the currently matched tag contains the self-closing flag.
 */
public function has_self_closing_flag(): bool {
	if ( self::STATE_MATCHED_TAG !== $this->parser_state ) {
		return false;
	}

	/*
	 * The self-closing flag is the solidus at the _end_ of the tag, not the beginning.
	 *
	 * Example:
	 *
	 *     <figure />
	 *             ^ this appears one character before the end of the closing ">".
	 */

Changelog

VersionDescription
6.4.0No longer calls subclass method next_tag() after updating HTML.
6.2.1Shifts the internal cursor corresponding to the applied updates.
6.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.