fixing/changing wiki image inline code

for local images hosted within DATA/HTDOCS


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1217 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2005-12-16 00:54:24 +00:00
parent dbd6cc57dc
commit c4dd39e8f2

View File

@ -348,11 +348,13 @@ public class wikiCode {
alt = " alt=\"" + kv + "\"";
}
// replace incomplete URLs and make them point to http://peerip:port/share/...
// replace incomplete URLs and make them point to http://peerip:port/...
// with this feature you can acces an image in DATA/HTDOCS/share/yacy.gif
// using the wikicode [[Image:share/yacy.gif]]
// or an image DATA/HTDOCS/grafics/kaskelix.jpg with [[Image:grafics/kaskelix.jpg]]
// you are free to use other sub-paths of DATA/HTDOCS
if (!((kl.startsWith("http://"))||(kl.startsWith("ftp://")))) {
final String ip = yacyCore.seedDB.mySeed.getAddress().trim();
final String port = sb.getConfig("port", "8080").trim();
kl = "http://" + ip + ":" + port + "/share/" + kl;
kl = "http://" + yacyCore.seedDB.mySeed.getAddress().trim() + "/" + kl;
}
result = result.substring(0, p0) + "<img src=\"" + kl + "\"" + align.trim() + alt.trim() + ">" + result.substring(p1 + 2);