Handle hashtags

--HG--
extra : rebase_source : 6f3b4f27a7e7243da9b078de5f89c137b21d8fbd
This commit is contained in:
Sébastien Lucas 2013-08-30 21:14:59 +02:00
parent 3b50b96d83
commit a42e24cba3

View file

@ -37,9 +37,14 @@ try {
if (preg_match ("/^#/", $path)) {
return $path;
}
$hash = "";
if (preg_match ("/^(.+)#(.+)$/", $path, $matches)) {
$path = $matches [1];
$hash = "#" . $matches [2];
}
$comp = $book->getComponentName ($component, $path);
if (!$comp) return "#";
return "$method'epubfs.php?{$add}comp=$comp'";
return "$method'epubfs.php?{$add}comp={$comp}{$hash}'";
};
$data = preg_replace_callback ("/(src=)[\"']([^:]*?)[\"']/", $callback, $data);