link tag move to header

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12509 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2013-01-03 05:56:13 +00:00
parent 62fd1f2124
commit 9fdff42e6c

View file

@ -116,9 +116,11 @@ class HTMLDisplayHandler
if(__DEBUG__==3) $start = getMicroTime();
// move <style ..></style> in body to the header
//$output = preg_replace_callback('!<style(.*?)<\/style>!is', array($this,'_moveStyleToHeader'), $output);
$output = preg_replace_callback('!<style(.*?)>(.*?)<\/style>!is', array($this,'_moveStyleToHeader'), $output);
// move <link ..></link> in body to the header
$output = preg_replace_callback('!<link(.*?)/>!is', array($this,'_moveLinkToHeader'), $output);
// move <meta ../> in body to the header
$output = preg_replace_callback('!<meta(.*?)(?:\/|)>!is', array($this,'_moveMetaToHeader'), $output);
@ -276,6 +278,17 @@ class HTMLDisplayHandler
Context::addHtmlHeader($matches[0]);
}
/**
* add html link code extracted from html body to Context, which will be
* printed inside <header></header> later.
* @param array $matches
* @return void
*/
function _moveLinkToHeader($matches)
{
Context::addHtmlHeader($matches[0]);
}
/**
* add meta code extracted from html body to Context, which will be
* printed inside <header></header> later.