Changeset 1483 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2009-03-11T11:08:05+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r1480 r1483 47 47 private String readFromTrac(BufferedReader in, String url) throws IOException { 48 48 boolean inside = false; 49 boolean transl = false; 49 50 String b = ""; 50 51 for (String line = in.readLine(); line != null; line = in.readLine()) { 51 52 if (line.contains("<div id=\"searchable\">")) 52 53 inside = true; 54 else if (line.contains("<div class=\"wiki-toc trac-nav\"")) 55 transl = true; 53 56 else if (line.contains("<div class=\"wikipage searchable\">")) 54 57 inside = true; 55 58 else if (line.contains("<div class=\"buttons\">")) 56 59 inside = false; 57 if (inside ) {60 if (inside && !transl) { 58 61 b += line.replaceAll("<img src=\"/", "<img src=\""+baseurl+"/") 59 62 .replaceAll("href=\"/", "href=\""+baseurl+"/") 60 63 .replaceAll(" />", ">") + "\n"; 61 64 } 65 else if (transl && line.contains("</div>")) 66 transl = false; 62 67 } 63 68 return "<html>" + b + "</html>";
Note:
See TracChangeset
for help on using the changeset viewer.