Fix for #8777

Now filter name is trimmed and lowercased before evaluation for case
insensitive and whitespace trimemd check.

Signed-off-by: Oh Jinkyun <tintypemolly@gmail.com>
It seems from reading #8777 that the test data could be more exhaustive (for example, I can't see tests involving spaces in the filter specification while trimming is an important part of the submitted patch).