Correctly filter empty elements in String::resolveFlaggedUrl()