View Single Post
Old 10-13-2008, 03:19 AM   #5
Pulp
Palm Addict
Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.Pulp ought to be getting tired of karma fortunes by now.
 
Pulp's Avatar
 
Posts: 477
Karma: 1001951
Join Date: Aug 2008
Device: Cybook Gen3 [512mb, FW: 1.5]
Ich habe die besten Ergebnisse damit gemacht rtf als gefiltertes html in word abzuspeichern, danach lasse ich folgendes php-script drüberlaufen, daß ich geschrieben habe um unnötige tags und Zeilenumbrüche zu entfernen und das eine recht brauchbare html-version überläßt, die sich dann mit dem Mobipocket Creator importieren läßt.

Code:
$text = str_replace(array("<body","</body>","<p","</p>"), array("{body}<body","</body>{/body}","{p}<p","</p>{/p}"), $text);
$text = strip_tags($text, "<b><i><u><html><head><title><h1><h2><h3><h4><h5><h6><img><ul><ol><li>");
$text = str_replace(array("{body}","{/body}","{p}","{/p}"," n "," n."," n,"), array("<body>","</body>","<p>","</p>","n ","n.","n,"), $text);
$text = preg_replace('/>\s*</','><',$text);
$text = preg_replace('/\s\s*\s/',' ',$text);
$text = preg_replace('/([a-zA-Z\d\,])<\/p><p>/','$1 ',$text);
$text = str_replace("</i><i>","",$text);
$text = str_replace("</b><b>","",$text);
$text = str_replace("</i><i>","",$text);
(es ließe sich sicher noch optimieren, aber dazu bin ich zu faul - ich bastel einfach immer noch was dazu wenn mir was neues auf-/einfällt )
Pulp is offline   Reply With Quote