// Clean the given string. Remove `br`, strip all html tags and replace non-breaking and double spaces with an normal space
prototype(GesagtGetan.Basic:Clean) < prototype(Neos.Fusion:Value) {
    input = ${value}
    value = ${String.trim(String.pregReplace(String.replace(String.stripTags(String.pregReplace(this.input, '/<br\/?>/', ' ')), ' ', ' '), '/\s\s+/', ' '))}
}

// Replace `br` with an space and strip all html tags from the given string
prototype(GesagtGetan.Basic:Clean.stripTags) < prototype(Neos.Fusion:Value) {
    input = ${value}
    value = ${String.trim(String.stripTags(String.pregReplace(this.input, '/<br\/?>/', ' ')))}
}

// Replace non-breaking spaces and double spaces with a normal space
prototype(GesagtGetan.Basic:Clean.nbsp) < prototype(Neos.Fusion:Value) {
    input = ${value}
    value = ${String.trim(String.pregReplace(String.replace(this.input, ' ', ' '), '/\s\s+/', ' '))}
}
