public static function applyAdditionMarkupFunction($dataItem, $valueToRender, $renderedText)
    {
        $markupExtension = CiteProc::getContext()->getMarkupExtension();
        if (array_key_exists($valueToRender, $markupExtension)) {
            $function = $markupExtension[$valueToRender];
            if (is_callable($function)) {
                $renderedText = $function($dataItem, $renderedText);
            }
        } else if (array_key_exists($mode = CiteProc::getContext()->getMode(), $markupExtension)) {
            if (array_key_exists($valueToRender, $markupExtension[$mode])) {
                $function = CiteProc::getContext()->getMarkupExtension()[$mode][$valueToRender];
                if (is_callable($function)) {
                    $renderedText = $function($dataItem, $renderedText);
                }
            }
        }
        return $renderedText;
    }