Ignore:
Timestamp:
2009-03-11T11:08:05+01:00 (16 years ago)
Author:
stoecker
Message:

remove translations block from wiki load

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/WikiReader.java

    r1480 r1483  
    4747    private String readFromTrac(BufferedReader in, String url) throws IOException {
    4848        boolean inside = false;
     49        boolean transl = false;
    4950        String b = "";
    5051        for (String line = in.readLine(); line != null; line = in.readLine()) {
    5152            if (line.contains("<div id=\"searchable\">"))
    5253                inside = true;
     54            else if (line.contains("<div class=\"wiki-toc trac-nav\""))
     55                transl = true;
    5356            else if (line.contains("<div class=\"wikipage searchable\">"))
    5457                inside = true;
    5558            else if (line.contains("<div class=\"buttons\">"))
    5659                inside = false;
    57             if (inside) {
     60            if (inside && !transl) {
    5861                b += line.replaceAll("<img src=\"/", "<img src=\""+baseurl+"/")
    5962                         .replaceAll("href=\"/", "href=\""+baseurl+"/")
    6063                         .replaceAll(" />", ">") + "\n";
    6164            }
     65            else if (transl && line.contains("</div>"))
     66                transl = false;
    6267        }
    6368        return "<html>" + b + "</html>";
Note: See TracChangeset for help on using the changeset viewer.