Hi,

here's a small patch, that removes unnecessary <p> tags und thus the
ugly gaps when parsing the MOTD.

Robin
Index: src/org/openstreetmap/josm/gui/GettingStarted.java
===================================================================
--- src/org/openstreetmap/josm/gui/GettingStarted.java  (revision 996)
+++ src/org/openstreetmap/josm/gui/GettingStarted.java  (working copy)
@@ -73,7 +73,7 @@
             /* look for hrefs of the form wiki/MessageOfTheDay>123 where > can 
also be <,<=,>= and the number is the revision number */
             int start = 0;
             boolean nothingIncluded = true;
-            Pattern versionPattern = 
Pattern.compile("\\<a[^\\>]*href\\=\\\"([^\\\"]*\\/wiki\\/)(MessageOfTheDay(\\%3E%3D|%3C%3D|\\%3E|\\%3C)([0-9]+))\\\"[^\\>]*\\>[^\\<]*\\<\\/a\\>",
 Pattern.CASE_INSENSITIVE|Pattern.DOTALL|Pattern.MULTILINE);
+            Pattern versionPattern = 
Pattern.compile("(?:\\<p\\>\\s*)?\\<a[^\\>]*href\\=\\\"([^\\\"]*\\/wiki\\/)(MessageOfTheDay(\\%3E%3D|%3C%3D|\\%3E|\\%3C)([0-9]+))\\\"[^\\>]*\\>[^\\<]*\\<\\/a\\>(?:\\s*\\</p\\>)?",
 Pattern.CASE_INSENSITIVE|Pattern.DOTALL|Pattern.MULTILINE);
             Matcher matcher = versionPattern.matcher(motdcontent);
             matcher.reset();
             while (matcher.find()) {
@@ -131,8 +131,7 @@
                 }
             }
             content += motdcontent.substring(start);
-            content = content.replace("<html>", "<html><style>\nbody { 
font-family: sans-serif; font-weight: bold; }\n</style>");
-            content = content.replace("<h1", "<h1 align=\"center\"");
+            content = content.replace("<html>", "<html><style 
type=\"text/css\">\nbody { font-family: sans-serif; font-weight: bold; }\nh1 
{text-align: center;}</style>");
             /* replace the wiki title */ 
             content = content.replace("JOSM, the Java OpenStreetMap editor", 
tr("JOSM, the Java OpenStreetMap editor")); 
         }
_______________________________________________
Talk-de mailing list
Talk-de@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-de

Antwort per Email an