Allowing HTML within WordPress excerpt

Allowing HTML within WordPress excerpt

Allowing HTML within WordPress excerpt is a very common request. Therefore, I am providing likely the most complete solution available on the Internet. The code is posted on stack exchange WordPress channel and is created by Pieter Goosen. The complete explanation with further examples can be found on the link provided.

function wpse_allowedtags() {
    // Add custom tags to this string
        return '