protected function apply_filter_chain($text, $filterchain, array $options = array(),
            array $skipfilters = null) {
        foreach ($filterchain as $filtername => $filter) {
            if ($skipfilters !== null && in_array($filtername, $skipfilters)) {
                continue;
            }
            $text = $filter->filter($text, $options);
        }
        return $text;
    }