public function loadCssFilesFromLinks($message)
    {
        $dom = new \DOMDocument();
        // set error level
        $internalErrors = libxml_use_internal_errors(true);
        
        $dom->loadHTML($message);
        
        // Restore error level
        libxml_use_internal_errors($internalErrors);
        $link_tags = $dom->getElementsByTagName('link');

        if ($link_tags->length > 0) {
            do {
                if ($link_tags->item(0)->getAttribute('rel') == "stylesheet") {
                    $options['css-files'][] = $link_tags->item(0)->getAttribute('href');

                    // remove the link node
                    $link_tags->item(0)->parentNode->removeChild($link_tags->item(0));
                }
            } while ($link_tags->length > 0);

            if (isset($options)) {
                // reload the options
                $this->loadOptions($options);
            }

            return $dom->saveHTML();
        }

        return $message;
    }