.balancedDelete()

Method to delete a token, its corresponding ending tag if it exists and optional also the token's content. The script detects whether the token is a tag and whether the token has a corresponding end tag. If an end tag exists, the start tag and the end tag will be removed from the file. If the token is regular text or a tag without an end tag (such as img tags), only the token will be removed.

Note: After using this function you need to save the file.

The method .balancedDelete() is located in the file token.jsxinc.

Usage

To delete only the token and not it's content

token.balancedDelete(false);

To delete the token AND it's content

token.balancedDelete(true);

Parameters

Parameter Data type Required Description
contentdelete Boolean If true, the function deletes not only the tag but also all the content of the tag. If false, the function only deletes the tag and the end tag (if it exists).

Return values

Value Meaning
null Method encountered an error.
true Token deleted.