The ImportText recipe
(http://www.pmwiki.org/wiki/Cookbook/ImportText), does not always
handle the end of line delimiters adequately, especially when
importing files created on another platform than the one running
PmWIki.

The resulting PmWiki pages contain then "hard" delimiters instead of
having all the page content on one single "text=" line.

The following change fixed the issue for me.

import.php, line 142:

     $text = file_get_contents($fpath);

added:      $text = preg_replace('/(\\x0D\\x0A|\\x0A\\x0D)/', "\n", $text);

     $page = ReadPage($pn);
     $new = $page;
     $new['text'] = $text;
     UpdatePage($pn, $page, $new, $editfn);

May I suggest to include this in the next version of the recipe  ?

Christophe

_______________________________________________
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to